From d69aa2d98b94cf5439d664aca2ff19654cb89746 Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Tue, 21 Mar 2017 10:12:11 +0100 Subject: [PATCH] [FIX] hr_expense: partner on AML - Create a partner who is a contact of a company - Associate this partner to an employee - Create an expense for the employee, validate and post entries The AML created are linked to the company, not the partner. Since the bank account account is registered on the partner, and not the company, this is more logical to link the AML with the partner. opw-724550 --- 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 26eb023efc4..151020a7395 100644 --- a/addons/hr_expense/models/hr_expense.py +++ b/addons/hr_expense/models/hr_expense.py @@ -120,7 +120,7 @@ class HrExpense(models.Model): ''' This function prepares move line of account.move related to an expense ''' - partner_id = self.employee_id.address_home_id.commercial_partner_id.id + partner_id = self.employee_id.address_home_id.id return { 'date_maturity': line.get('date_maturity'), 'partner_id': partner_id,