summaryrefslogtreecommitdiff
path: root/indoteknik_api/models
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-07-10 10:23:29 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-07-10 10:23:29 +0700
commit87a35cbd4d15b39537c5c3287900b17fa9f30a93 (patch)
tree6efcec6d61139613b8a7a46746de669a3b7c98ef /indoteknik_api/models
parent0237b0954d14a844203d62933d2d9f1f0b8c7bba (diff)
add product_reject_line to detail sale order
Diffstat (limited to 'indoteknik_api/models')
-rw-r--r--indoteknik_api/models/sale_order.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/indoteknik_api/models/sale_order.py b/indoteknik_api/models/sale_order.py
index 88dc331f..0a16f0f8 100644
--- a/indoteknik_api/models/sale_order.py
+++ b/indoteknik_api/models/sale_order.py
@@ -65,6 +65,7 @@ class SaleOrder(models.Model):
data_with_detail = {
'payment_term': sale_order.payment_term_id.name or '',
'products': [],
+ 'products_reject_line': [],
'delivery_amount': sale_order.delivery_amt or 0,
'address': {
'site_partner': sale_order.partner_id.site_id.name,
@@ -87,6 +88,9 @@ class SaleOrder(models.Model):
for invoice in sale_order.invoice_ids:
if invoice.state == 'posted':
data_with_detail['invoices'].append(self.env['account.move'].api_v1_single_response(invoice))
+ for reject in sale_order.reject_line:
+ if len(reject) > 0:
+ data_with_detail['products_reject_line'].append(self.env['product.product'].api_single_response(reject.product_id))
data.update(data_with_detail)
else:
data_with_detail = {