summaryrefslogtreecommitdiff
path: root/indoteknik_api/controllers/api_v1
diff options
context:
space:
mode:
Diffstat (limited to 'indoteknik_api/controllers/api_v1')
-rw-r--r--indoteknik_api/controllers/api_v1/product.py5
-rw-r--r--indoteknik_api/controllers/api_v1/promotion.py30
-rw-r--r--indoteknik_api/controllers/api_v1/sale_order.py1
3 files changed, 35 insertions, 1 deletions
diff --git a/indoteknik_api/controllers/api_v1/product.py b/indoteknik_api/controllers/api_v1/product.py
index ce0ca406..e779e623 100644
--- a/indoteknik_api/controllers/api_v1/product.py
+++ b/indoteknik_api/controllers/api_v1/product.py
@@ -48,7 +48,10 @@ class Product(controller.Controller):
('write_date', '>=', date_7_days_ago.strftime("%Y-%m-%d %H:%M:%S"))
], limit=1)
- qty_available = product.qty_onhand_bandengan
+ qty_available = product.qty_free_bandengan
+
+ if qty_available < 0:
+ qty_available = 0
qty = 0
sla_date = '-'
diff --git a/indoteknik_api/controllers/api_v1/promotion.py b/indoteknik_api/controllers/api_v1/promotion.py
index 221f6e10..61d06b28 100644
--- a/indoteknik_api/controllers/api_v1/promotion.py
+++ b/indoteknik_api/controllers/api_v1/promotion.py
@@ -28,6 +28,36 @@ class Promotion(controller.Controller):
'remaining_qty': remaining_qty,
'used_percentage': percent_remaining,
})
+
+ # @http.route(prefix + 'program-line', auth='public', methods=['GET', 'OPTIONS'])
+ # @controller.Controller.must_authorized()
+ # def get_promotion_type(self, **kw):
+ # type = kw.get('type')
+ # domain = [("active", "=", True)]
+ # if type:
+ # domain.append(("promotion_type", "=", type))
+
+ # program_lines = request.env['promotion.program.line'].search(domain, limit=100)
+
+ # data = [{
+ # 'id': line.id,
+ # 'name': line.name,
+ # 'program': line.program_id.name,
+ # 'promotion_type': line.promotion_type,
+ # 'active': line.active,
+ # 'description': line.description,
+ # 'package_limit': line.package_limit,
+ # 'package_limit_user': line.package_limit_user,
+ # 'package_limit_trx': line.package_limit_trx,
+ # 'price': line.price,
+ # 'products': [{
+ # 'id': product.product_id.id,
+ # 'name': product.product_id.name,
+ # 'qty': product.qty
+ # } for product in line.product_ids]
+ # } for line in program_lines]
+
+ # return self.response(data)
@http.route(prefix + 'promotion/<id>', auth='public', methods=['GET'])
diff --git a/indoteknik_api/controllers/api_v1/sale_order.py b/indoteknik_api/controllers/api_v1/sale_order.py
index 948ecd03..f17e736f 100644
--- a/indoteknik_api/controllers/api_v1/sale_order.py
+++ b/indoteknik_api/controllers/api_v1/sale_order.py
@@ -355,6 +355,7 @@ class SaleOrder(controller.Controller):
'partner_shipping_id': params['value']['partner_shipping_id'],
'real_shipping_id': params['value']['partner_shipping_id'],
'partner_invoice_id': params['value']['partner_invoice_id'],
+ 'real_invoice_id': params['value']['partner_invoice_id'],
'partner_purchase_order_name': params['value']['po_number'],
'partner_purchase_order_file': params['value']['po_file'],
'delivery_amt': params['value']['delivery_amount'],