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
- Účtovníctvo
- Sklady
- PoS
- Project
- MRP
This question has been flagged
            
                1
                
                    Odpoveď
                
            
        
        
            
                5218
                
                    Zobrazenia
                
            
        
    Did you find something?
I also need to access the sale.order from the account.move
Is there a solution?
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Registrácia| Related Posts | Replies | Zobrazenia | Aktivita | |
|---|---|---|---|---|
|  | 0 jún 21  | 5309 | ||
|  | 0 aug 18  | 4957 | ||
|  | 1 jún 21  | 5028 | ||
|  | 1 mar 15  | 7084 | ||
|  | 0 máj 23  | 2850 | 
