[IMP] hr_expense: editable expense lines

In #138387 we modified the expense lines tree in expense reports so that the user can click on the lines to see an attached receipt in the viewer at the side of the webpage. The tree was made to be readonly to make clicking the lines easier and to make it harder for the user to change a field by mistake. This commit reverts the lines to being editable again while leaving some fields as readonly like quantity and taxes as those can invalidate the expense.

task-3685651

closes odoo/odoo#149588

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
This commit is contained in:
Ali Alfie (alal)
2024-02-22 16:23:58 +00:00
parent a60cced448
commit 4f65c035b3
+6 -6
View File
@@ -882,7 +882,7 @@
}"
readonly="not is_editable"
force_save="1">
<tree>
<tree editable="bottom">
<field name="employee_id" column_invisible="True"/>
<field name="state" column_invisible="True"/>
<field name="nb_attachment" column_invisible="True"/>
@@ -903,18 +903,18 @@
optional="show"
options="{'product_field': 'product_id', 'account_field': 'account_id', 'business_domain': 'expense'}"/>
<field name="account_id" optional="hide" groups="account.group_account_readonly"/>
<field name="price_unit" optional="hide" widget="monetary" options="{'currency_field': 'company_currency_id', 'field_digits': True}"/>
<field name="price_unit" optional="hide" widget="monetary" options="{'currency_field': 'company_currency_id', 'field_digits': True}" readonly="True"/>
<field name="currency_id" optional="hide" readonly="True" groups="base.group_multi_currency"/>
<field name="quantity" optional="hide" readonly="not product_has_cost"/>
<field name="quantity" optional="hide" readonly="True"/>
<field name="tax_ids" string="Taxes" optional="show" widget="many2many_tags"
context="{'default_company_id': company_id}"/>
context="{'default_company_id': company_id}" readonly="True"/>
<field name="tax_amount_currency" optional="hide" options="{'currency_field': 'currency_id'}"
context="{'default_company_id': company_id}" readonly="True" groups="base.group_multi_currency"/>
<field name="tax_amount" optional="hide" readonly="True"/>
<field name="total_amount_currency" options="{'currency_field': 'currency_id'}"
string="Subtotal In Currency " optional="show"
readonly="not is_multiple_currency" groups="base.group_multi_currency"/>
<field name="total_amount" string="Subtotal" readonly="product_has_cost"/>
readonly="true" groups="base.group_multi_currency"/>
<field name="total_amount" string="Subtotal" readonly="True"/>
</tree>
</field>
<group class="oe_subtotal_footer" colspan="2" name="expense_total">