From 6d971fa66e418c2ddac446a72ed11fdd462c7dc8 Mon Sep 17 00:00:00 2001 From: Aaron Henriquez Date: Tue, 28 May 2019 11:07:45 +0200 Subject: [PATCH] [IMP]pass the payment term to the contract from the partner --- contract/models/contract.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/contract/models/contract.py b/contract/models/contract.py index 5b849cbe..ae20506e 100644 --- a/contract/models/contract.py +++ b/contract/models/contract.py @@ -188,6 +188,12 @@ class AccountAnalyticAccount(models.Model): def _onchange_partner_id(self): self.pricelist_id = self.partner_id.property_product_pricelist.id self.fiscal_position_id = self.partner_id.property_account_position_id + if self.contract_type == 'purchase': + self.payment_term_id = \ + self.partner_id.property_supplier_payment_term_id + else: + self.payment_term_id = \ + self.partner_id.property_payment_term_id self.invoice_partner_id = self.partner_id.address_get(['invoice'])[ 'invoice' ]