[FIX] sale: correctly set default fiscal position on invoice
default fiscal position of previously selected partner is not getting cleared up when current selected partner doesn't have a default one task: 2071608 closes: #37231 $XX closes odoo/odoo#37728 X-original-commit: bce4bcc61196bbeafb41f77b7a95051b225faea6 Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit is contained in:
@@ -45,12 +45,12 @@ class AccountMove(models.Model):
|
||||
@api.onchange('partner_id')
|
||||
def _onchange_partner_id(self):
|
||||
# OVERRIDE
|
||||
res = super(AccountMove, self)._onchange_partner_id()
|
||||
|
||||
# Recompute 'partner_shipping_id' based on 'partner_id'.
|
||||
addr = self.partner_id.address_get(['delivery'])
|
||||
self.partner_shipping_id = addr and addr.get('delivery')
|
||||
|
||||
res = super(AccountMove, self)._onchange_partner_id()
|
||||
|
||||
# Recompute 'narration' based on 'company.invoice_terms'.
|
||||
if self.type == 'out_invoice':
|
||||
self.narration = self.company_id.with_context(lang=self.partner_id.lang).invoice_terms
|
||||
|
||||
Reference in New Issue
Block a user