Odoo Help

Welcome!

This community 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.

0

Purchase pricelist

By
Francine Maltais
on 3/12/15, 3:44 PM 712 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!

1
Francine Maltais
On 3/12/15, 9:11 PM

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

1

Cyril Gaspard (GEM)

--Cyril Gaspard (GEM)--
4136
| 5 6 8
Paris, France
--Cyril Gaspard (GEM)--

Forum contributor since 2008

Cyril Gaspard (GEM)
On 3/12/15, 5:35 PM

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

 

1

Pascal Tremblay

--Pascal Tremblay--
1312
| 5 2 7
Alma, Canada
--Pascal Tremblay--


Pascal Tremblay
On 3/12/15, 4:37 PM

 

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.

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

Pascal Tremblay
on 3/12/15, 4:38 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 3/12/15, 3:44 PM
Seen: 712 times
Last updated: 3/16/15, 8:10 AM