-
-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adapt to new repair line type "recycle". * Propoerly integrate with the other modules in the repo (like `repair_stock` and `repair_type`). * Simplify logic and make it a bit more robust. * Add more test lines to make tests more useful.
- Loading branch information
1 parent
c17ad80
commit de7b0f5
Showing
13 changed files
with
151 additions
and
130 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
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,25 @@ | ||
# Copyright (C) 2025 ForgeFlow S.L. | ||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) | ||
|
||
from openupgradelib import openupgrade # pylint: disable=W7936 | ||
|
||
_field_renames = [ | ||
("stock.warehouse", "stock_warehouse", "remove_c_type_id", "recycle_c_type_id"), | ||
] | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
cr = env.cr | ||
# Rename operation types | ||
for wh in env["stock.warehouse"].search([]): | ||
if hasattr(wh, "remove_c_type_id") and wh.remove_c_type_id: | ||
wh.recycle_c_type_id.name = wh.recycle_c_type_id.name.replace( | ||
"Remove", "Recycle" | ||
) | ||
# Rename fields | ||
for field in _field_renames: | ||
if openupgrade.table_exists(cr, field[1]) and openupgrade.column_exists( | ||
cr, field[1], field[2] | ||
): | ||
openupgrade.rename_fields(env, _field_renames) |
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,5 +1,4 @@ | ||
from . import stock_warehouse | ||
from . import repair | ||
from . import stock_rule | ||
from . import procurement_group | ||
from . import stock_move |
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
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
Oops, something went wrong.