From f1b2d165fb5378a8f6140b42d19f1e028cc289cc Mon Sep 17 00:00:00 2001 From: eco-odoo Date: Fri, 17 Aug 2018 11:51:29 +0200 Subject: [PATCH] [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. --- addons/sale/models/sale.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/sale/models/sale.py b/addons/sale/models/sale.py index 62170c7985a..2335426a501 100644 --- a/addons/sale/models/sale.py +++ b/addons/sale/models/sale.py @@ -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)