← Back to team overview

openerp-community team mailing list archive

[Merge] lp:~openerp-community/openobject-addons/lpistone_6.0_lp784499 into lp:openobject-addons/6.0

 

Leonardo Pistone - Domsense has proposed merging lp:~openerp-community/openobject-addons/lpistone_6.0_lp784499 into lp:openobject-addons/6.0.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #784499 in OpenERP Addons: "with account_invoice_layout multi-company, non-product lines can get a wrong account_id and not be shown"
  https://bugs.launchpad.net/openobject-addons/+bug/784499

For more details, see:
https://code.launchpad.net/~openerp-community/openobject-addons/lpistone_6.0_lp784499/+merge/61377
-- 
https://code.launchpad.net/~openerp-community/openobject-addons/lpistone_6.0_lp784499/+merge/61377
Your team OpenERP Community is subscribed to branch lp:~openerp-community/openobject-addons/lpistone_6.0_lp784499.
=== modified file 'account_invoice_layout/account_invoice_layout.py'
--- account_invoice_layout/account_invoice_layout.py	2011-01-14 00:11:01 +0000
+++ account_invoice_layout/account_invoice_layout.py	2011-05-18 10:25:59 +0000
@@ -165,7 +165,8 @@
     }
 
     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]
 


Follow ups