From e0522e0bf591d3d08b5a11f2ed4ce4cf029d24da Mon Sep 17 00:00:00 2001 From: Damien Bouvy Date: Thu, 15 Sep 2022 11:37:29 +0000 Subject: [PATCH] [IMP] hr_expense: stop tracking the approver on expenses The field is related towards the 'manager' field of the expense sheet, which means that when the approver is suggested automatically based on hr data, the expense records get written a value for this field (which is not in the view) which gets logged as: - None -> Mitchell Admin (Approved By) which seems to suggest that: - the expense has been approved (it has not, a report was created) - Mitchell Admin has approved: it may not be him (as when approving, the 'manager' field does not log who did the approval but who was supposed to initially) Disabling tracking for this field (which contained no actionable information at best, and incorrect suggestions at worst) makes this problem go away. closes odoo/odoo#100241 Signed-off-by: Kevin Baptiste --- 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 293995b7eb6..c554cd6902a 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -97,7 +97,7 @@ class HrExpense(models.Model): ], compute='_compute_state', string='Status', copy=False, index=True, readonly=True, store=True, default='draft') sheet_id = fields.Many2one('hr.expense.sheet', string="Expense Report", domain="[('employee_id', '=', employee_id), ('company_id', '=', company_id)]", readonly=True, copy=False) sheet_is_editable = fields.Boolean(compute='_compute_sheet_is_editable') - approved_by = fields.Many2one('res.users', string='Approved By', related='sheet_id.user_id') + approved_by = fields.Many2one('res.users', string='Approved By', related='sheet_id.user_id', tracking=False) approved_on = fields.Datetime(string='Approved On', related='sheet_id.approval_date') reference = fields.Char("Bill Reference") is_refused = fields.Boolean("Explicitly Refused by manager or accountant", readonly=True, copy=False)