Do not try to assign currency id to the invoice if the currency has not be found
Closes #13538
This commit is contained in:
@@ -97,12 +97,11 @@ class IncomingSupplierInvoice(metaclass=PoolMeta):
|
||||
currency = invoice_data.get('currency')
|
||||
if currency:
|
||||
try:
|
||||
currency, = Currency.search([
|
||||
invoice.currency, = Currency.search([
|
||||
('code', '=', currency),
|
||||
])
|
||||
except ValueError:
|
||||
logger.debug(f"Cannot find currency '{currency}'")
|
||||
invoice.currency = currency.id
|
||||
|
||||
invoice.reference = invoice_data.get('number')
|
||||
invoice.description = invoice_data.get('description')
|
||||
|
||||
Reference in New Issue
Block a user