diff options
| author | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2012-02-09 17:16:41 +0100 |
|---|---|---|
| committer | Quentin (OpenERP) <qdp-launchpad@openerp.com> | 2012-02-09 17:16:41 +0100 |
| commit | ef08879085f2df2d66b3dcfef67dccbaf1875e41 (patch) | |
| tree | 54fe7c3586b351daa7351b32ded4703683e0cee6 | |
| parent | 934954d63ac503107b4c40941a433e52d71be10c (diff) | |
[FIX] account, fiscalyear close wizard: fix related to multi company
bzr revid: qdp-launchpad@openerp.com-20120209161641-4o6pk6nw1gupjrt7
| -rw-r--r-- | addons/account/wizard/account_fiscalyear_close.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/addons/account/wizard/account_fiscalyear_close.py b/addons/account/wizard/account_fiscalyear_close.py index 849a7a9f514..15182565aa5 100644 --- a/addons/account/wizard/account_fiscalyear_close.py +++ b/addons/account/wizard/account_fiscalyear_close.py @@ -78,6 +78,7 @@ class account_fiscalyear_close(osv.osv_memory): new_journal = data[0].journal_id.id new_journal = obj_acc_journal.browse(cr, uid, new_journal, context=context) + company_id = new_journal.company_id.id if not new_journal.default_credit_account_id or not new_journal.default_debit_account_id: raise osv.except_osv(_('UserError'), @@ -117,7 +118,8 @@ class account_fiscalyear_close(osv.osv_memory): LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active AND a.type != 'view' - AND t.close_method = %s''', ('unreconciled', )) + AND a.company_id = %s + AND t.close_method = %s''', (company_id, 'unreconciled', )) account_ids = map(lambda x: x[0], cr.fetchall()) if account_ids: cr.execute(''' @@ -166,7 +168,8 @@ class account_fiscalyear_close(osv.osv_memory): LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active AND a.type != 'view' - AND t.close_method = %s''', ('detail', )) + AND a.company_id = %s + AND t.close_method = %s''', (company_id, 'detail', )) account_ids = map(lambda x: x[0], cr.fetchall()) if account_ids: @@ -194,7 +197,8 @@ class account_fiscalyear_close(osv.osv_memory): LEFT JOIN account_account_type t ON (a.user_type = t.id) WHERE a.active AND a.type != 'view' - AND t.close_method = %s''', ('balance', )) + AND a.company_id = %s + AND t.close_method = %s''', (company_id, 'balance', )) account_ids = map(lambda x: x[0], cr.fetchall()) query_1st_part = """ |
