[FIX] sale_coupon: Prevent users to modify the reward line product

Purpose
=======

People doesn't understand that the reward line product is the product that will be used in the discount line, not the product the be rewarded

If they set another product before the program is created, the product they set will be renamed, which is wrong.

Specification
=============

- Don't display the field before it's set
- Make the field readonly on the program form view
This commit is contained in:
Yannick Tivisse
2017-06-21 15:54:15 +02:00
parent c32fb6e358
commit 3ed9b783dc
+1 -1
View File
@@ -45,7 +45,7 @@
<group string="Rewards">
<group name='reward'>
<field name="reward_type" widget="radio"/>
<field name="discount_line_product_id"/>
<field name="discount_line_product_id" attrs="{'invisible': [('discount_line_product_id', '=', False)]}" readonly="True"/>
</group>
<group>
<field name="reward_product_id" attrs="{'invisible': [('reward_type', 'in', ('discount', 'free_shipping'))], 'required': [('reward_type', '=', 'product')]}" placeholder="Select reward product"/>