summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/sale_monitoring.py
diff options
context:
space:
mode:
authorIT Fixcomart <it@fixcomart.co.id>2022-08-23 09:29:19 +0700
committerIT Fixcomart <it@fixcomart.co.id>2022-08-23 09:29:19 +0700
commitc369d67e08b50350705011e01b3f5ec78dcb7d11 (patch)
treeff62225d7d409a2dc7c62f12a3be8944d4247649 /indoteknik_custom/models/sale_monitoring.py
parent055e68b5c1c20795c569d67d6bf7363c90182470 (diff)
parent2d82c8d8baf38be2349a87c9f8e9919c9e9de78a (diff)
Merge branch 'development' of bitbucket.org:altafixco/indoteknik-addons into development
# Conflicts: # indoteknik_custom/models/__init__.py
Diffstat (limited to 'indoteknik_custom/models/sale_monitoring.py')
-rwxr-xr-xindoteknik_custom/models/sale_monitoring.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py
index 70c51132..97e96e72 100755
--- a/indoteknik_custom/models/sale_monitoring.py
+++ b/indoteknik_custom/models/sale_monitoring.py
@@ -8,6 +8,8 @@ class SaleMonitoring(models.Model):
id = fields.Integer()
sale_order_id = fields.Many2one("sale.order", string="Sale Order")
+ partner_id = fields.Many2one("res.partner", string="Customer")
+ user_id = fields.Many2one("res.users", string="Salesperson")
qty_so = fields.Integer(string="Qty SO")
qty_po = fields.Integer(string="Qty PO")
qty_po_received = fields.Integer(string="Qty PO Received")
@@ -23,7 +25,9 @@ class SaleMonitoring(models.Model):
SELECT
smd.sale_order_id AS id,
smd.date_order,
- smd.sale_order_id,
+ smd.sale_order_id,
+ smd.partner_id,
+ smd.user_id,
SUM(smd.qty_so) AS qty_so,
SUM(smd.qty_po) AS qty_po,
SUM(smd.qty_po_received) AS qty_po_received,
@@ -39,6 +43,6 @@ class SaleMonitoring(models.Model):
ELSE 'Belum Invoiced'
END AS status
FROM sale_monitoring_detail smd
- GROUP BY smd.date_order, smd.sale_order_id
+ GROUP BY smd.date_order, smd.sale_order_id, smd.partner_id, smd.user_id
)
""" % self._table)