[IMP] hr_expense: multi-edit list view for expense reports

Purpose of the task is, Remove the inconsistant behaviour of
expenses and expense report As expenses are editable in batch,
but expense reports are not

So in this commit, make the list views linked to hr.expense.sheet
multi-editable
 - Following fields should not be editable in batch: employee_id,
create_date, company_id, activity_ids, total_amount, currency_id, state
 - the accounting_date and sale_order_id fields should also be editable
in batch for hr.expense

closes odoo/odoo#57138

Taskid: 2323027
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
Mithilesh Rao
2020-09-08 05:10:05 +00:00
committed by Barad Mahendra
parent 0d8ba43991
commit bde14adaaa
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -50,7 +50,7 @@
</header>
<field name="attachment_number" invisible="True"/>
<field name="date" optional="show"/>
<field name="accounting_date" optional="hide" groups="account.group_account_invoice,account.group_account_readonly"/>
<field name="accounting_date" optional="hide" groups="account.group_account_invoice,account.group_account_readonly" readonly="0"/>
<field name="name"/>
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="sheet_id" optional="show" invisible="not context.get('show_report', False)" readonly="1"/>
@@ -529,14 +529,14 @@
<field name="name">hr.expense.sheet.tree</field>
<field name="model">hr.expense.sheet</field>
<field name="arch" type="xml">
<tree string="Expense Reports" js_class="hr_expense_tree_dashboard_upload" sample="1">
<tree string="Expense Reports" multi_edit="1" js_class="hr_expense_tree_dashboard_upload" sample="1">
<field name="employee_id" widget="many2one_avatar_employee"/>
<field name="accounting_date" optional="show" groups="account.group_account_manager"/>
<field name="create_date" optional="hide"/>
<field name="name" string="Expense Report"/>
<field name="user_id" optional="hide" widget="many2one_avatar_user"/>
<field name="company_id" optional="show" groups="base.group_multi_company"/>
<field name="activity_ids" widget="list_activity" optional="show"/>
<field name="activity_ids" widget="list_activity" optional="show" readonly="1"/>
<field name="total_amount" optional="show" sum="Total Amount" decoration-bf="True"/>
<field name="currency_id" optional="hide"/>
<field name="journal_id" optional="hide"/>
@@ -18,7 +18,7 @@
<field name="inherit_id" ref="hr_expense.view_expenses_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='reference']" position="after">
<field name="sale_order_id" optional="hide" attrs="{'invisible': [('can_be_reinvoiced', '=', False)]}" options="{'no_create_edit': True, 'no_create': True, 'no_open': True}" context="{'sale_show_partner_name': True, 'sale_expense_all_order': True}" readonly="1"/>
<field name="sale_order_id" optional="hide" attrs="{'invisible': [('can_be_reinvoiced', '=', False)]}" options="{'no_create_edit': True, 'no_create': True, 'no_open': True}" context="{'sale_show_partner_name': True, 'sale_expense_all_order': True}"/>
<field name="can_be_reinvoiced" invisible="1" readonly="1"/>
</xpath>
</field>