[FIX] hr_expense: Expense unit price is readonly if it has a cost

Step to reproduce:
- Create an expense for an expense product which has a cost

Current behaviour:
- Expense's unit price is modifiable which shouldn't be
 the case according to the help message of hr.expense.unit_amount

Behaviour after PR:
- Expense unit price is only modifiable is there is no unit_amount
(unit_amount = 0)

opw-2781040

closes odoo/odoo#90014

X-original-commit: 44b6d60de301651e52df4c41e32e38d23b0a154e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
Florian Damhaut
2022-04-29 11:01:40 +02:00
committed by Kevin Baptiste
parent d4be21d4c5
commit a91c9e1be4
+1 -1
View File
@@ -143,7 +143,7 @@
<div class="o_row" attrs="{'invisible': ['|', ('product_description', '=', False), ('product_id', '=', False)]}">
<field name ="product_description" class="font-italic"/>
</div>
<field name="unit_amount" required="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'invisible': [('product_has_cost', '=', False)], 'readonly': [('sheet_is_editable', '=', False)]}"/>
<field name="unit_amount" required="1" force_save="1" widget="monetary" options="{'currency_field': 'currency_id', 'field_digits': True}" attrs="{'invisible': [('product_has_cost', '=', False)], 'readonly': ['|', ('sheet_is_editable', '=', False), ('product_has_cost', '=', True)]}"/>
<field name="product_uom_category_id" invisible="1"/>
<label for="quantity" attrs="{'invisible': [('product_has_cost', '=', False)]}"/>
<div class="o_row" attrs="{'invisible': [('product_has_cost', '=', False)]}">