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.

1

How to enable the discount per sales order line in a module?

By
Bruno
on 10/13/13, 12:37 PM 2,031 views

Hi, I have written a module where all OpenERP customization are kept segregated. I am trying to add to this module also the enabling of the discount per sale order line. I want that this feature is enabled simply by installing my module and not going thru the web interface in the configuration->sale menu.

I am looking for something like:

<record model="sales.config.settings" id="xxxx"> <field name="group_discount_per_so_line">True</field> </field> </record>

but I am not sure what is the correct value for the id. Any help? Thank you

0

IBS

--IBS--
1302
| 4 5 8
Tétouan, Morocco
--IBS--

For more informations about IBS, please visit our website at www.ibs-na.com.

For a specific questions, collaboration or help, please send us an email to support@ibs-na.com

IBS
On 10/14/13, 10:28 AM

Since those configurations are simply group assignments, you can use the following:

    <record id="sale.group_discount_per_so_line" model="res.groups">
        <field name="users" eval="[(4, ref('RECORD_ID_OF_THE_USER'))]"/>
    </record>

sale.group_discount_per_so_line : is the id of the group that allows discounts in SO lines. RECORD_ID_OF_THE_USER : the record id of your user, you must create it with your module, so that you can specify an id.

Thank you Karim. It works very well !

To enable the admin user to manage discounts on sale order Iines I used the following code:

<record id="sale.group_discount_per_so_line" model="res.groups"> <field name="users" eval="[(4, ref('base.user_root'))]"/> </record>

Bruno
on 10/14/13, 3:23 PM

Yes, that's it, you are welcome :-)

IBS
on 10/14/13, 4:07 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

0 follower(s)

Stats

Asked: 10/13/13, 12:37 PM
Seen: 2031 times
Last updated: 3/16/15, 8:10 AM