Tower: unpublish om_fiscal_year — remove source from 19.0 branch

This commit is contained in:
2026-05-02 11:16:03 +00:00
parent 4a71eef134
commit 7428a903a8
24 changed files with 0 additions and 2172 deletions

View File

@@ -1,3 +0,0 @@
from . import account_fiscal_year
from . import account_settings
from . import res_company

View File

@@ -1,48 +0,0 @@
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
class AccountFiscalYear(models.Model):
_name = 'account.fiscal.year'
_description = 'Fiscal Year'
name = fields.Char(string='Name', required=True)
date_from = fields.Date(string='Start Date', required=True,
help='Start Date, included in the fiscal year.')
date_to = fields.Date(string='End Date', required=True,
help='Ending Date, included in the fiscal year.')
company_id = fields.Many2one('res.company', string='Company', required=True,
default=lambda self: self.env.company)
@api.constrains('date_from', 'date_to', 'company_id')
def _check_dates(self):
'''
Check interleaving between fiscal years.
There are 3 cases to consider:
s1 s2 e1 e2
( [----)----]
s2 s1 e2 e1
[----(----] )
s1 s2 e2 e1
( [----] )
'''
for fy in self:
# Starting date must be prior to the ending date
date_from = fy.date_from
date_to = fy.date_to
if date_to < date_from:
raise ValidationError(_('The ending date must not be prior to the starting date.'))
domain = [
('id', '!=', fy.id),
('company_id', '=', fy.company_id.id),
'|', '|',
'&', ('date_from', '<=', fy.date_from), ('date_to', '>=', fy.date_from),
'&', ('date_from', '<=', fy.date_to), ('date_to', '>=', fy.date_to),
'&', ('date_from', '<=', fy.date_from), ('date_to', '>=', fy.date_to),
]
if self.search_count(domain) > 0:
raise ValidationError(_('You can not have an overlap between two fiscal years, '
'please correct the start and/or end dates of your fiscal years.'))

View File

@@ -1,30 +0,0 @@
from odoo import api, fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
fiscalyear_last_day = fields.Integer(
related='company_id.fiscalyear_last_day', readonly=False
)
fiscalyear_last_month = fields.Selection(
related='company_id.fiscalyear_last_month', readonly=False
)
tax_lock_date = fields.Date(
related='company_id.hard_lock_date', readonly=False
)
sale_lock_date = fields.Date(
related='company_id.hard_lock_date', readonly=False
)
purchase_lock_date = fields.Date(
related='company_id.hard_lock_date', readonly=False
)
hard_lock_date = fields.Date(
related='company_id.hard_lock_date', readonly=False
)
fiscalyear_lock_date = fields.Date(
related='company_id.fiscalyear_lock_date', readonly=False
)
group_fiscal_year = fields.Boolean(
string='Fiscal Years', implied_group='om_fiscal_year.group_fiscal_year'
)

View File

@@ -1,38 +0,0 @@
from odoo import api, fields, models, _
from odoo.exceptions import RedirectWarning, ValidationError
class ResCompany(models.Model):
_inherit = 'res.company'
def _validate_fiscalyear_lock(self, values):
if values.get('fiscalyear_lock_date'):
draft_entries = self.env['account.move'].search([
('company_id', 'in', self.ids),
('state', '=', 'draft'),
('date', '<=', values['fiscalyear_lock_date'])])
if draft_entries:
error_msg = _(
'There are still unposted entries in the period you want to lock. You should either post or delete them.')
action_error = {
'view_mode': 'list',
'name': 'Unposted Entries',
'res_model': 'account.move',
'type': 'ir.actions.act_window',
'domain': [('id', 'in', draft_entries.ids)],
'search_view_id': [self.env.ref('account.view_account_move_filter').id, 'search'],
'views': [[self.env.ref('account.view_move_tree').id, 'list'],
[self.env.ref('account.view_move_form').id, 'form']],
}
raise RedirectWarning(error_msg, action_error, _('Show unposted entries'))
unreconciled_statement_lines = self.env['account.bank.statement.line'].search([
('company_id', 'in', self.ids),
('is_reconciled', '=', False),
('date', '<=', values['fiscalyear_lock_date']),
('move_id.state', 'in', ('draft', 'posted')),
])
if unreconciled_statement_lines:
error_msg = _("There are still unreconciled bank statement lines in the period you want to lock."
"You should either reconcile or delete them.")
raise ValidationError(error_msg)