[FIX] base: avoid variable referenced before assignment error

If the company currency is not active (that should not happen but nothing
prevents it, probably happening with some CoA installation), the variable
company_currency_format is undefined and an error is raised.

Closes #15799
This commit is contained in:
Moisés López
2017-03-14 10:44:12 +01:00
committed by Martin Trigaux
parent 2ef43281c2
commit 93bb6f322d
+1 -1
View File
@@ -177,7 +177,7 @@ class Currency(models.Model):
function += "if (arguments[1] === %s) { %s }" % (currency.id, return_str)
if (currency == company_currency):
company_currency_format = return_str
function = "if (arguments[1] === false || arguments[1] === undefined) {" + company_currency_format + " }" + function
function = "if (arguments[1] === false || arguments[1] === undefined) {" + company_currency_format + " }" + function
return function
def _select_companies_rates(self):