diff --git a/addons/account_invoice_layout/account_invoice_layout.py b/addons/account_invoice_layout/account_invoice_layout.py index 3337710420f..1690ac4319e 100644 --- a/addons/account_invoice_layout/account_invoice_layout.py +++ b/addons/account_invoice_layout/account_invoice_layout.py @@ -165,7 +165,8 @@ class account_invoice_line(osv.osv): } def _default_account(self, cr, uid, context=None): - cr.execute("select id from account_account where parent_id IS NULL LIMIT 1") + current_company = self.pool.get('res.users').browse(cr,uid,uid).company_id.id + cr.execute("select id from account_account where company_id = %s and parent_id IS NULL LIMIT 1", [current_company]) res = cr.fetchone() return res[0]