From 25bb9eab170e2dec634a28e103308a4eaa93362c Mon Sep 17 00:00:00 2001 From: Luis Torres Date: Thu, 7 Feb 2019 18:43:43 +0000 Subject: [PATCH] [master] hr_expense: Make consistent selection field The field payment mode in the expense sheet is related with the same field in the expense, but this must be consistent, and if a new option is added in the expense must be considered in the sheet. In Odoo v11 > is not necessary indicate the selection parameter in the field definition. closes odoo/odoo#30933 --- addons/hr_expense/models/hr_expense.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_expense/models/hr_expense.py b/addons/hr_expense/models/hr_expense.py index 1547ef369e4..672ae7ecb33 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -586,7 +586,7 @@ class HrExpenseSheet(models.Model): ], string='Status', index=True, readonly=True, tracking=True, copy=False, default='draft', required=True, help='Expense Report State') employee_id = fields.Many2one('hr.employee', string="Employee", required=True, readonly=True, states={'draft': [('readonly', False)]}, default=lambda self: self.env['hr.employee'].search([('user_id', '=', self.env.uid)], limit=1)) address_id = fields.Many2one('res.partner', string="Employee Home Address") - payment_mode = fields.Selection([("own_account", "Employee (to reimburse)"), ("company_account", "Company")], related='expense_line_ids.payment_mode', default='own_account', readonly=True, string="Paid By") + payment_mode = fields.Selection(related='expense_line_ids.payment_mode', default='own_account', readonly=True, string="Paid By") user_id = fields.Many2one('res.users', 'Manager', readonly=True, copy=False, states={'draft': [('readonly', False)]}, tracking=True, oldname='responsible_id') total_amount = fields.Monetary('Total Amount', currency_field='currency_id', compute='_compute_amount', store=True, digits=dp.get_precision('Account')) company_id = fields.Many2one('res.company', string='Company', readonly=True, states={'draft': [('readonly', False)]}, default=lambda self: self.env.user.company_id)