[MIG] account_financial_report: Migration to 14.0
Since v14, Odoo defines the `__slots__` attribute in the `BaseModel` class (ea3e39506a)
This makes it impossible to add attributes to an instance like it was done here in v13.
The use of the `report_data` dictionary passed between method is the closes and simples solution to this "issue".
TT26415
Co-authored-by: Alex Cuellar <acuellar@grupoyacck.com>
This commit is contained in:
@@ -12,6 +12,7 @@ from ast import literal_eval
|
||||
|
||||
from odoo import _, api, fields, models
|
||||
from odoo.exceptions import ValidationError
|
||||
from odoo.tools import date_utils
|
||||
|
||||
|
||||
class GeneralLedgerReportWizard(models.TransientModel):
|
||||
@@ -146,8 +147,12 @@ class GeneralLedgerReportWizard(models.TransientModel):
|
||||
def _compute_fy_start_date(self):
|
||||
for wiz in self:
|
||||
if wiz.date_from:
|
||||
res = self.company_id.compute_fiscalyear_dates(wiz.date_from)
|
||||
wiz.fy_start_date = res["date_from"]
|
||||
date_from, date_to = date_utils.get_fiscal_year(
|
||||
wiz.date_from,
|
||||
day=self.company_id.fiscalyear_last_day,
|
||||
month=int(self.company_id.fiscalyear_last_month),
|
||||
)
|
||||
wiz.fy_start_date = date_from
|
||||
else:
|
||||
wiz.fy_start_date = False
|
||||
|
||||
|
||||
Reference in New Issue
Block a user