From a8ea5407be21c56fb29b63de08b40b92a887fa26 Mon Sep 17 00:00:00 2001 From: IT Fixcomart Date: Tue, 16 Aug 2022 15:30:18 +0700 Subject: Membuat fields image_128 di x_manufacture --- indoteknik_custom/models/x_manufactures.py | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/models/x_manufactures.py b/indoteknik_custom/models/x_manufactures.py index 8aff7f26..e07f724e 100755 --- a/indoteknik_custom/models/x_manufactures.py +++ b/indoteknik_custom/models/x_manufactures.py @@ -9,6 +9,7 @@ class XManufactures(models.Model): x_name = fields.Char(string="Name") x_description = fields.Html(string="Description") x_logo_manufacture = fields.Binary(string="Logo Manufacture") + x_logo_manufacture_128 = fields.Image("Image 128", related="x_logo_manufacture", max_width=128, max_height=128, store=True) x_manufacture_level = fields.Selection([ ('prioritas', 'Prioritas'), ('gold', 'Gold'), -- cgit v1.2.3 From 77abcebaa3c7532107c4dd3ba3854b25a3dc03e3 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 22 Aug 2022 14:10:16 +0700 Subject: add customer and salesperson in sale order monitoring --- indoteknik_custom/models/sale_monitoring.py | 8 ++++++-- indoteknik_custom/models/sale_monitoring_detail.py | 6 +++++- indoteknik_custom/views/sale_monitoring.xml | 4 ++++ indoteknik_custom/views/sale_monitoring_detail.xml | 4 ++++ 4 files changed, 19 insertions(+), 3 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) diff --git a/indoteknik_custom/models/sale_monitoring_detail.py b/indoteknik_custom/models/sale_monitoring_detail.py index ec9fe222..cb412c98 100755 --- a/indoteknik_custom/models/sale_monitoring_detail.py +++ b/indoteknik_custom/models/sale_monitoring_detail.py @@ -8,6 +8,8 @@ class SaleMonitoringDetail(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") product_id = fields.Many2one("product.product", string="Product") qty_so = fields.Integer(string="Qty SO") qty_po = fields.Integer(string="Qty PO") @@ -36,7 +38,9 @@ class SaleMonitoringDetail(models.Model): ( SELECT p.id AS id, - so.id AS sale_order_id, + so.id AS sale_order_id, + so.partner_id as partner_id, + so.user_id, p.id AS product_id, sol.product_uom_qty AS qty_so, sol.qty_delivered AS qty_so_delivered, diff --git a/indoteknik_custom/views/sale_monitoring.xml b/indoteknik_custom/views/sale_monitoring.xml index 15b55e2e..e4139677 100755 --- a/indoteknik_custom/views/sale_monitoring.xml +++ b/indoteknik_custom/views/sale_monitoring.xml @@ -7,6 +7,8 @@ + + @@ -32,6 +34,8 @@ + + + + @@ -33,6 +35,8 @@ + +