Merge lp:~openerp-dev/openobject-addons/7.0-opw-601797-msh into lp:openobject-addons/7.0
Status: | Approved |
---|---|
Approved by: | Vinay Rana (OpenERP) |
Approved revision: | 9702 |
Proposed branch: | lp:~openerp-dev/openobject-addons/7.0-opw-601797-msh |
Merge into: | lp:openobject-addons/7.0 |
Diff against target: |
57 lines (+22/-18) 1 file modified
product/pricelist.py (+22/-18) |
To merge this branch: | bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-601797-msh |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Vinay Rana (OpenERP) (community) | Approve | ||
Martin Trigaux (OpenERP) | Pending | ||
Naresh(OpenERP) | Pending | ||
Review via email: mp+199386@code.launchpad.net |
Description of the change
Hello,
Fixed the issue of price_get, it should consider other items if it fails in following scenario. Create a pricelist with two items, Item A and Item B, Item A: product=null, category=null, sequence=1, base=Supplier Prices on the product form, Item B: product=null, category=null, sequence=5, base=Cost Price, now edit any product and set supplier with any price rule in Supplier Information tab of product and then create a purchase order with same supplier and add a purchasse order line with same product which we changed and you will find price=0 because no price rules are defined in supplier form of product, when this is the case then we should consider other pricelist items.
Demo:-
Take any existing product
Cost price = $10
Supplier exists (product_
no Supplier price exists (pricelist_
create new purchase pricelist with the following:
pricelist item A:
Product is null
Product Category is null
Sequence = 1
Based On = Supplier Prices on the product form (value = -2)
remaining fields = 0
pricelist item B:
Product is null
Product Category is null
Sequence = 5
Based On = Cost Price (value = 2)
remaining fields = 0
Steps to face:
create new Purchase Order
Supplier is same as defined in product setup above
select pricelist created from above setup
select part from above setup
RESULT: price_unit = $0
EXPECTED: price_unit = $10
If there are no price rule defined in supplier information then those pricelist items must be skipped from initial query, what is current behavior we search for supplier information i.e product_
We should filter those items which has base == -2 and there is no supplier price rule defined and we should consider other items to calculate price.
The fix will considers pricelist items in sequence if first pricelist(according to sequence) have configuration like based on supplier information of product form and product has supplier without price rule then code will skip that item and considers next item.
Thanks.
Unmerged revisions
- 9702. By Mohammed Shekha(OpenERP)<email address hidden>
-
[FIX]Fixed the issue of price_get, it should consider other items if it fails in following scenario. Create a pricelist with two items, Item A and Item B, Item A: product=null, category=null, sequence=1, base=Supplier Prices on the product form, Item B: product=null, category=null, sequence=5, base=Cost Price, now edit any product and set supplier with any price rule in Supplier Information tab of product and then create a purchase order with same supplier and add a purchasse order line with same product which we changed and you will find price=0 because no price rules are defined in supplier form of product, when this is the case then we should consider other pricelist items.
I am agree with the solution as the partner section price is not assigned then system will return another sequence rule instead of zero value.
The propose fix will fixes this issue.