Skip to content

Conversation

@nobuQuartile
Copy link
Contributor

@nobuQuartile nobuQuartile commented Oct 28, 2025

5874

If a sales order line without a product_id (section, memo, etc) is passed to _get_product_rule, it causes _compute_price_rule to return {}, which then triggers an error indicating that the product.id key is missing.

_compute_has_pricelist_global's _get_product_rule

suitable_rule = pricelist._get_product_rule(
line.product_id,
quantity=line.product_uom_qty or 1.0,
uom=line.product_uom,
date=line.order_id.date_order,
)

_get_product_rule in odoo/addons
https://github.com/odoo/odoo/blob/c27d978ade9bcbea056933d8fb8b5a924e983bde/addons/product/models/product_pricelist.py#L110-L111

@nobuQuartile nobuQuartile marked this pull request as draft October 28, 2025 08:47
@nobuQuartile nobuQuartile marked this pull request as ready for review October 28, 2025 09:28
Copy link
Member

@yostashiro yostashiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. 👍

Copy link
Contributor

@AungKoKoLin1997 AungKoKoLin1997 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
You should suggest that fix in the migration PR.

@kanda999 kanda999 merged commit 836fbd3 into 16.0 Nov 14, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants