0

I'm trying to create an invoice using the request below. Q#1 Although I can see an invoice getting created on Odoo, the taxes are not applied. I can see that :

  1. the product from invoice line has taxes on it
  2. the fiscal position is configured correctly with the same tax applied

When I try to create an invoice manually, the tax is getting applied.

Q#2 Although I send 2 invoice lines, only 1 appears on Odoo

Q#3 Although discount_fixed is seen on the model, I only see % discount on Odoo invoice

{
"jsonrpc": "2.0",
"id": "",
"method": "call",
"params": {
    "service": "object",
    "method": "execute",
    "args": [
        "{{databaseName}}",
        {{userId}},
        "{{password}}",
        "account.move",
        "create",
        {
            "name": "Test Create Invoice 1",
            "state": "draft",
            "currency_id": 2,
            "create_uid": {{userId}},
            "partner_id": 1,
            "company_id": 1,
            "journal_id": 1,
            "fiscal_position_id":1,
            "invoice_date": "2022-01-27",
            "invoice_date_due": "2022-05-27",
            "move_type": "out_invoice",
            "type_name": "Invoice",
            "invoice_line_ids": [[0, "_", {
                "sequence": 1,
                "product_id": 1,
                "company_id": 1,
                "account_id": 1,
                "analytic_account_id": 1,
                "analytic_segment_one_id": 1,
                "name": "Test Invoice Line",
                "quantity": 1,
                "price_unit": 50,
                "discount_fixed": 10
            }],[0, "_", {
                "sequence": 2,
                "product_id": 2,
                "company_id": 1,
                "account_id": 2,
                "analytic_account_id": 2,
                "analytic_segment_one_id": 2,
                "name": "Test Invoice Line",
                "quantity": 2,
                "price_unit": 10,
                "discount_fixed": 10
            }]]
        }
    ]
}
}
Tiya
  • 553
  • 8
  • 26

1 Answers1

0

A#1: onchange('product_id') method apply taxes, I recommends you to create your own method in order to achieve this behaviour: Create in memory invoice, call onchange and then create.

A#2: You sould sent a list of dict, every element its and invoice.

A#3: The A#1 could help you here too.

I hope this answer can be helpful for you.

Juan Salcedo
  • 1,598
  • 1
  • 16
  • 28