批量发票重复 Odoo8

Mass invoices duplicate Odoo8

是否可以使用 xml-rpc 复制或创建一堆发票?

我尝试使用 Odoo ORMApi 的复制方法

invoices = call('account.invoice','search_read', [('type','ilike',"out_invoice")])

for invoice in invoices:
inv = invoice.copy()

如何将新发票插入数据库?

试试 erppeek,这是一个 python 库,可以让这一切变得更容易

client = erppeek.Client(SERVER, DATABASE, USERNAME, PASSWORD)
invoices=client.search('account.invoice',[('type','ilike',"out_invoice")])
for i in range(len(invoices)):
    client.copy('account.invoice',invoices[i-1])