Odoo Help


Sales price based on supplier price list not picking up price

martin mueller
on 9/25/13, 6:50 PM 4,217 views

I have the following situation (openerp 7 - 20130914 - windows)

  • supplier pricelist based on "Supplier Prices on the product form" => the correct price is picked up when I make a purchase quote
  • sales pricelist based on the "Supplier Prices on the product form" with an uplift and a fixed amount

The supplier price is not picked up, instead 0.00 is found. If I add a rule "Catch all" based on the public price, with a higher sequence number then that price is selected, thus this pricelist version is used to compute the price. I have checked the quantities, the product and product category, removed the uplift/fixed amount, but I cannot get it to pick up the supplier price, it always picks up the "Catch all" rule.

What am I (or the program) doing wrong?


Andreas Brueckl

--Andreas Brueckl--

| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 9/26/13, 5:16 AM

I have tested this scenario and it was working fine when the customer of the SO is one of the suppliers.

If the customer of the SO is not one of the products suppliers, then this can not work since OpenERP does not know which supplier it should choose.

If you want to use always the first one you can customize the following:

  • Create a new function field in the product which always returns the cost price of the first supplier
  • Create a new Price Type which points to the new function field
  • Create a new Pricelist Item in your pricelist which is based on this Price Type

Thanks Andreas! yes that way it works, although computing the best purchase price for all suppliers would make more sense to me. I was wondering because there is a field price in product.product and _product_price could be rewritten to take into account the preferred supplier (lowest sequence nb in the supplier subform). BTW, when I try to add the function field to the tree view of products I get a KeyError:3 from orm.py ?!?

martin mueller
on 9/26/13, 8:37 PM

Please post the whole traceback and your code

Andreas Brueckl
on 9/27/13, 4:39 AM
Sanat Panda
On 8/24/17, 3:09 AM

In Openerp 7, when you create pricelist to pick 'Supplier Price from Product', then the pricelist always makes sure to check the Customer chosen on the Sales Order and the Supplier set on the Product are same, only then it picks up the Supplier price on Product. So essentialy the customer chosen should alse be a supplier and should be among the ones set on the product.

In Odoo 8, the pricelist does not check for this. It always picks up the price of the first supplier set on the Product. Thus no matter what it always picks up supplier price in Pricelist.

Sebastian Bollatti
On 4/15/15, 12:27 PM

I will like to understand the use of "Supplier Pricelist" and it's difference to Product -> Supplier according to "Request For Quotation "and "Purchase Order"

If a supplier provide a Pricelist and it's updated you just can avoid the RFQ and go directly to Purchase Order.

The prices for every product should be picked from Supplier Pricelist and if a discount per quantity would be used from ??? product -> supplier?

...really I don't understand whats the meaning or the thought when it was made the module.

Also dealing with Product Variant like Bolts that has many sizes and a few pitches... How can it work with this?

Sebastian Bollatti
on 4/15/15, 2:17 PM
martin mueller
On 9/27/13, 5:18 AM

This is my code:

from openerp.osv import fields, osv
from openerp.tools.translate import _
import openerp.addons.decimal_precision as dp

class product_product(osv.osv):
_inherit = "product.product"
_name = "product.product"

def _product_best_price(self, cr, uid, ids, name, arg, context=None):
return {ids[0]: 17}
def _product_best_supplier(self, cr, uid, ids, name, arg, context=None):
    return {ids[0] : 6}
_columns = {
    'bsprice': fields.function(_product_best_price, type='float', string='Best Purchase Price', digits_compute=dp.get_precision('Product Price')),
    'bsupp_id': fields.function(_product_best_supplier, type='many2one', relation="res.partner", string='Main Supplier'),

and I use this xml file:

<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">base.product.defaults.product.form</field>
<field name="model">product.product</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
    <field name="arch" type="xml">
    <xpath expr="/form/sheet/notebook/page[@string='Procurements']/group[@name='procurement']/group[@name='general']/field[@name='standard_price']" position="after">
        <field name="bsprice"/>
        <field name="bsupp_id"/>

That works perfectly in form view, but when I add bsprice to the tree view (via web), I get this error:

File "C:\Program Files (x86)\OpenERP\Server\server\.\openerp\osv\orm.py", line 3729, in _read_flat
KeyError: 3

The server log doesn't say more.

I also tried to make an xml file for the tree view, but without success (xml errors, key error, ...)

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 9/25/13, 6:50 PM
Seen: 4217 times
Last updated: 8/24/17, 3:09 AM