[FIX] account: prevent trackback when installing stock_account after uninstall any l10n
Before commit 1. install the localisation module 2. uninstall that module 3. try to install stock - traceback is generated - https://pastebin.com/eGGYZ1k1 After commit applying this commit will fix this issue sentry - 4184561125 closes odoo/odoo#122556 X-original-commit: 95a67a24870f7ca0e9d9f865ce0279aca9fa2699 Signed-off-by: William André (wan) <wan@odoo.com>
This commit is contained in:
@@ -84,3 +84,10 @@ class IrModule(models.Model):
|
||||
self.env.company,
|
||||
)
|
||||
del self.env.registry._auto_install_template
|
||||
|
||||
def module_uninstall(self):
|
||||
unlinked_templates = [code for template in self.mapped('account_templates') for code in template]
|
||||
self.env['res.company'].search([
|
||||
('chart_template', 'in', unlinked_templates),
|
||||
]).chart_template = False
|
||||
return super().module_uninstall()
|
||||
|
||||
Reference in New Issue
Block a user