This question has been flagged
2541 Views

Hello, i had installed the module purchase discounts for odoo8, but there is no field for discounts at purchase orders. I was diving on the code of the module, and all seems to be ok. I think perhaps thereis a problem with the view of the module, but i don't find what is wrong. Can anyone confirm if this code is right for odoo8? Thanks

<openerp>
<data>
        <record model="ir.ui.view" id="purchase_discount_order_line_form">
                <field name="name">purchase_discount.order.line.form</field>
                <field name="model">purchase.order.line</field>
        <field name="type">form</field>
        <field name="inherit_id" ref="purchase.purchase_order_line_form"/>
        <field name="arch" type="xml">
                        <field name="price_unit" position="after"> # I tryed changing this with: <xpath expr="//field[@name='price_unit']" position="after">
                                <field name="discount"/>
                        </field> # and changing this to </xpath>
                </field>
        </record>
        <record model="ir.ui.view" id="purchase_discount_order_line_tree">
                <field name="name">purchase_discount.order.line.tree</field>
                <field name="model">purchase.order.line</field>
        <field name="type">tree</field>
        <field name="inherit_id" ref="purchase.purchase_order_line_tree"/>
        <field name="arch" type="xml">
                        <field name="price_unit" position="after">
                                <field name="discount"/>
                        </field>
                </field>
        </record>

</data>
</openerp>

 

Avatar
Discard

I could solve this error. The problem is with model and inherit_id fields for form. The default values that comes with this addon are: model=purchase.order.line inherit_id=purchase.purchase_order_line_form Right values: model=purchase.order inherit_id=purchase.purchase_order_form This addon comes with a bug.

Hi Roberto, please explain your need, you want to add discount to specified suppliers?