From fd5f3dd5ece6e32989c18c548e00057c78786919 Mon Sep 17 00:00:00 2001 From: Humberto Arocha Date: Fri, 10 Aug 2012 11:11:18 -0530 Subject: [PATCH] [IMP] Se agrega on_change para cambiar el analityc_ledger, cuando no sea BS o four columns. --- .../model/account_financial_report.py | 13 +++++++++++++ .../view/account_financial_report_view.xml | 6 +++++- account_financial_report/view/wizard.xml | 6 +++++- account_financial_report/wizard/wizard.py | 12 ++++++++++++ 4 files changed, 35 insertions(+), 2 deletions(-) diff --git a/account_financial_report/model/account_financial_report.py b/account_financial_report/model/account_financial_report.py index f36899e8..a5d34121 100644 --- a/account_financial_report/model/account_financial_report.py +++ b/account_financial_report/model/account_financial_report.py @@ -81,11 +81,24 @@ class account_financial_report(osv.osv): defaults['name'] = new_name return super(account_financial_report,self).copy(cr, uid, id, defaults, context=context) + def onchange_inf_type(self,cr,uid,ids,inf_type,context=None): + if context is None: + context = {} + res = {'value':{}} + + if inf_type != 'BS': + res['value'].update({'analytic_ledger':False}) + + return res def onchange_columns(self,cr,uid,ids,columns,fiscalyear_id,period_ids,context=None): if context is None: context = {} res = {'value':{}} + + if columns != 'four': + res['value'].update({'analytic_ledger':False}) + if columns in ('qtr', 'thirteen'): p_obj = self.pool.get("account.period") period_ids = p_obj.search(cr,uid,[('fiscalyear_id','=',fiscalyear_id),('special','=',False)],context=context) diff --git a/account_financial_report/view/account_financial_report_view.xml b/account_financial_report/view/account_financial_report_view.xml index 34a86965..d8776360 100644 --- a/account_financial_report/view/account_financial_report_view.xml +++ b/account_financial_report/view/account_financial_report_view.xml @@ -22,7 +22,11 @@ - + - +