From 099dc9e41b2f9098eebb00ea895232e4c943d83c Mon Sep 17 00:00:00 2001 From: Mqdd Date: Tue, 24 Feb 2026 15:28:52 +0700 Subject: lock date --- fixco_custom/models/res_company.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 fixco_custom/models/res_company.py (limited to 'fixco_custom/models/res_company.py') diff --git a/fixco_custom/models/res_company.py b/fixco_custom/models/res_company.py new file mode 100644 index 0000000..ed36141 --- /dev/null +++ b/fixco_custom/models/res_company.py @@ -0,0 +1,17 @@ +from odoo import models, fields +from datetime import date + +class ResCompany(models.Model): + _inherit = 'res.company' + + excluded_user_ids = fields.Many2many( + 'res.users', + string="Excluded Users" + ) + def _get_user_fiscal_lock_date(self): + self.ensure_one() + + if self.env.user in self.excluded_user_ids: + return date.min + + return super()._get_user_fiscal_lock_date() \ No newline at end of file -- cgit v1.2.3