Skip to content
Permalink
Browse files

[IMP] hr_expense: make some fields optional on expense sheets.

Since we change the expense sheet to an editable tree view, we had to add some fields on it since it doesn't open a form view anymore.
We take advantage of the optional fields on tree views to allow the user to remove some of those fields if they are not needed.

Task-1978580
  • Loading branch information...
MaxLarue committed Oct 9, 2019
1 parent 068271f commit 175a99961eb9d4ddafa7eefbc7e18cde16d9f947
Showing with 10 additions and 10 deletions.
  1. +10 −10 addons/hr_expense/views/hr_expense_views.xml
@@ -39,7 +39,7 @@
<field name="company_id" groups="base.group_multi_company" optional="show"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" optional="show"/>
<field name="total_amount" sum="Total Amount" widget="monetary" options="{'currency_field': 'currency_id'}" optional="show"/>
<button name="action_get_attachment_view" string="View Attached Documents" type="object" icon="fa-paperclip" attrs="{'invisible': [('attachment_number', '=', 0)]}" optional="show"/>
<button name="action_get_attachment_view" string="View Attached Documents" type="object" icon="fa-paperclip" attrs="{'invisible': [('attachment_number', '=', 0)]}"/>
<field name="message_unread" invisible="1"/>
<field name="state" optional="show"/>
<field name="activity_exception_decoration" widget="activity_exception" optional="show"/>
@@ -502,17 +502,17 @@
<page name="expenses" string="Expense">
<field name="expense_line_ids" nolabel="1" widget="many2many" domain="[('state', '=', 'draft'), ('employee_id', '=', employee_id), ('company_id', '=', company_id)]" options="{'reload_on_button': True}" context="{'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header'}">
<tree decoration-danger="is_refused" editable="bottom">
<field name="company_id" optional="hide" />
<field name="company_id" invisible="1"/>
<field name="date" optional="show"/>
<field name="name" optional="show"/>
<field name="name"/>
<field name="state" invisible="1"/>
<field name="analytic_account_id" domain="['|', ('company_id', '=', parent.company_id), ('company_id', '=', False)]" groups="analytic.group_analytic_accounting"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags"/>
<field name="message_unread" optional="hide"/>
<field name="attachment_number" string=" " optional="show"/>
<button name="action_get_attachment_view" string="View Attachments" type="object" icon="fa-paperclip" optional="show"/>
<field name="tax_ids" widget="many2many_tags" groups="account.group_account_user" optional="hide"/>
<field name="currency_id" optional="hide"/>
<field name="analytic_account_id" domain="['|', ('company_id', '=', parent.company_id), ('company_id', '=', False)]" groups="analytic.group_analytic_accounting" optional="show"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" optional="show"/>
<field name="message_unread" invisible="1"/>
<field name="attachment_number" string=" "/>
<button name="action_get_attachment_view" string="View Attachments" type="object" icon="fa-paperclip"/>
<field name="tax_ids" widget="many2many_tags" groups="account.group_account_user"/>
<field name="currency_id" invisible="1"/>
<field name="product_id" optional="show"/>
<field name="quantity" optional="show"/>
<field name="unit_amount" optional="show"/>

0 comments on commit 175a999

Please sign in to comment.
You can’t perform that action at this time.