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

Add a field to pricelist.partnerinfo

By
Roberto Barreiro
on 11/20/14, 12:10 PM 702 views

Hello, i would like to add a discount field to the model pricelist.partnerinfo, but this model hasn't got any related view. I tryed it with the view product.product_supplierinfo_form_view but id doesn't work. Any one knows wich is the correct view to use for this? Thanks.

0
Roberto Barreiro
On 11/21/14, 6:22 AM

Solved using in my view the model product.supplier, inheriting the view product.product_supplierinfo_form_view, and making a new class on my addon based on pricelist.partnerinfo with a new field for the discount.

My class:

class pricelist_partnerinfo(osv.osv):
    _name = "pricelist.partnerinfo"
    _inherit = "pricelist.partnerinfo"

    _columns = {
        'discount': fields.float('Discount (%)', digits=(16,2)),
    }

pricelist_partnerinfo()

 

My view:

        <record model="ir.ui.view" id="purchase_discount_product_supplierinfo">
                <field name="name">purchase_discount.product.supplierinfo</field>
                <field name="model">product.supplierinfo</field>
                <field name="inherit_id" ref="product.product_supplierinfo_form_view"/>
                <field name="arch" type="xml">
                        <field name="price" position="after">
                                <field name="discount"/>
                        </field>
                </field>
        </record>

 

 

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: 11/20/14, 12:10 PM
Seen: 702 times
Last updated: 3/16/15, 8:10 AM