19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:31:28 +01:00
parent ff721d030e
commit 7721452493
1826 changed files with 124775 additions and 274114 deletions

View file

@ -0,0 +1,19 @@
from odoo import models, _
from odoo.exceptions import UserError
class AccountAccount(models.Model):
_inherit = 'account.account'
def write(self, vals):
if (
'code' in vals
and self.env.company.account_fiscal_country_id.code == 'DE'
and any(
self.env.company in a.company_ids and a.code != vals['code']
for a in self
)
):
if self.env['account.move.line'].search_count([('account_id', 'in', self.ids)], limit=1):
raise UserError(_("You can not change the code of an account."))
return super().write(vals)