|
|
@ -21,12 +21,6 @@ class GeneralLedgerReportWizard(models.TransientModel): |
|
|
|
_description = "General Ledger Report Wizard" |
|
|
|
_inherit = "account_financial_report_abstract_wizard" |
|
|
|
|
|
|
|
company_id = fields.Many2one( |
|
|
|
comodel_name="res.company", |
|
|
|
default=lambda self: self.env.user.company_id, |
|
|
|
required=False, |
|
|
|
string="Company", |
|
|
|
) |
|
|
|
date_range_id = fields.Many2one(comodel_name="date.range", string="Date range") |
|
|
|
date_from = fields.Date(required=True, default=lambda self: self._init_date_from()) |
|
|
|
date_to = fields.Date(required=True, default=fields.Date.context_today) |
|
|
@ -119,8 +113,9 @@ class GeneralLedgerReportWizard(models.TransientModel): |
|
|
|
def _init_date_from(self): |
|
|
|
"""set start date to begin of current year if fiscal year running""" |
|
|
|
today = fields.Date.context_today(self) |
|
|
|
last_fsc_month = self.env.user.company_id.fiscalyear_last_month |
|
|
|
last_fsc_day = self.env.user.company_id.fiscalyear_last_day |
|
|
|
company = self.company_id or self.env.company |
|
|
|
last_fsc_month = company.fiscalyear_last_month |
|
|
|
last_fsc_day = company.fiscalyear_last_day |
|
|
|
|
|
|
|
if ( |
|
|
|
today.month < int(last_fsc_month) |
|
|
|