[17.0][FIX] sale_product_multi_add: ignore the pricelist of the wizard#4381
[17.0][FIX] sale_product_multi_add: ignore the pricelist of the wizard#4381dtec-landoo wants to merge 1 commit into
Conversation
|
@rousseldenis @newtratip @jbaudoux Hi! the patch coverage is at 100%. CI is fully green. Let me know if everything looks good to merge! |
BhaveshHeliconia
left a comment
There was a problem hiding this comment.
Feature Tested: Import multiple products from a Sale Order (Add Multiple Products wizard)
Steps to Reproduce / Testing Flow:
- Create a Product:
Product Name: Laptop
Sales Price: 150
- Configure a Pricelist:
Pricelist Name: Sales Pricelist
Pricelist Item: * Applied On: Product (Laptop)
Computation: Fixed Price
Fixed Price: 120
- Create a Sale Order:
Customer: Admin
Pricelist: Sales Pricelist
Click on the "Add Multiple Products" button from the Sale Order Lines view to open the wizard.
Observed Behavior:
Inside the "Add Multiple Products" wizard, the Unit Price for the Laptop is displayed as 150 (the standard Sales Price).
However, once the selection is confirmed and the product is added to the Sale Order Lines, the price correctly updates to 120 (based on the selected pricelist).
Suggested Improvement / Question:
Is it possible to update the "Add Multiple Products" wizard so that the Unit Price column dynamically reflects the price based on the selected Sale Order Pricelist (e.g., showing 120 instead of 150)?
Showing the pricelist-adjusted price directly in the wizard would provide a much better user experience and prevent confusion before confirmation. Could we look into making this improvement?
Context / Current behavior
Currently, when adding products to a Sale Order using the
sale.import.productswizard, theprice_unitof the newly created sale order lines is strictly hardcoded to the product'slist_price.This behavior bypasses Odoo's standard pricing logic. It completely ignores the pricelist applied to the Sale Order, customer-specific discounts, B2B conditions, and the order's currency, which leads to incorrect pricing on the generated lines.
Fix / Expected behavior
Removed the hardcoded assignment of
"price_unit": item.product_id.list_pricein the_get_line_valuesmethod.By omitting this value during the line creation via
.new(), Odoo's standard compute methods will natively take over and accurately calculate theprice_unitbased on the specific context of the Sale Order (Pricelist, Taxes, etc.).