← Back to Pull requests

[19.0] [MIG] sale_product_pack : migrate to 19.0 #225

Closed
apik-mgu closed this pull request without merging on Mar 12, 2026 20:26 UTC
View on GitHub
apik-mgu apik-mgu commented on Oct 20, 2025 07:38 UTC
Author

No description provided by author.

Diff: 2645 lines (+2645 / -0) across 29 files Reviewer: lef-adhoc Review duration: 206687m
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.96) × (1 − Review Confidence (0.84)). Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.96 · 2645 lines diff across 29 files
0.96
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.73 · 5 substantive comment(s)
0.73
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 50%
83%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size diff_size
0.400
Sensitive Paths sensitive_paths
0.096
Mass File Touch mass_file_touch
0.080
Empty Description empty_description
0.060
Real PR Conversation Timeline
37 items
lef-adhoc lef-adhoc commented on Oct 21, 2025 14:03 UTC
Contributor
apik-mgu apik-mgu commented on Oct 27, 2025 11:08 UTC
Author

@lef-adhoc I fixed the problem.
However, the Odoo and OCB tests no longer run, even though I don't have the same problem on my local development database.

Can you help me?

lef-adhoc lef-adhoc commented on Oct 27, 2025 14:01 UTC
Contributor

@apik-mgu
You must create the data in the test itself and not use the demo data
Documentation: https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-19.0

apik-mgu apik-mgu commented on Oct 27, 2025 14:15 UTC
Author

@lef-adhoc Is this new in v19?
This was allowed in previous versions, particularly v18.

lef-adhoc lef-adhoc commented on Oct 27, 2025 14:23 UTC
Contributor

@apik-mgu Yes, it's new in v19

nicolascol nicolascol commented on Nov 06, 2025 10:13 UTC
Contributor

LGTM functional review.
I think the mention in contributors is incorrect, it's only a migration.

@apik-mgu @pedrobaeza

pedrobaeza pedrobaeza commented on Nov 06, 2025 19:45 UTC
Contributor

/ocabot migration sale_product_pack

Some reviews are needed, and one must come from PSC / maintainer

apik-mgu apik-mgu commented on Nov 07, 2025 08:17 UTC
Author

Hello Pedro,

Could you clarify your request?
I don't quite understand what I'm supposed to do.

Thank you in advance for your reply.

Cordialement,
​

Michel GUIHENEUF
Consultant Odoo
02 57 62 02 56
@.
https://apik.cloud
Nautiparc 16 rue de l'île de la jument, 56870, Baden
________________________________
De : Pedro M. Baeza
@.>
Envoyé : jeudi 6 novembre 2025 20:45
À : OCA/product-pack @.>
Cc : Michel GUIHENEUF
@.>; Mention @.>
Objet : Re: [OCA/product-pack] [19.0] [MIG] sale_product_pack : migrate to 19.0 (PR #225)

[https://avatars.githubusercontent.com/u/7165771?s=20&v=4]pedrobaeza left a comment (OCA/product-pack#225)<https://github.com/OCA/product-pack/pull/225#issuecomment-3499118895>

/ocabot migration sale_product_pack

Some reviews are needed, and one must come from PSC / maintainer

—
Reply to this email directly, view it on GitHub<https://github.com/OCA/product-pack/pull/225#issuecomment-3499118895>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARBM22TJMZBM4JLZMA5XLNT33OQN7AVCNFSM6AAAAACJU4XKZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTIOJZGEYTQOBZGU>.
You are receiving this because you were mentioned.Message ID:
@.>

OCA-git-bot OCA-git-bot commented on Nov 07, 2025 08:17 UTC
Bot

Sorry @apik-mgu you are not allowed to mark the addon to be migrated.

To do so you must either have push permissions on the repository, or be a declared maintainer of all modified addons.

If you wish to adopt an addon and become it's maintainer, open a pull request to add your GitHub login to the maintainers key of its manifest.

lef-adhoc lef-adhoc approved these changes on Nov 07, 2025 14:44 UTC
Approved Reviewer

LGTM

lef-adhoc lef-adhoc commented on Nov 13, 2025 19:10 UTC
Contributor

@pedrobaeza Could you merge please?

pedrobaeza pedrobaeza commented on code on Nov 13, 2025 19:15 UTC
Code Review
sale_product_pack/pyproject.toml:1
@@ -1,3 +1,10 @@
 [build-system]
 requires = ["whool"]
 build-backend = "whool.buildapi"
+
+[project]

This entry sounds weird

pedrobaeza pedrobaeza commented on code on Nov 13, 2025 19:15 UTC
Code Review
sale_product_pack/readme/CONTRIBUTORS.md:1
@@ -11,3 +11,5 @@
   - Bruno Zanotti
   - Augusto Weiss
   - Nicolas Col
+  - [Apik](https://apik.cloud/):

Incorrect indentation

pedrobaeza pedrobaeza commented on code on Nov 13, 2025 19:16 UTC
Code Review
sale_product_pack/models/product_pack_line.py:1
@@ -25,7 +25,7 @@ def get_sale_order_line_vals(self, line, order):
             "product_uom_qty": quantity,
         }
         sol = line.new(line_vals)
-        sol._onchange_product_id_warning()
+        sol._onchange_product_id()

Is this trick of new + onchange + convert vals still needed on this version?

pedrobaeza pedrobaeza commented on code on Nov 13, 2025 19:16 UTC
Code Review
sale_product_pack/tests/common.py:1
@@ -40,10 +40,21 @@ def setUpClass(cls):
                 ],
             }
         )
+        partner = cls.env["res.partner"].create(
+            {
+                "name": "Apik test",

Please don't put so specific details here in the test. A simple partner with a name is enough, and don't use real names.

pedrobaeza pedrobaeza requested changes on Nov 13, 2025 19:16 UTC
Changes Requested Reviewer

Requested changes.

apik-mgu apik-mgu commented on code on Nov 24, 2025 12:36 UTC
Code Review
sale_product_pack/models/product_pack_line.py:1
@@ -25,7 +25,7 @@ def get_sale_order_line_vals(self, line, order):
             "product_uom_qty": quantity,
         }
         sol = line.new(line_vals)
-        sol._onchange_product_id_warning()
+        sol._onchange_product_id()

Yes, useful during our tests

apik-mgu apik-mgu commented on Nov 24, 2025 12:38 UTC
Author

@pedrobaeza
Correction made.
Have a good day.

pedrobaeza pedrobaeza commented on code on Nov 24, 2025 16:12 UTC
Code Review
sale_product_pack/pyproject.toml:1
@@ -1,3 +1,10 @@
 [build-system]
 requires = ["whool"]
 build-backend = "whool.buildapi"
+
+[project]

What about this?

pedrobaeza pedrobaeza commented on code on Nov 24, 2025 16:13 UTC
Code Review
sale_product_pack/models/product_pack_line.py:1
@@ -25,7 +25,7 @@ def get_sale_order_line_vals(self, line, order):
             "product_uom_qty": quantity,
         }
         sol = line.new(line_vals)
-        sol._onchange_product_id_warning()
+        sol._onchange_product_id()

Well, I'm talking about removing the trick in this version.

apik-mgu apik-mgu commented on code on Dec 08, 2025 12:43 UTC
Code Review
sale_product_pack/pyproject.toml:1
@@ -1,3 +1,10 @@
 [build-system]
 requires = ["whool"]
 build-backend = "whool.buildapi"
+
+[project]

Désolé mais je ne comprends pas ce que vous entendez réellement.
Merci

yankinmax yankinmax commented on code on Dec 08, 2025 16:55 UTC
Code Review
sale_product_pack/models/product_pack_line.py:1
@@ -25,7 +25,7 @@ def get_sale_order_line_vals(self, line, order):
             "product_uom_qty": quantity,
         }
         sol = line.new(line_vals)
-        sol._onchange_product_id_warning()
+        sol._onchange_product_id()

I agree with @pedrobaeza.
It seems this onchange was only called to trigger sale_line_warn_msg update.
This can be removed now as sale_line_warn_msg is computed field.
https://github.com/odoo/odoo/blob/06b9b1a67a94f5bdf28c6898a8f8678f55d98fb7/addons/sale/models/sale_order_line.py#L531

@apik-mgu can you pls remove it?

yankinmax yankinmax approved these changes on Dec 08, 2025 16:56 UTC
Approved Reviewer

pre-approve considering changes requested

apik-mgu apik-mgu commented on code on Dec 09, 2025 09:09 UTC
Code Review
sale_product_pack/models/product_pack_line.py:1
@@ -25,7 +25,7 @@ def get_sale_order_line_vals(self, line, order):
             "product_uom_qty": quantity,
         }
         sol = line.new(line_vals)
-        sol._onchange_product_id_warning()
+        sol._onchange_product_id()

@yankinmax Modification effectuée

lef-adhoc lef-adhoc commented on Dec 17, 2025 20:49 UTC
Contributor

@pedrobaeza Hi, what would be required to merge this PR?

pedrobaeza pedrobaeza commented on code on Dec 18, 2025 07:19 UTC
Code Review
sale_product_pack/pyproject.toml:1
@@ -1,3 +1,10 @@
 [build-system]
 requires = ["whool"]
 build-backend = "whool.buildapi"
+
+[project]

I mean this modification should be out.

pedrobaeza pedrobaeza commented on code on Dec 18, 2025 07:20 UTC
Code Review
sale_product_pack/models/sale_order.py:1
@@ -0,0 +1,66 @@
+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from odoo import api, models
+from odoo.exceptions import UserError
+
+
+class SaleOrder(models.Model):
+    _inherit = "sale.order"
+
+    def copy(self, default=None):

Copy now may return a recordset, so this is not correct (this applies also to 18).

apik-mgu apik-mgu commented on Dec 18, 2025 08:34 UTC
Author

Cela a déjà été fait.

Cordialement,
​

Michel GUIHENEUF
Consultant Odoo
02 57 62 02 56
@.
https://apik.cloud
Nautiparc 16 rue de l'île de la jument, 56870, Baden
________________________________
De : Pedro M. Baeza
@.>
Envoyé : jeudi 18 décembre 2025 08:19
À : OCA/product-pack @.>
Cc : Michel GUIHENEUF
@.>; Mention @.>
Objet : Re: [OCA/product-pack] [19.0] [MIG] sale_product_pack : migrate to 19.0 (PR #225)

@pedrobaeza commented on this pull request.

________________________________

In sale_product_pack/pyproject.toml<https://github.com/OCA/product-pack/pull/225#discussion_r2629876711>:

@@ -1,3 +1,10 @@

[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
+
+[project]

I mean this modification should be out.

—
Reply to this email directly, view it on GitHub<https://github.com/OCA/product-pack/pull/225#discussion_r2629876711>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARBM22WYXCGIPY35WUPKDOT4CJIRJAVCNFSM6AAAAACJU4XKZ6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKOJRGE2DSMJWGU>.
You are receiving this because you were mentioned.Message ID:
@.>

apik-mgu apik-mgu commented on Dec 18, 2025 08:58 UTC
Author

J'ai fait une correction semblable à ce que fait Odoo.

Si cela n'est pas suffisant, pouvez-vous m'expliquer clairement ce que vous attendez comme correction.

Merci

Cordialement,
​

Michel GUIHENEUF
Consultant Odoo
02 57 62 02 56
@.
https://apik.cloud
Nautiparc 16 rue de l'île de la jument, 56870, Baden
________________________________
De : Pedro M. Baeza
@.>
Envoyé : jeudi 18 décembre 2025 08:21
À : OCA/product-pack @.>
Cc : Michel GUIHENEUF
@.>; Mention @.>
Objet : Re: [OCA/product-pack] [19.0] [MIG] sale_product_pack : migrate to 19.0 (PR #225)

@pedrobaeza commented on this pull request.

________________________________

In sale_product_pack/models/sale_order.py<https://github.com/OCA/product-pack/pull/225#discussion_r2629880967>:

@@ -0,0 +1,66 @@

+# Copyright 2019 Tecnativa - Ernesto Tejeda
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+from odoo import api, models
+from odoo.exceptions import UserError
+
+
+class SaleOrder(models.Model):
+ _inherit = "sale.order"
+
+ def copy(self, default=None):

Copy now may return a recordset, so this is not correct (this applies also to 18).

—
Reply to this email directly, view it on GitHub<https://github.com/OCA/product-pack/pull/225#pullrequestreview-3591154216>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ARBM22VAQUTBN2H7UKKT4E34CJIXRAVCNFSM6AAAAACJU4XKZ6VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZTKOJRGE2TIMRRGY>.
You are receiving this because you were mentioned.Message ID:
@.>

pedrobaeza pedrobaeza commented on Dec 18, 2025 15:38 UTC
Contributor

Please don't use other language except English. The change is not correct, as it's still comparing == self, being self probably a multi-record, so the code is not valid. Check also the rest of the comments.

apik-mgu apik-mgu commented on Dec 22, 2025 07:49 UTC
Author

Modification made

ivantodorovich ivantodorovich commented on code on Dec 22, 2025 16:15 UTC
Code Review
sale_product_pack/models/sale_order.py:1
@@ -9,11 +9,13 @@ class SaleOrder(models.Model):
 
     def copy(self, default=None):
         sale_copy = super().copy(default)
-        # we unlink pack lines that should not be copied
-        pack_copied_lines = sale_copy.order_line.filtered(
-            lambda line: line.pack_parent_line_id.order_id == self
-        )
-        pack_copied_lines.unlink()
+        for record in self:
+            # we unlink pack lines that should not be copied
+            pack_copied_lines = sale_copy.order_line.filtered(
+                lambda x, order=record: x.pack_parent_line_id.order_id == order
+            )
+            if pack_copied_lines:
+                pack_copied_lines.unlink()

I think you can implement this in the new _get_copiable_order_lines hook now, and so it's filtered directly in the creation values provided by copy_data

FrancoMaxime FrancoMaxime commented on code on Feb 18, 2026 14:47 UTC
Code Review
sale_product_pack/pyproject.toml:1
@@ -1,3 +1,10 @@
 [build-system]
 requires = ["whool"]
 build-backend = "whool.buildapi"
+
+[project]

I agree with @pedrobaeza , we should not modify the pyproject.toml

much-filipe-colaco much-filipe-colaco commented on Feb 23, 2026 16:27 UTC
Contributor

Any news on this migration? Is it planned to be released soon?

FrancoMaxime FrancoMaxime commented on Mar 12, 2026 13:13 UTC
Contributor

I make another pull request with the changes asked from @pedrobaeza and @ivantodorovich

see https://github.com/OCA/product-pack/pull/244

Reviewers
Assignees
apik-mgu apik-mgu
Labels
risk: low confidence: 83.9% reviewed sensitive_module
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 96% (HIGH) · Higher = larger blast radius
96%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 83.9% · Lower = rushed or shallow review
83.9%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 15.4% · Safe to merge
15.4%