From f8aeb414ef604ee07a671d54bad6847a6490eee8 Mon Sep 17 00:00:00 2001 From: JordiMForgeFlow Date: Mon, 2 Aug 2021 05:57:51 +0000 Subject: [PATCH] [FIX] sale: pass invoice origin as string instead of list Currently, the default invoice origin for the sale action_view_invoice is being passed as a list by using the mapped method. This causes that, when an invoice is created from this view, the origin is set to ['SOXXXXX']. With the fix, we properly pass the origin as a string so the origin is set as SOXXXXX, which should be the expected. Notice also that the context is only passed when dealing with a single SO. closes odoo/odoo#74579 X-original-commit: 3ad1310eb88581333bb8ccb28b859abcbadabe42 Signed-off-by: Victor Feyens (vfe) --- addons/sale/models/sale_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/models/sale_order.py b/addons/sale/models/sale_order.py index 6c222fe9405..6f4ea321af1 100644 --- a/addons/sale/models/sale_order.py +++ b/addons/sale/models/sale_order.py @@ -638,7 +638,7 @@ class SaleOrder(models.Model): 'default_partner_id': self.partner_id.id, 'default_partner_shipping_id': self.partner_shipping_id.id, 'default_invoice_payment_term_id': self.payment_term_id.id or self.partner_id.property_payment_term_id.id or self.env['account.move'].default_get(['invoice_payment_term_id']).get('invoice_payment_term_id'), - 'default_invoice_origin': self.mapped('name'), + 'default_invoice_origin': self.name, 'default_user_id': self.user_id.id, }) action['context'] = context