diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-12-04 11:24:24 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-12-04 11:24:24 +0700 |
| commit | 1094670e6fc35e5150b612b32e1f497b36c022b3 (patch) | |
| tree | 4482491680db1554c28fb380480ada5282fac8f0 /indoteknik_api/controllers/api_v1/sale_order.py | |
| parent | c631620706a24426faea6b43c2a0602eebf9a5e4 (diff) | |
| parent | dbe24b9cd600c7b5a9d0587f80a782ed93c9a761 (diff) | |
Merge branch 'production' into iman/telegram
# Conflicts:
# indoteknik_custom/models/__init__.py
# indoteknik_custom/models/stock_picking.py
Diffstat (limited to 'indoteknik_api/controllers/api_v1/sale_order.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/sale_order.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/indoteknik_api/controllers/api_v1/sale_order.py b/indoteknik_api/controllers/api_v1/sale_order.py index e7664c79..8b95ade8 100644 --- a/indoteknik_api/controllers/api_v1/sale_order.py +++ b/indoteknik_api/controllers/api_v1/sale_order.py @@ -150,7 +150,8 @@ class SaleOrder(controller.Controller): def partner_checkout_sale_order_by_id(self, **kw): params = self.get_request_params(kw, { 'partner_id': ['number'], - 'id': ['number'] + 'id': ['number'], + 'status': ['boolean'] }) if not params['valid']: return self.response(code=400, description=params) @@ -163,6 +164,9 @@ class SaleOrder(controller.Controller): data = {} sale_order = request.env['sale.order'].search(domain) if sale_order: + if 'status' in params['value']: + sale_order.is_continue_transaction = params['value']['status'] + if sale_order._requires_approval_margin_leader(): sale_order.approval_status = 'pengajuan2' elif sale_order._requires_approval_margin_manager(): @@ -446,7 +450,8 @@ class SaleOrder(controller.Controller): 'company_id': 1, 'order_id': sale_order.id, 'product_id': cart['id'], - 'product_uom_qty': cart['quantity'] + 'product_uom_qty': cart['quantity'], + 'product_available_quantity': cart['available_quantity'] }) order_line.product_id_change() order_line.onchange_vendor_id() @@ -463,6 +468,7 @@ class SaleOrder(controller.Controller): if len(promotions) > 0: sale_order.apply_promotion_program() + sale_order.add_free_product(promotions) voucher_code = params['value']['voucher'] voucher = request.env['voucher'].search([('code', '=', voucher_code),('apply_type', 'in', ['all', 'brand'])], limit=1) |
