Skip to content

[17.0][FIX] ensure partner context in price computation#15

Merged
Qlasta merged 1 commit into17.0-versadafrom
17.0-fix-ensure-product-price-context-aka
Apr 14, 2025
Merged

[17.0][FIX] ensure partner context in price computation#15
Qlasta merged 1 commit into17.0-versadafrom
17.0-fix-ensure-product-price-context-aka

Conversation

@Qlasta
Copy link
Copy Markdown

@Qlasta Qlasta commented Apr 10, 2025

partner context passed form 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.


def test_product_supplierinfo_sale_price_without_context_passed(self):
"""Test case when context is not passed during price computation.
The context should be created in the method _get_product_price_context.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
The context should be created in the method _get_product_price_context.
The context should be created in the method _get_product_price_context.

partner context passed fromm view not always present.
@Qlasta Qlasta force-pushed the 17.0-fix-ensure-product-price-context-aka branch from 2c444b0 to ca4ea6c Compare April 14, 2025 06:36
@Qlasta Qlasta merged commit ca4ea6c into 17.0-versada Apr 14, 2025
4 checks passed
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