Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
4019 มุมมอง

Hi , I'm trying to change the state of a created invoice from 'draft' to 'posted' using the Web APIs (Python) by referring to this documentation : https://www.odoo.com/documentation/13.0/webservices/odoo.html


I'm updating the invoice as follows :


@app.route('/makeInvoicePosted')
def makeInvoicePosted(invoice_id):
    invoice_ids = []
    invoice_ids.append(invoice_id)
    common = xmlrpc.client.ServerProxy('{}/xmlrpc/2/common'.format(url))
    print(common)
    uid = common.authenticate(db, username, password, {})
    print("makeInvoicePosted : Odoo Admin User Id : ", uid)
    models = xmlrpc.client.ServerProxy('{}/xmlrpc/2/object'.format(url))
models.execute_kw(db, uid, password, 'account.move', 'write', [[invoice_id], {'state':"posted"}])


 

But I'm getting this error : odoo.exceptions.ValidationError: (\'Posted journal entry must have an unique sequence number per company.\', None)\n'


What could be causing this ? is there something missing in the request?

Thanks in advance!

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
1
ก.ย. 23
2290
3
เม.ย. 19
3233
5
พ.ค. 25
33785
0
ธ.ค. 24
1403
2
ก.ย. 23
2750