-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[14.0][IMP] custom_mrp_line_cost: Add no create attribute to lot.
- Loading branch information
1 parent
e62a463
commit 9e32da3
Showing
7 changed files
with
81 additions
and
7 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
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
31 changes: 31 additions & 0 deletions
31
custom_mrp_line_cost/migrations/14.0.1.1.0/pre-migration.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,31 @@ | ||
# Copyright 2024 Berezi Amubieta - AvanzOSC | ||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
import logging | ||
|
||
from openupgradelib import openupgrade | ||
|
||
_logger = logging.getLogger(__name__) | ||
|
||
|
||
@openupgrade.migrate() | ||
def migrate(env, version): | ||
cr = env.cr | ||
if not openupgrade.column_exists(cr, "stock_move_line", "operation_id"): | ||
cr.execute( | ||
""" | ||
ALTER TABLE stock_move_line | ||
ADD COLUMN operation_id integer; | ||
""" | ||
) | ||
cr.execute( | ||
""" | ||
UPDATE stock_move_line | ||
SET operation_id = (SELECT mrp_bom_byproduct.operation_id | ||
FROM mrp_bom_byproduct, | ||
stock_move | ||
WHERE stock_move.id = stock_move_line.move_id | ||
AND move_id IS NOT NULL | ||
AND mrp_bom_byproduct.id = stock_move.byproduct_id | ||
AND byproduct_id IS NOT NULL) | ||
""" | ||
) |
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