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 @@ - + - +