Files
odoo_source/addons/l10n_it/models/account_report.py
T
oco-odoo b7232b14b7 [IMP] account, l10n_*: Introduce unified reporting engine
This commit adapts account's model to the new report engine introduced for v16, and updates the data files accordingly.

account.report model is now declared in community, together with the other models used by the reporting. This is done so that the tax tags can properly be created by the tax report and used on tax templates. All the actual computation logic stays in enterprise.

See enterprise commit for full details.

Task 2524389

Part-of: odoo/odoo#94125
2022-08-25 19:56:55 +02:00

16 lines
684 B
Python

# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class AccountReportExpression(models.AbstractModel):
_inherit = "account.report.expression"
def _get_carryover_target_expression(self, options):
if self.report_line_id.code == 'VP14b' and fields.Date.from_string(options['date']['date_to']).month == 12:
# For this line, if we are between two years, we want to carry over to vp9 instead of the line set in the XML file (vp8)
return self.env.ref('l10n_it.tax_report_line_vp9_applied_carryover')
return super()._get_carryover_target_expression(options)