ej2 / python-quickbooks

A Python library for accessing the Quickbooks API.
MIT License
394 stars 193 forks source link

CurrencyRef reference value is incorrect #344

Closed lisamburns closed 5 months ago

lisamburns commented 6 months ago

Repro steps:

currency = QBCurrency.where("Code='EUR'", qb=self.qb_client)[0] customer.currencyRef = currency.to_ref() customer.save(qb=self.qb_client)

Looking at the code I think this is because the API docs state that value is supposed to be the 3-letter ISO code of the currency "EUR" rather than the ID of the currency object.

I was able to workaround this by running currency = QBCurrency.where("Code='EUR'", qb=self.qb_client)[0] currency_ref = currency.to_ref() currency_ref.value = currency.Code # hack customer.currencyRef = currency_ref customer.save(qb=self.qb_client)

ej2 commented 5 months ago

This is a case of the QBO documentation saying multiple things... Customer docs says Id. The Multiple Currencies Use Case says code.

I will update it to use code in the next release.

ej2 commented 5 months ago

Fixed in 0.9.7