summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/procurement_monitoring_detail.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-08-23 11:59:53 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-08-23 11:59:53 +0700
commita4352ddc19c392e0ed5f30d350ce928d98f5b6e2 (patch)
tree17d1efdf0c3a46f5db06ed469275963275a7496c /indoteknik_custom/models/procurement_monitoring_detail.py
parent40b3ae941bce5c822d7297c8ccfc1c752409e21c (diff)
mail po & note
Diffstat (limited to 'indoteknik_custom/models/procurement_monitoring_detail.py')
-rw-r--r--indoteknik_custom/models/procurement_monitoring_detail.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/indoteknik_custom/models/procurement_monitoring_detail.py b/indoteknik_custom/models/procurement_monitoring_detail.py
index 6031e04a..80e71304 100644
--- a/indoteknik_custom/models/procurement_monitoring_detail.py
+++ b/indoteknik_custom/models/procurement_monitoring_detail.py
@@ -22,6 +22,7 @@ class SaleMonitoringDetail(models.Model):
date_order = fields.Datetime(string="Date Order")
status = fields.Char(string="Status")
po_ids = fields.Many2many('purchase.order', string='PO', compute='_compute_po')
+ note = fields.Char(string="Note")
def _compute_po(self):
for line in self:
@@ -58,7 +59,8 @@ class SaleMonitoringDetail(models.Model):
get_qty_available(sol.product_id) as qty_available,
get_qty_reserved(so.id, sol.product_id) as qty_reserved,
get_qty_po(so.id, sol.product_id) AS qty_po,
- so.date_order AS date_order
+ so.date_order AS date_order,
+ sol.note_procurement as note
FROM sale_order so
JOIN sale_order_line sol ON sol.order_id = so.id
JOIN product_product p ON p.id = sol.product_id
@@ -66,7 +68,7 @@ class SaleMonitoringDetail(models.Model):
WHERE pt.type IN ('consu','product')
AND so.state IN ('sale','done')
AND so.create_date >= '2022-08-10'
- and so.so_status not in ('terproses')
+ and so.so_status not in('terproses')
) a
--where a.qty_po < a.qty_so
)