From 6b191f4e1f69b63a27068cea0fd15e4162a798ef Mon Sep 17 00:00:00 2001 From: Thomas Binsfeld Date: Fri, 11 Jan 2019 10:05:17 +0100 Subject: [PATCH] [FIX] Contract: copy payment term on generated invoice --- contract/models/contract.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contract/models/contract.py b/contract/models/contract.py index 393e121e..d83b4ac3 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -215,6 +215,7 @@ class AccountAnalyticAccount(models.Model): 'origin': self.name, 'company_id': self.company_id.id, 'user_id': self.partner_id.user_id.id, + 'payment_term_id': self.payment_term_id.id, } @api.multi @@ -277,7 +278,9 @@ class AccountAnalyticAccount(models.Model): @api.model def _finalize_invoice_creation(self, invoices): for invoice in invoices: + payment_term = invoice.payment_term_id invoice._onchange_partner_id() + invoice.payment_term_id = payment_term invoices.compute_taxes() @api.model