我正在尝试使用Python zeep创建发票。我在弄清楚如何将customList发送到发票项时遇到麻烦。发票创建:
invoiceItemType = client.get_type('ns19:InvoiceItem')
invoiceItem = [invoiceItemType(item = {"internalId":"261992"}, line=1, quantity=2, customFieldList = CustomFieldList)]
invoiceItemListType = client.get_type('ns19:InvoiceItemList')
invoiceItemList = invoiceItemListType(item = invoiceItem)
invoiceType = client.get_type('ns19:Invoice')
invoice = invoiceType(itemList= invoiceItemList, entity={"internalId" : "408100"})
testRes = client.service.add(record= invoice, _soapheaders={"tokenPassport": clientPass})
这是我创建custonFieldList的方式:
[![CustomFieldListType = client.get_type('ns0:CustomFieldList')
SelectCustomFieldRefType = client.get_type('ns0:SelectCustomFieldRef')
ListOrRecordRefType = client.get_type('ns0:ListOrRecordRef')
ListOrRecordRef = ListOrRecordRefType(internalId = "1")
SelectCustomFieldRef = \[SelectCustomFieldRefType(value= ListOrRecordRef, scriptId="customlist_mmprogramtype")\]
CustomFieldList = CustomFieldListType(customField = SelectCustomFieldRef)][1]][1]
我要从中传递值的CustomList具有ID customlist_mmprogramtype,在此列表中,具有从1开始的内部ID的值。
任何对我做错事的帮助将不胜感激。我不断收到的错误是
<platformCore:message>Please enter value(s) for: Program Type</platformCore:message>
非常感谢您的帮助。