diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-28 16:35:49 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-03-28 16:35:49 +0700 |
| commit | 60d0b36cf33785c0cf6bea1d10b344dcdb37695a (patch) | |
| tree | 7dfaea6f94277c94a3308cfecf0d4dcee015ab41 /indoteknik_api/controllers/api_v1 | |
| parent | d9f3333103ff3190c4c6ccf2365ccbb41cdb16b4 (diff) | |
fix API get transaction, invoice
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/manufacture.py | 2 | ||||
| -rw-r--r-- | indoteknik_api/controllers/api_v1/sale_order.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/indoteknik_api/controllers/api_v1/manufacture.py b/indoteknik_api/controllers/api_v1/manufacture.py index e49872be..345fd660 100644 --- a/indoteknik_api/controllers/api_v1/manufacture.py +++ b/indoteknik_api/controllers/api_v1/manufacture.py @@ -32,7 +32,7 @@ class Manufacture(controller.Controller): 'manufactures': [request.env['x_manufactures'].api_single_response(x) for x in manufactures] } - return self.response(data) + return self.response(data, headers=[('Cache-Control', 'max-age=3600, public')]) @http.route(prefix + 'manufacture/<id>', auth='public', methods=['GET', 'OPTIONS']) @controller.Controller.must_authorized() diff --git a/indoteknik_api/controllers/api_v1/sale_order.py b/indoteknik_api/controllers/api_v1/sale_order.py index 34583c37..76fbfddb 100644 --- a/indoteknik_api/controllers/api_v1/sale_order.py +++ b/indoteknik_api/controllers/api_v1/sale_order.py @@ -253,14 +253,14 @@ class SaleOrder(controller.Controller): order_line = json.loads(params['value']['order_line']) parameters = [] for line in order_line: - price = request.env['product.pricelist'].compute_price(product_pricelist_default_discount_id, line['product_id']) + product = request.env['product.product'].search([('id', '=', line['product_id'])], limit=1) parameters.append({ 'company_id': 1, 'order_id': sale_order.id, 'product_id': line['product_id'], 'product_uom_qty': line['quantity'], - 'price_subtotal': price['price'], - 'discount': price['discount_percentage'] + 'price_subtotal': product._get_website_price_exclude_tax(), + 'discount': product._get_website_disc(0) }) request.env['sale.order.line'].create(parameters) return self.response({ |
