This question has been flagged
3 Replies
3516 Views

Hello all

I started on Odoo and I need your help

I work on my purchase pricelits and I would like to ensure that it is based "Supplier Prices on the product form" for my Price List Items

My XML, when I want to have as based on "Public sale price" I use "product.standard_price" but I do not know what to use for "Supplier Prices on the product form"

Could someone tell me where I could find it?

Thank you very much for your help!

Avatar
Discard
Author Best Answer

Thank you for your help

I managed to solve my problem thanks to your advice.

Here is my XML file for my price list rule is functional as I wanted

<record id="purchase.item4" model="product.pricelist.item">
            <field name="price_version_id" ref="purchase.ver4" />
            <field name="name">Default purchase rule - PT</field>
            <field name="company_id" type="int">1</field>
            <field name="base" eval="-2"  />
        </record>

Thank you again

Avatar
Discard
Best Answer

 

I think you could try something like this :

        <record id="purchase.item3" model="product.pricelist.item">
            <field name="price_version_id" ref="purchase.ver3" />
            <field name="name">Default purchase rule - ES</field>
            <field name="company_id" type="int">4</field>
            <field name="base" val="-2" />
        </record>

In my table product.pricelist.item, when I put an item « based on supplier price » this is the value I get (-2) in the field « base ». Si id 138 in image below.

Avatar
Discard

I bet we could put an external ID rather than -2... but which external ID?

Best Answer

hi,

there is no xml_id for this item :

field base is a field type selection and also a field function, the base price "Supplier Prices on the product form" is always add in the base field selection with value -2, see the function used for that (v8) in module product, file pricelist.py :

class product_pricelist_item(osv.osv):
    def _price_field_get(self, cr, uid, context=None):
        pt = self.pool.get('product.price.type')
        ids = pt.search(cr, uid, [], context=context)
        result = []
        for line in pt.browse(cr, uid, ids, context=context):
            result.append((line.id, line.name))

        result.append((-1, _('Other Pricelist')))
        result.append((-2, _('Supplier Prices on the product form')))
        return result

'base': fields.selection(_price_field_get, 'Based on', required=True, size=-1, help="Base price for computation."),

Bye

 

Avatar
Discard