Skip to content

Commit

Permalink
[FIX] stock_picking_mgmt_weight: key fields without copy=False
Browse files Browse the repository at this point in the history
With this fix incorrect links between classifications and original
purchase orders are prevented when duplicating existing and completed
purchase orders.

Co-Authored-By: Christian Santamaría <[email protected]>
  • Loading branch information
dalonsod and ChristianSantamaria committed Jul 11, 2024
1 parent 4a307fb commit 8b8dea9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stock_picking_mgmt_weight/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
""",
"author": "Solvos",
"license": "LGPL-3",
"version": "13.0.1.25.0",
"version": "13.0.1.25.1",
"category": "stock",
"website": "https://github.com/solvosci/slv-stock",
"depends": [
Expand Down
3 changes: 3 additions & 0 deletions stock_picking_mgmt_weight/models/purchase_order.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ class PurchaseOrder(models.Model):
related_order_id = fields.Many2one(
comodel_name="purchase.order",
readonly=True,
copy=False,
)
related_order_ids = fields.Many2many(
string="Related orders",
Expand All @@ -26,6 +27,7 @@ class PurchaseOrder(models.Model):
column2="related_order_id",
compute="_compute_related_order_ids",
store=True,
copy=False,
)
related_order_count = fields.Integer(
compute="_compute_related_order_ids",
Expand All @@ -39,6 +41,7 @@ class PurchaseOrder(models.Model):
relation="purchase_order_related",
column1="related_order_id",
column2="order_id",
copy=False,
)
classification = fields.Boolean(
compute="_compute_classification",
Expand Down
1 change: 1 addition & 0 deletions stock_picking_mgmt_weight/models/purchase_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class PurchaseOrderLine(models.Model):

related_real_order_line_id = fields.Many2one(
"purchase.order.line",
copy=False,
help="For extra lines created in classification process, this field"
" indicates the original linked line",
)
Expand Down

0 comments on commit 8b8dea9

Please sign in to comment.