[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:
João Marques
2021-01-25 15:43:26 +00:00
committed by chaule97
parent e250c0583d
commit 12034178bb
30 changed files with 762 additions and 649 deletions

View File

@@ -6,6 +6,7 @@
from odoo import _, api, fields, models
from odoo.exceptions import UserError, ValidationError
from odoo.tools import date_utils
class TrialBalanceReportWizard(models.TransientModel):
@@ -118,8 +119,12 @@ class TrialBalanceReportWizard(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