[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) <nim@odoo.com>
This commit is contained in:
Priyanka Kakadiya
2019-04-04 10:30:55 +00:00
parent 0e85b5b132
commit 2a7a6c096e
+1 -1
View File
@@ -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