[IMP] sale: creating an invoice from a sale order now triggers _onchange_partner_id
We need to trigger _onchange_partner_id manually in order to allow computations related to the partner change and to avoid creating bridge modules.
This commit is contained in:
committed by
De Paoli Quentin
parent
6145a71da9
commit
f1b2d165fb
@@ -538,6 +538,8 @@ class SaleOrder(models.Model):
|
||||
# Necessary to force computation of taxes. In account_invoice, they are triggered
|
||||
# by onchanges, which are not triggered when doing a create.
|
||||
invoice.compute_taxes()
|
||||
# Idem for partner
|
||||
invoice._onchange_partner_id()
|
||||
invoice.message_post_with_view('mail.message_origin_link',
|
||||
values={'self': invoice, 'origin': references[invoice]},
|
||||
subtype_id=self.env.ref('mail.mt_note').id)
|
||||
|
||||
Reference in New Issue
Block a user