Zum Inhalt springen
Menü
Sie müssen registriert sein, um mit der Community zu interagieren.
Diese Frage wurde gekennzeichnet
5583 Ansichten

I'm creating new sales quotes programatically through the Odoo API like so:

    final Object orderLineItem = asList((Object[]) models.execute("execute_kw", asList(
        db, uid, password,
        "sale.order.line", "search",
        asList(asList()),
        new HashMap() {{
          put("limit", 10);
        }})
      )).get(0);
    final Integer id = (Integer) models.execute("execute_kw", asList(
        db, uid, password,
        "sale.order", "create",
        asList(new HashMap() {{
          put("currency_id", resCurrency);
          put("date_order", dateTime);
          put("partner_id", resPartnerId);
          put("picking_policy", "");
          put("pricelist_id", productPricelistId);
          put("name", name);
          put("warehouse_id", stockWarehouseId);
          put("partner_invoice_id", resPartnerId);
          put("partner_shipping_id", resPartnerId);
          put("access_token", "");
          put("order_line", asList(
            asList(1, false, new HashMap<String, Object>() {{
              put("product_id", orderLineItem);
            }})));
        }})
      ));


However, I'm unable to list products in the quotation's order_line section. Order_line has a one to many relation, but I'm not sure if thats a relationship to products that can be sold to a customer, or something entirely different.

I know the the sale.order.line resources contains all of my 'order_lines' or products, but I'm not sure how to add these products to a new sales quote.

Any help in Java or a python equivalent would be greatly appreciated.

Avatar
Verwerfen
Verknüpfte Beiträge Antworten Ansichten Aktivität
2
Dez. 24
2101
1
Juni 24
2029
1
Feb. 22
3916
1
Feb. 22
6796
0
Nov. 21
4324