[IMP] hr_expense: reduce employee visibility on report creation
When creating or editing an expense report, we have to select the corresponding expenses. Since it is constrained that these expenses belong to the same employee as the one from the report, it is not practical to see other expenses in the dialog when adding them. This commit extend the domai of the field in the expense report form so that it doesn't show expenses from other employees. task #1999537 closes odoo/odoo#33932 Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
This commit is contained in:
@@ -506,7 +506,7 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="expenses" string="Expense">
|
||||
<field name="expense_line_ids" nolabel="1" widget="many2many" domain="[('state', '=', 'draft')]" options="{'reload_on_button': True}" context="{'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header', 'expense_adding_line': True}">
|
||||
<field name="expense_line_ids" nolabel="1" widget="many2many" domain="[('state', '=', 'draft'), ('employee_id', '=', employee_id)]" options="{'reload_on_button': True}" context="{'form_view_ref' : 'hr_expense.hr_expense_view_form_without_header', 'expense_adding_line': True}">
|
||||
<tree decoration-danger="is_refused">
|
||||
<field name="date"/>
|
||||
<field name="name"/>
|
||||
|
||||
Reference in New Issue
Block a user