From 1de9fc208950f156f72e0d04659d3f6dde726d84 Mon Sep 17 00:00:00 2001 From: Camila Vives Date: Tue, 20 Aug 2024 17:40:42 -0300 Subject: [PATCH] [FIX] account_accountant_ux: update _get_followup_report_lines --- .../models/account_followup_report.py | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/account_accountant_ux/models/account_followup_report.py b/account_accountant_ux/models/account_followup_report.py index 284ea018..dddccc4c 100644 --- a/account_accountant_ux/models/account_followup_report.py +++ b/account_accountant_ux/models/account_followup_report.py @@ -24,7 +24,7 @@ def _get_followup_report_lines(self, options): today = fields.Date.today() line_num = 0 for l in partner.unreconciled_aml_ids.sorted().filtered(lambda aml: not aml.currency_id.is_zero(aml.amount_residual_currency)): - if l.company_id == self.env.company and not l.blocked: + if l.company_id in self.env.company._accessible_branches() and not l.blocked: # INICIO CAMBIO # currency = l.currency_id or l.company_id.currency_id currency = l.company_id.currency_id if l.company_id.use_company_currency_on_followup else l.currency_id @@ -45,7 +45,7 @@ def _get_followup_report_lines(self, options): 'name': format_date(self.env, aml.move_id.invoice_date or aml.date, lang_code=lang_code), 'class': 'date', 'style': 'white-space:nowrap;text-align:left;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } date_due = format_date(self.env, aml.date_maturity or aml.move_id.invoice_date or aml.date, lang_code=lang_code) total += not aml.blocked and amount or 0 @@ -56,7 +56,7 @@ def _get_followup_report_lines(self, options): date_due = { 'name': date_due, 'class': 'date', 'style': 'white-space:nowrap;text-align:left;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } if is_overdue: date_due['style'] += 'color: red;' @@ -65,12 +65,12 @@ def _get_followup_report_lines(self, options): move_line_name = { 'name': self._followup_report_format_aml_name(aml.name, aml.move_id.ref), 'style': 'text-align:left; white-space:normal;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } amount = { 'name': formatLang(self.env, amount, currency_obj=currency), 'style': 'text-align:right; white-space:normal;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } line_num += 1 invoice_origin = aml.move_id.invoice_origin or '' @@ -79,7 +79,7 @@ def _get_followup_report_lines(self, options): invoice_origin = { 'name': invoice_origin, 'style': 'text-align:center; white-space:normal;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } columns = [ invoice_date, @@ -95,7 +95,7 @@ def _get_followup_report_lines(self, options): 'move_id': aml.move_id.id, 'type': is_payment and 'payment' or 'unreconciled_aml', 'unfoldable': False, - 'columns': [isinstance(v, dict) and v or {'name': v, 'template': 'account_followup.cell_template_followup_report'} for v in columns], + 'columns': [isinstance(v, dict) and v or {'name': v, 'template': 'account_followup.line_template'} for v in columns], }) total_due = formatLang(self.env, total, currency_obj=currency) line_num += 1 @@ -103,12 +103,12 @@ def _get_followup_report_lines(self, options): cols = \ [{ 'name': v, - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } for v in [''] * 3] + \ [{ 'name': v, 'style': 'text-align:right; white-space:normal; font-weight: bold;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } for v in [total >= 0 and _('Total Due') or '', total_due]] lines.append({ @@ -127,12 +127,12 @@ def _get_followup_report_lines(self, options): cols = \ [{ 'name': v, - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } for v in [''] * 3] + \ [{ 'name': v, 'style': 'text-align:right; white-space:normal; font-weight: bold;', - 'template': 'account_followup.cell_template_followup_report', + 'template': 'account_followup.line_template', } for v in [_('Total Overdue'), total_issued]] lines.append({ @@ -152,7 +152,7 @@ def _get_followup_report_lines(self, options): 'style': 'border-bottom-style: none', 'unfoldable': False, 'level': 0, - 'columns': [{'template': 'account_followup.cell_template_followup_report'} for col in columns], + 'columns': [{'template': 'account_followup.line_template'} for col in columns], }) # Remove the last empty line if lines: