Open
Description
Even for the invoices with actually allocated CNs with amount_credited
To reproduce, let's use Demo Company and e.g. Invoice INV-0005 for Hamilton Smith Ltd paid with Credit Note CN-0015:
from xero_python.accounting import AccountingApi
XERO_TENANT_ID = ... # use your credentials
accounting_api = AccountingApi(...) # ...
resp = accounting_api.get_invoices( # or .get_invoice by ID, whatever
xero_tenant_id=XERO_TENANT_ID, invoice_numbers=["INV-0005"]
)
invoice = resp.invoices[0]
cn = invoice.credit_notes[0]
print(cn.allocations) # None
res = accounting_api.get_credit_note(
xero_tenant_id=XERO_TENANT_ID,
credit_note_id=cn.credit_note_id,
)
cn_full = res.credit_notes[0]
print(f"{len(cn_full.allocations)=}") # len(cn_full.allocations)=1
version 7.1.0
Metadata
Metadata
Assignees
Labels
No labels