diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-11-29 10:53:34 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-11-29 10:53:34 +0700 |
| commit | 57ea4bce8d785ba47a12ce0b3808a7d45e4add54 (patch) | |
| tree | 292e1d78e935145b7d9a555a6512a963fcf323a5 /indoteknik_api/models/sale_order.py | |
| parent | c5d2edf1a1e905d270e5cd1e5b6ed0cb5fa0bba1 (diff) | |
| parent | 301ad8d828e5ff43515b9f1ab467c9082fccd6f7 (diff) | |
Merge branch 'production' into iman/pengajuan-tempo
# Conflicts:
# indoteknik_custom/__manifest__.py
# indoteknik_custom/models/res_partner.py
# indoteknik_custom/security/ir.model.access.csv
Diffstat (limited to 'indoteknik_api/models/sale_order.py')
| -rw-r--r-- | indoteknik_api/models/sale_order.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/indoteknik_api/models/sale_order.py b/indoteknik_api/models/sale_order.py index 54e1fd40..727379c5 100644 --- a/indoteknik_api/models/sale_order.py +++ b/indoteknik_api/models/sale_order.py @@ -39,6 +39,8 @@ class SaleOrder(models.Model): data['status'] = 'cancel' if sale_order.state in ['draft', 'sent']: data['status'] = 'draft' + if sale_order.is_continue_transaction: + data['status'] = 'waiting' if sale_order.approval_status in ['pengajuan1', 'pengajuan2']: data['status'] = 'waiting' if sale_order.state == 'sale': @@ -85,6 +87,11 @@ class SaleOrder(models.Model): } product['quantity'] = line.product_uom_qty product['available_quantity'] = line.product_available_quantity + for data_v2 in sale_order.fulfillment_line_v2: + product_v2 = self.env['product.product'].api_single_response(data_v2.product_id) + if product['id'] == product_v2['id']: + product['so_qty'] = data_v2.so_qty + product['reserved_stock_qty'] = data_v2.reserved_stock_qty data_with_detail['products'].append(product) for invoice in sale_order.invoice_ids: if invoice.state == 'posted': |
