From 2a7a6c096effd07baeb718ccf295b2bfde82d2c4 Mon Sep 17 00:00:00 2001 From: Priyanka Kakadiya Date: Thu, 4 Apr 2019 10:24:02 +0000 Subject: [PATCH] [FIX] purchase: do not set currency_id to false - currently, cuurency_id has default value as currency of user's company id. but, when there is no partner set then 'onchange_partner_id' will trigger and set currency_id to false. - so, set user's currency_id instead of false if no partner set. Related to Issue: 1948645 closes odoo/odoo#32415 Signed-off-by: Nicolas Martinelli (nim) --- addons/purchase/models/purchase.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/models/purchase.py b/addons/purchase/models/purchase.py index de25d8b29fc..e44f177afad 100644 --- a/addons/purchase/models/purchase.py +++ b/addons/purchase/models/purchase.py @@ -192,7 +192,7 @@ class PurchaseOrder(models.Model): if not self.partner_id: self.fiscal_position_id = False self.payment_term_id = False - self.currency_id = False + self.currency_id = self.env.user.company_id.currency_id.id else: self.fiscal_position_id = self.env['account.fiscal.position'].with_context(company_id=self.company_id.id).get_fiscal_position(self.partner_id.id) self.payment_term_id = self.partner_id.property_supplier_payment_term_id.id