Skip to content

Commit

Permalink
[FIX] account_accountant_ux: update _get_followup_report_lines
Browse files Browse the repository at this point in the history
  • Loading branch information
cav-adhoc committed Aug 23, 2024
1 parent 1575778 commit 1de9fc2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions account_accountant_ux/models/account_followup_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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;'
Expand All @@ -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 ''
Expand All @@ -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,
Expand All @@ -95,20 +95,20 @@ 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

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({
Expand All @@ -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({
Expand All @@ -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:
Expand Down

0 comments on commit 1de9fc2

Please sign in to comment.