diff --git a/addons/account/account.py b/addons/account/account.py index e5e29f178a3..35cc34fda82 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -2338,6 +2338,16 @@ class account_model(osv.osv): return move_ids + def onchange_journal_id(self, cr, uid, ids, journal_id=None, context=None): + company_id = False + + if journal_id: + company = self.pool.get('account.journal').browse(cr, uid, journal_id, context=context).company_id + if company: + company_id = company.id + + return {'value': {'company_id': company_id}} + account_model() class account_model_line(osv.osv): @@ -3013,9 +3023,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): 'purchase_tax_rate': fields.float('Purchase Tax(%)'), 'complete_tax_set': fields.boolean('Complete Set of Taxes', help='This boolean helps you to choose if you want to propose to the user to encode the sales and purchase rates or use the usual m2o fields. This last choice assumes that the set of tax defined for the chosen template is complete'), } - + def onchange_company_id(self, cr, uid, ids, company_id, context=None): - currency_id = False + currency_id = False if company_id: currency_id = self.pool.get('res.company').browse(cr, uid, company_id, context=context).currency_id.id return {'value': {'currency_id': currency_id}} diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index 75359b4f207..d1b19910365 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1651,8 +1651,8 @@
- - + +