diff --git a/account_financial_report/model/account_financial_report.py b/account_financial_report/model/account_financial_report.py index 4f423370..62b2c48e 100644 --- a/account_financial_report/model/account_financial_report.py +++ b/account_financial_report/model/account_financial_report.py @@ -79,4 +79,31 @@ 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_columns(self,cr,uid,ids,columns,fiscalyear_id,period_ids,context=None): + if context is None: + context = {} + res = {'value':{}} + 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) + res['value'].update({'period_ids':period_ids}) + else: + res['value'].update({'period_ids':[]}) + return res + + def onchange_company_id(self,cr,uid,ids,company_id,context=None): + if context is None: + context = {} + context['company_id']=company_id + res = {'value':{}} + cur_id = self.pool.get('res.company').browse(cr,uid,company_id,context=context).currency_id.id + fy_id = self.pool.get('account.fiscalyear').find(cr, uid,context=context) + res['value'].update({'fiscalyear_id':fy_id}) + res['value'].update({'currency_id':cur_id}) + res['value'].update({'account_ids':[]}) + res['value'].update({'period_ids':[]}) + return res + + account_financial_report() diff --git a/account_financial_report/view/account_financial_report_view.xml b/account_financial_report/view/account_financial_report_view.xml index a6db5170..bc7c397b 100644 --- a/account_financial_report/view/account_financial_report_view.xml +++ b/account_financial_report/view/account_financial_report_view.xml @@ -7,20 +7,20 @@ afr form -
+ - + - + @@ -31,7 +31,7 @@ - + @@ -43,12 +43,17 @@ + - + diff --git a/account_financial_report/wizard/wizard.py b/account_financial_report/wizard/wizard.py index 6c68b42f..81800a92 100644 --- a/account_financial_report/wizard/wizard.py +++ b/account_financial_report/wizard/wizard.py @@ -109,6 +109,8 @@ class wizard_report(osv.osv_memory): res['value'].update({'fiscalyear':afr_brw.fiscalyear_id and afr_brw.fiscalyear_id.id}) res['value'].update({'account_list':[acc.id for acc in afr_brw.account_ids]}) res['value'].update({'periods':[p.id for p in afr_brw.period_ids]}) + res['value'].update({'tot_check':afr_brw.tot_check or False}) + res['value'].update({'lab_str':afr_brw.lab_str or _('Write a Description for your Summary Total')}) return res def _get_defaults(self, cr, uid, data, context=None):