[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:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user