forked from tvtma/OpenUpgrade
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MISC] account/chart_template: patch ref method to avoid raise if record
is not found
- Loading branch information
1 parent
fd47f57
commit 13909d8
Showing
4 changed files
with
17 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import base | ||
from . import account |
1 change: 1 addition & 0 deletions
1
openupgrade_framework/odoo_patch/odoo/addons/account/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models |
1 change: 1 addition & 0 deletions
1
openupgrade_framework/odoo_patch/odoo/addons/account/models/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import chart_template |
14 changes: 14 additions & 0 deletions
14
openupgrade_framework/odoo_patch/odoo/addons/account/models/chart_template.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |