Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
4099 Lượt xem

Hello everyone,

I'm using Odoo 8 (but I cannot access the code, so I cannot debug) and I'm connecting to its API through an app written in ruby. I'm able to create an order sale and confirm it but I cannot convert it into an invoice.

Here an example of my code, it's ruby but is not important for what I would ask.

#this is a wrapper to be more DRY and avoid to repeat code for every call
 def execute_odoo_command(odoo_model, odoo_command, values)
    @models.execute_kw(ODOO_DB, @uid, ODOO_PASSWORD, odoo_model, odoo_command, values)
  end

    invoice_values = { advance_payment_method: 'lines', active_ids: [odoo_order_lines] }

execute_odoo_command('sale.advance.payment.inv', 'create_invoices', [invoice_values])

I'm sure the wrapper works because I'm able to create order_sales and confirm them (moreover I use it somewhere else and everything goes well)I deduce that the mistake is in the way I pass the invoice_values to create_invoice, so my question is the following: which params and how structured I should pass to create_invoices to be able to convert a confirmed order sale into an invoice?

Thank you for your help


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

It should be dictionary with all required fields of invoice.

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

I'm having the exact same problem. Have you managed to get this working

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 2 22
5499
2
thg 9 15
4575
0
thg 5 15
3088
2
thg 11 23
18608
1
thg 12 17
3599