Skip to content

Commit

Permalink
[MISC] account/chart_template: patch ref method to avoid raise if record
Browse files Browse the repository at this point in the history
is not found
  • Loading branch information
royle-vietnam committed Jun 8, 2024
1 parent fd47f57 commit 13909d8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions openupgrade_framework/odoo_patch/odoo/addons/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
from . import base
from . import account
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import chart_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2024 Viindoo Technology Joint Stock Company (Viindoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo.addons.account.models.chart_template import AccountChartTemplate


def ref(self, xmlid, raise_if_not_found=True):
"""Don't raise if record is not found which are common during migration."""
return AccountChartTemplate.ref._original_method(
self, xmlid, raise_if_not_found=False
)


ref._original_method = AccountChartTemplate.ref
AccountChartTemplate.ref = ref

0 comments on commit 13909d8

Please sign in to comment.