summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPriyanka Kakadiya <pka@odoo.com>2019-04-04 10:24:02 +0000
committerPriyanka Kakadiya <pka@odoo.com>2019-04-04 10:30:55 +0000
commit2a7a6c096effd07baeb718ccf295b2bfde82d2c4 (patch)
tree9860744d890b73963bee0f111c69c281b5bf6308
parent0e85b5b1321c13bc4ac88ba5b4f02846a7a1bfe9 (diff)
[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>
-rw-r--r--addons/purchase/models/purchase.py2
1 files changed, 1 insertions, 1 deletions
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