diff --git a/addons/account/account_analytic_line.py b/addons/account/account_analytic_line.py index 2cd1b4d17bd..c1c6e3f854b 100644 --- a/addons/account/account_analytic_line.py +++ b/addons/account/account_analytic_line.py @@ -96,7 +96,7 @@ class account_analytic_line(osv.osv): # Take the company currency as the reference one context['currency_id']=company_obj.browse(cr, uid, company_id).currency_id.id amount_unit=prod.price_get(pricetype.field, context)[prod.id] - amount=amount_unit*unit_amount or 1.0 + amount = amount_unit*unit_amount or 1.0 return {'value': { 'amount': - round(amount, 2), 'general_account_id': a, diff --git a/addons/account/report/third_party_ledger.py b/addons/account/report/third_party_ledger.py index c3325b853fb..20a582f1bca 100644 --- a/addons/account/report/third_party_ledger.py +++ b/addons/account/report/third_party_ledger.py @@ -56,7 +56,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): 'get_intial_balance':self._get_intial_balance, 'display_initial_balance':self._display_initial_balance, 'display_currency':self._display_currency, - }) @@ -81,8 +80,10 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): return string_map def set_context(self, objects, data, ids, report_type=None): - self.query = data['form']['query_line'] - self.init_query = data['form']['initial_bal_query'] + self.query = data['form'].get('query_line', '') + self.init_query = data['form'].get('initial_bal_query', '') + self.reconcil = data['form'].get('reconcil', True) + self.initial_balance = data['form'].get('initial_balance', True) PARTNER_REQUEST = '' if (data['model'] == 'res.partner'): ## Si on imprime depuis les partenaires @@ -101,7 +102,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): "FROM account_account a " \ "LEFT JOIN account_account_type t " \ "ON (a.type=t.code) " \ -# "WHERE a.company_id = %s " \ 'WHERE a.type IN %s' \ "AND a.active", (tuple(self.ACCOUNT_TYPE), )) self.account_ids = [a for (a,) in self.cr.fetchall()] @@ -119,7 +119,6 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): (tuple(self.account_ids),)) res = self.cr.dictfetchall() - for res_line in res: partner_to_use.append(res_line['partner_id']) new_ids = partner_to_use @@ -129,7 +128,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): def lines(self, partner, data): full_account = [] - if data['form']['reconcil'] : + if self.reconcil: RECONCILE_TAG = " " else: RECONCILE_TAG = "AND l.reconcile_id IS NULL" @@ -166,7 +165,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): def _sum_debit_partner(self, partner, data): result_tmp = 0.0 - if data['form']['reconcil'] : + if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" @@ -188,7 +187,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): def _sum_credit_partner(self, partner, data): result_tmp = 0.0 - if data['form']['reconcil'] : + if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" @@ -213,11 +212,11 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): return 0.0 result_tmp = 0.0 result_init = 0.0 - if data['form']['reconcil'] : + if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" - if data['form']['initial_balance']: + if self.initial_balance: self.cr.execute( "SELECT sum(debit) " \ "FROM account_move_line AS l " \ @@ -252,11 +251,11 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): return 0.0 result_tmp = 0.0 result_init = 0.0 - if data['form']['reconcil'] : + if self.reconcil : RECONCILE_TAG = " " else: RECONCILE_TAG = "AND reconcile_id IS NULL" - if data['form']['initial_balance']: #self.date_lst and + if self.initial_balance: self.cr.execute( "SELECT sum(credit) " \ "FROM account_move_line AS l " \ @@ -308,7 +307,7 @@ class third_party_ledger(rml_parse.rml_parse, common_report_header): return currency_total def _display_initial_balance(self, data): - if data['form']['initial_balance'] : + if self.initial_balance : return True return False @@ -325,4 +324,4 @@ report_sxw.report_sxw('report.account.third_party_ledger_other', 'res.partner', 'addons/account/report/third_party_ledger_other.rml',parser=third_party_ledger, header='internal') -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file diff --git a/addons/account/wizard/account_report_common_view.xml b/addons/account/wizard/account_report_common_view.xml index 2a4fdc7589c..5c31ff6c2a9 100644 --- a/addons/account/wizard/account_report_common_view.xml +++ b/addons/account/wizard/account_report_common_view.xml @@ -8,7 +8,7 @@ form
- + diff --git a/addons/account/wizard/account_report_partner_ledger.py b/addons/account/wizard/account_report_partner_ledger.py index 5454f54587e..b1a7560ff71 100644 --- a/addons/account/wizard/account_report_partner_ledger.py +++ b/addons/account/wizard/account_report_partner_ledger.py @@ -37,7 +37,7 @@ class account_partner_ledger(osv.osv_memory): 'amount_currency': fields.boolean("With Currency", help="It adds the currency column if the currency is different then the company currency"), } _defaults = { - 'reconcile': True, + 'reconcil': True, 'initial_balance': True, 'page_split': False, } @@ -52,13 +52,11 @@ class account_partner_ledger(osv.osv_memory): 'type': 'ir.actions.report.xml', 'report_name': 'account.third_party_ledger', 'datas': data, - 'nodestroy':True, } return { 'type': 'ir.actions.report.xml', 'report_name': 'account.third_party_ledger_other', 'datas': data, - 'nodestroy':True, } account_partner_ledger() diff --git a/addons/account/wizard/account_report_partner_ledger_view.xml b/addons/account/wizard/account_report_partner_ledger_view.xml index 3d712b04973..7203c05918f 100644 --- a/addons/account/wizard/account_report_partner_ledger_view.xml +++ b/addons/account/wizard/account_report_partner_ledger_view.xml @@ -12,8 +12,8 @@ - +