From b933edc21b3648e553d8584a056f64207193de22 Mon Sep 17 00:00:00 2001 From: collo <93349868+collinskipkorir@users.noreply.github.com> Date: Tue, 15 Oct 2024 07:46:27 +0300 Subject: [PATCH] Delete account_period.py --- account_period.py | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 account_period.py diff --git a/account_period.py b/account_period.py deleted file mode 100644 index a4ef34b8d..000000000 --- a/account_period.py +++ /dev/null @@ -1,33 +0,0 @@ -from odoo import models, fields, api - -class AccountFiscalPeriod(models.Model): - _inherit = 'account.fiscal.year' - - - period_type = fields.Selection( - [('monthly', 'Monthly'), ('quarterly', 'Quarterly'), ('yearly', 'Yearly')], - string="Period Type", - default='monthly', - required=True - ) - - quarter_start_date = fields.Date(string="Quarter Start Date") - quarter_end_date = fields.Date(string="Quarter End Date") - - @api.onchange('period_type') - def _onchange_period_type(self): - if self.period_type == 'quarterly': - today = fields.Date.today() - current_month = today.month - if current_month in [1, 2, 3]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-01-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-03-31") - elif current_month in [4, 5, 6]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-04-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-06-30") - elif current_month in [7, 8, 9]: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-07-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-09-30") - else: - self.quarter_start_date = fields.Date.from_string(f"{today.year}-10-01") - self.quarter_end_date = fields.Date.from_string(f"{today.year}-12-31")