mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP]pass the payment term to the contract from the partner
This commit is contained in:
committed by
Pedro M. Baeza
parent
80c6866709
commit
683e186902
@@ -188,6 +188,12 @@ class AccountAnalyticAccount(models.Model):
|
|||||||
def _onchange_partner_id(self):
|
def _onchange_partner_id(self):
|
||||||
self.pricelist_id = self.partner_id.property_product_pricelist.id
|
self.pricelist_id = self.partner_id.property_product_pricelist.id
|
||||||
self.fiscal_position_id = self.partner_id.property_account_position_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'])[
|
self.invoice_partner_id = self.partner_id.address_get(['invoice'])[
|
||||||
'invoice'
|
'invoice'
|
||||||
]
|
]
|
||||||
|
|||||||
Reference in New Issue
Block a user