Do not crash if there is no Euro currency defined for intrastat reports
Closes #14050 (grafted from 8b44253eff407832523cbb9e023955ee5c4a4ba9) --HG-- branch : 7.0
This commit is contained in:
1 parent
311657c7fa
commit
6b024d527e
2 files changed
+5
-2
No files matched your search
@@ -24,7 +24,10 @@ class Company(metaclass=PoolMeta):
|
||||
currency = company.currency
|
||||
else:
|
||||
if not eur:
|
||||
eur, = Currency.search([('code', '=', 'EUR')], limit=1)
|
||||
try:
|
||||
eur, = Currency.search([('code', '=', 'EUR')], limit=1)
|
||||
except ValueError:
|
||||
pass
|
||||
currency = eur
|
||||
currencies[company.id] = currency
|
||||
return currencies
|
||||
@@ -418,7 +418,7 @@ class Move(metaclass=PoolMeta):
|
||||
return round(Currency.compute(
|
||||
self.currency,
|
||||
self.unit_price * Decimal(str(self.quantity)),
|
||||
self.company.intrastat_currency,
|
||||
self.company.intrastat_currency or self.currency,
|
||||
round=False), ndigits)
|
||||
|
||||
def _intrastat_quantity(self, unit):
|
||||
|
||||
Reference in new issue
Block a user