Cost structure doesn't use the Supplier's "Purchase Pricelist"

Bug #814124 reported by Yann Papouin
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
Low
OpenERP R&D Addons Team 2

Bug Description

I'm using the "Product Cost Structure" to estimate the cost of a product.

The PDF report displays:
Components - Suppliers - Quantity - Cost Price per Uom - Supplier Price per Uom

The "Supplier Price per Uom" is given by:
- The cost price
  or
- The supplier price for this quantity if filled in the supplier tab of the product form

If a rule is defined in the "Default Purchase Pricelist Version" then this rule is applied and the "Supplier Price per Uom" value is updated by this rule.

But if a rule is defined in another pricelist, it is not applied whereas the purchase pricelist is assigned to the supplier.

As the supplier is displayed in the report and have its own line, why not using its assigned price list to display the real supplier price ?

Related branches

description: updated
affects: openobject-server → openobject-addons
Revision history for this message
Amit Parik (amit-parik) wrote :

Hello Yann,

I have tested your scenario which you have specified in bug report.

But all are working as expected and I did not faced any problem.

I have attached a video for your more reference so would you please check it again and notify us where did you face the problem.

Thanks and waiting for your reply!

Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Yann Papouin (yann-papouin) wrote :

Thank you for taking your time!

I've done exactly like you in order to test your workflow and I have the same reports result but I'm able to reproduce on it
- If you set in the rule "adasd" : New Price = Base Price * (1+ -0.33) + 0
- Then the report is wrong as the new price is not computed (always 2.00€)

In my own test (from the one I've wrote this bug report):
- The "Default Purchase Pricelist Line" is always Based on "Cost price"
- In the "Sales & Purchases" tab of the Supplier (Axelor here) the Purchase Pricelist is set to it's own pricelist (test/test here)
And same bug:
- The report is wrong as the new price is not computed

Revision history for this message
Yann Papouin (yann-papouin) wrote :

In "mrp\reports\price.py" we have

price = supplier_info_pool.price_get(cr, uid, seller_id.name.id, prod.id, number*prod_qtty)[seller_id.name.id]
price = product_uom_pool._compute_price(cr, uid, prod.uom_id.id, price, to_uom_id=product_uom.id)

If I replaces these lines with (from purchase\purchase.py)
pricelist = seller_id.name.property_product_pricelist_purchase
price = pool.get('product.pricelist').price_get(cr,uid,[pricelist.id],
            prod.id, 1.0, seller_id.name.id, {
                'uom': prod.uom_po_id.id,
                'date': time.strftime('%Y-%m-%d'),
                })[pricelist.id]

then values are correct (rules are applied) (note that as it's just a copy/paste I didn't take into account quantities, dates,etc.). I think that there is an issue here in price_get/_compute_price.

nb: I think that the Product Cost report should be improved:

- by selecting a date in the wizard (using current active price lists is not always the wanted choice)
- by displaying the main supplier only once (actually if you have 2 suppliers for a product, the main is displayed once, and once again with other suppliers)
- by displaying the total supplier price by main supplier (actually only the cost price is displayed, the total supplier price could be as interesting as the cost price as the cost one is based on "supplier/manufacturer" public price.

Amit Parik (amit-parik)
Changed in openobject-addons:
assignee: nobody → OpenERP R&D Addons Team 2 (openerp-dev-addons2)
importance: Undecided → Low
status: Incomplete → Confirmed
Revision history for this message
Amit Parik (amit-parik) wrote :
Changed in openobject-addons:
status: Confirmed → In Progress
Revision history for this message
Mayur Maheshwari(OpenERP) (mma-openerp) wrote :

Hello Yann,

Thanks for Reporting.
It has been fixed in lp:~openerp-dev/openobject-addons/trunk-bug-814124-mma
Revision ID: <email address hidden>
Revision num: 4899.

It will be available in trunk soon.

Changed in openobject-addons:
status: In Progress → Fix Committed
Changed in openobject-addons:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.