Skip to content

[17.0][FIX] ensure partner context in price computation.#8

Closed
Qlasta wants to merge 1 commit into17.0-versadafrom
17.0-fix-ensure-product-price-context-aka
Closed

[17.0][FIX] ensure partner context in price computation.#8
Qlasta wants to merge 1 commit into17.0-versadafrom
17.0-fix-ensure-product-price-context-aka

Conversation

@Qlasta
Copy link

@Qlasta Qlasta commented Apr 9, 2025

partner context passed from view not always present.
task id - 25458

Description
In case of Pricelist type partner, price_unit of sale order line is calculated using partner context passed in the view (https://github.com/odoo/odoo/blob/17.0/addons/sale/views/sale_order_views.xml#L520-L526).
However context is lost if price computation is triggered again from backend (e.g. when updating quantities) and it sets list price, but not product.customerinfo price.

Current Behaviour
When pricelist type is "Partner Prices on the product form", unit price in sale order line sometimes is set from list price not from customer info. Example by updating product quantity a few times in sale order line.

Expected Behavior
When pricelist type is "Partner Prices on the product form", unit price in sale order line is always set from customer info.

Proposed implementation
extend _get_product_price_context and update context by adding partner_id from sale order.

@Qlasta Qlasta force-pushed the 17.0-fix-ensure-product-price-context-aka branch from af8289f to 1b12431 Compare April 9, 2025 12:08
partner context passed fromm view not always present.
@Qlasta Qlasta changed the base branch from 17.0-versada to 17.0 April 9, 2025 12:18
@Qlasta Qlasta changed the base branch from 17.0 to 17.0-versada April 9, 2025 12:18
@Qlasta Qlasta force-pushed the 17.0-fix-ensure-product-price-context-aka branch from 1b12431 to ff12bb1 Compare April 9, 2025 12:21
@Qlasta Qlasta requested a review from oerp-odoo April 9, 2025 12:35
"license": "AGPL-3",
"maintainers": ["luisg123v"],
"depends": ["product"],
"depends": ["sale"],

Choose a reason for hiding this comment

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

You are adding this on wrong module. It should be added on this one: https://github.com/OCA/sale-workflow/blob/17.0/product_supplierinfo_for_customer_sale/__manifest__.py

That one must not have sale module dependency.

Copy link
Author

Choose a reason for hiding this comment

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

True! PR to sale-workflow

@Qlasta Qlasta closed this Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants