Odoo Mindscape. Understand Odoo faster. Explore modules, fields, dependencies and version differences in one place instead of digging through the source code.

Module: Account Cut-off Base

Entity: account.cutoff

Compute Method: _compute_cutoff_date

Inputs Method Outputs
today = fields.Date.context_today(self)
for rec in self:
            cutoff_date = False
            company = rec.company_id
            date_from, date_to = date_utils.get_fiscal_year(
                today,
                day=company.fiscalyear_last_day,
                month=int(company.fiscalyear_last_month),
            )
            if date_from:
                cutoff_date = date_from - relativedelta(days=1)
            rec.cutoff_date = cutoff_date

Back to entity