تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
1 الرد
8094 أدوات العرض

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

الصورة الرمزية
إهمال
أفضل إجابة

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>

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

المنشورات ذات الصلة الردود أدوات العرض النشاط
1
مارس 15
4346
1
أغسطس 25
117
1
أغسطس 25
734
0
أغسطس 25
72
1
أغسطس 25
1034