Odoo Help


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.


Purchase discounts at odoo8

Roberto Barreiro
on 11/13/14, 12:55 PM 853 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

        <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>
        <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"/>



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.

Roberto Barreiro
on 12/11/14, 2:04 AM

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

on 12/11/14, 2:05 AM

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

2 follower(s)


Asked: 11/13/14, 12:55 PM
Seen: 853 times
Last updated: 3/16/15, 8:10 AM