Hi there
I am trying to create an invoice that is related to the sale order.
I tried in two ways, every time the code is executed without errors, but without the relationship.
The first way is to add an invoice to the sale order direct:
id_sale_order = CreateRecordsXml(
'sale.order', "[ {'partner_id' : 29754 ,'order_line':[(0,0, {'product_id':91644,'name':'test','product_uom_qty':1,'price_unit':30})],'invoice_ids': [(0, 0, {'partner_id' :29754,'move_type': 'out_invoice','invoice_line_ids':[(0,0, {'product_id':91644,'name':'test','quantity':1,'price_unit':30})]})]}]")
===
The second way is to create an invoice then add its id to the sale order :
id_inv = CreateRecordsXml(
'account.move', "[{'partner_id' :39953,'move_type': 'out_invoice','invoice_line_ids':[(0,0, {'product_id':91644,'name':'test','quantity':1,'price_unit':30})]}]")
id_sale_order = CreateRecordsXml(
'sale.order', "[ {'partner_id' : 29754 ,'order_line':[(0,0, {'product_id':91644,'name':'test','product_uom_qty':1,'price_unit':30})],'invoice_ids': [(6, False, "+str(id_inv)+")]}]")
can any one help me?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Akuntansi
- Inventaris
- PoS
- Project
- MRP
Pertanyaan ini telah diberikan tanda
1
Balas
4365
Tampilan
Did you find something?
I also need to access the sale.order from the account.move
Is there a solution?
Menikmati diskusi? Jangan hanya membaca, ikuti!
Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!
DaftarPost Terkait | Replies | Tampilan | Aktivitas | |
---|---|---|---|---|
|
0
Jun 21
|
4564 | ||
|
0
Agu 18
|
4384 | ||
|
1
Jun 21
|
4309 | ||
|
1
Mar 15
|
6492 | ||
|
0
Mei 23
|
2247 |