From cbcf8d34bdc4d0ac2c47184dc46a3393d43bf145 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 15 Aug 2022 18:35:48 +0700 Subject: add sum_sale_monitoring --- .gitignore | 0 indoteknik_custom/__init__.py | 0 indoteknik_custom/__manifest__.py | 0 indoteknik_custom/models/__init__.py | 0 indoteknik_custom/models/coupon_program.py | 0 indoteknik_custom/models/crm_lead.py | 0 .../models/product_public_category.py | 0 indoteknik_custom/models/product_template.py | 0 indoteknik_custom/models/purchase_order.py | 0 indoteknik_custom/models/purchase_order_line.py | 0 indoteknik_custom/models/purchase_pricelist.py | 0 indoteknik_custom/models/res_users.py | 0 indoteknik_custom/models/sale_monitoring.py | 0 indoteknik_custom/models/stock_vendor.py | 0 indoteknik_custom/models/sum_sale_monitoring.py | 32 ++++++++++++++++++++++ indoteknik_custom/models/user_activity_log.py | 0 indoteknik_custom/models/x_banner_banner.py | 0 indoteknik_custom/models/x_banner_category.py | 0 indoteknik_custom/models/x_biaya_kirim.py | 0 indoteknik_custom/models/x_manufactures.py | 0 .../models/x_partner_purchase_order.py | 0 indoteknik_custom/models/x_product_tags.py | 0 indoteknik_custom/report/report.xml | 0 indoteknik_custom/report/report_banner_banner.xml | 0 indoteknik_custom/report/report_banner_banner2.xml | 0 indoteknik_custom/security/ir.model.access.csv | 0 indoteknik_custom/views/coupon_program.xml | 0 indoteknik_custom/views/crm_lead.xml | 0 .../views/product_public_category.xml | 0 indoteknik_custom/views/product_template.xml | 0 indoteknik_custom/views/purchase_order.xml | 0 indoteknik_custom/views/purchase_pricelist.xml | 0 indoteknik_custom/views/sale_monitoring.xml | 0 indoteknik_custom/views/stock_vendor.xml | 0 indoteknik_custom/views/user_activity_log.xml | 0 indoteknik_custom/views/vit_kecamatan.xml | 0 indoteknik_custom/views/vit_kelurahan.xml | 0 indoteknik_custom/views/vit_kota.xml | 0 indoteknik_custom/views/x_banner_banner.xml | 0 indoteknik_custom/views/x_banner_category.xml | 0 indoteknik_custom/views/x_biaya_kirim.xml | 0 indoteknik_custom/views/x_manufactures.xml | 0 .../views/x_partner_purchase_order.xml | 0 indoteknik_custom/views/x_product_tags.xml | 0 44 files changed, 32 insertions(+) mode change 100644 => 100755 .gitignore mode change 100644 => 100755 indoteknik_custom/__init__.py mode change 100644 => 100755 indoteknik_custom/__manifest__.py mode change 100644 => 100755 indoteknik_custom/models/__init__.py mode change 100644 => 100755 indoteknik_custom/models/coupon_program.py mode change 100644 => 100755 indoteknik_custom/models/crm_lead.py mode change 100644 => 100755 indoteknik_custom/models/product_public_category.py mode change 100644 => 100755 indoteknik_custom/models/product_template.py mode change 100644 => 100755 indoteknik_custom/models/purchase_order.py mode change 100644 => 100755 indoteknik_custom/models/purchase_order_line.py mode change 100644 => 100755 indoteknik_custom/models/purchase_pricelist.py mode change 100644 => 100755 indoteknik_custom/models/res_users.py mode change 100644 => 100755 indoteknik_custom/models/sale_monitoring.py mode change 100644 => 100755 indoteknik_custom/models/stock_vendor.py create mode 100755 indoteknik_custom/models/sum_sale_monitoring.py mode change 100644 => 100755 indoteknik_custom/models/user_activity_log.py mode change 100644 => 100755 indoteknik_custom/models/x_banner_banner.py mode change 100644 => 100755 indoteknik_custom/models/x_banner_category.py mode change 100644 => 100755 indoteknik_custom/models/x_biaya_kirim.py mode change 100644 => 100755 indoteknik_custom/models/x_manufactures.py mode change 100644 => 100755 indoteknik_custom/models/x_partner_purchase_order.py mode change 100644 => 100755 indoteknik_custom/models/x_product_tags.py mode change 100644 => 100755 indoteknik_custom/report/report.xml mode change 100644 => 100755 indoteknik_custom/report/report_banner_banner.xml mode change 100644 => 100755 indoteknik_custom/report/report_banner_banner2.xml mode change 100644 => 100755 indoteknik_custom/security/ir.model.access.csv mode change 100644 => 100755 indoteknik_custom/views/coupon_program.xml mode change 100644 => 100755 indoteknik_custom/views/crm_lead.xml mode change 100644 => 100755 indoteknik_custom/views/product_public_category.xml mode change 100644 => 100755 indoteknik_custom/views/product_template.xml mode change 100644 => 100755 indoteknik_custom/views/purchase_order.xml mode change 100644 => 100755 indoteknik_custom/views/purchase_pricelist.xml mode change 100644 => 100755 indoteknik_custom/views/sale_monitoring.xml mode change 100644 => 100755 indoteknik_custom/views/stock_vendor.xml mode change 100644 => 100755 indoteknik_custom/views/user_activity_log.xml mode change 100644 => 100755 indoteknik_custom/views/vit_kecamatan.xml mode change 100644 => 100755 indoteknik_custom/views/vit_kelurahan.xml mode change 100644 => 100755 indoteknik_custom/views/vit_kota.xml mode change 100644 => 100755 indoteknik_custom/views/x_banner_banner.xml mode change 100644 => 100755 indoteknik_custom/views/x_banner_category.xml mode change 100644 => 100755 indoteknik_custom/views/x_biaya_kirim.xml mode change 100644 => 100755 indoteknik_custom/views/x_manufactures.xml mode change 100644 => 100755 indoteknik_custom/views/x_partner_purchase_order.xml mode change 100644 => 100755 indoteknik_custom/views/x_product_tags.xml diff --git a/.gitignore b/.gitignore old mode 100644 new mode 100755 diff --git a/indoteknik_custom/__init__.py b/indoteknik_custom/__init__.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/coupon_program.py b/indoteknik_custom/models/coupon_program.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/product_public_category.py b/indoteknik_custom/models/product_public_category.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/stock_vendor.py b/indoteknik_custom/models/stock_vendor.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/sum_sale_monitoring.py b/indoteknik_custom/models/sum_sale_monitoring.py new file mode 100755 index 00000000..bb392bcf --- /dev/null +++ b/indoteknik_custom/models/sum_sale_monitoring.py @@ -0,0 +1,32 @@ +from odoo import fields, models, api, tools + +class SumSaleMonitoring(models.Model): + _name = 'sum.sale.monitoring' + _auto = False + _rec_name = 'sale_order_id' + + date_order = fields.Datetime(string="Date Order") + sale_order_id = fields.Many2one("sale.order", string="Sale Order") + qty_so = fields.Integer(string="Qty SO") + qty_po = fields.Integer(string="Qty PO") + qty_po_received = fields.Integer(string="Qty PO Received") + qty_so_delivered = fields.Integer(string="Qty SO Delivered") + qty_so_invoiced = fields.Integer(string="Qty SO Invoiced") + status = fields.Char(string="Status") + + def init(self): + tools.drop_view_if_exists(self.env.cr, self._table) + self.env.cr.execute(""" + select sm.date_order, sm.sale_order_id, sum(sm.qty_so) as qty_so, sum(sm.qty_po) as qty_po, + sum(sm.qty_po_received) as qty_received, sum(sm.qty_so_delivered) as qty_delivered, sum(sm.qty_so_invoiced) as qty_invoiced, + case + when sum(qty_po) <> sum(qty_so) and sum(qty_po) <= 0 then 'Belum PO sama sekali' + when sum(qty_po) <> sum(qty_so) then 'Belum PO full' + when sum(qty_po_received) <> sum(qty_po) and sum(qty_po_received) <= 0 then 'Belum Received sama sekali' + when sum(qty_po_received) <> sum(qty_po) then 'Belum Received full' + when sum(qty_so_delivered) <> sum(qty_so) and sum(qty_so_delivered) <= 0 then 'SIAP KIRIM' + when sum(qty_so_delivered) <> sum(qty_so) then 'KIRIM SISANYA' + else 'Belum Invoiced' end as status + from sale_monitoring sm + group by sm.date_order, sm.sale_order_id + """ % self._table) \ No newline at end of file diff --git a/indoteknik_custom/models/user_activity_log.py b/indoteknik_custom/models/user_activity_log.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_banner_banner.py b/indoteknik_custom/models/x_banner_banner.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_banner_category.py b/indoteknik_custom/models/x_banner_category.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_biaya_kirim.py b/indoteknik_custom/models/x_biaya_kirim.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_manufactures.py b/indoteknik_custom/models/x_manufactures.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_partner_purchase_order.py b/indoteknik_custom/models/x_partner_purchase_order.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/models/x_product_tags.py b/indoteknik_custom/models/x_product_tags.py old mode 100644 new mode 100755 diff --git a/indoteknik_custom/report/report.xml b/indoteknik_custom/report/report.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/report/report_banner_banner.xml b/indoteknik_custom/report/report_banner_banner.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/report/report_banner_banner2.xml b/indoteknik_custom/report/report_banner_banner2.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/coupon_program.xml b/indoteknik_custom/views/coupon_program.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/crm_lead.xml b/indoteknik_custom/views/crm_lead.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/product_public_category.xml b/indoteknik_custom/views/product_public_category.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/product_template.xml b/indoteknik_custom/views/product_template.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/purchase_pricelist.xml b/indoteknik_custom/views/purchase_pricelist.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/sale_monitoring.xml b/indoteknik_custom/views/sale_monitoring.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/stock_vendor.xml b/indoteknik_custom/views/stock_vendor.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/user_activity_log.xml b/indoteknik_custom/views/user_activity_log.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/vit_kecamatan.xml b/indoteknik_custom/views/vit_kecamatan.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/vit_kelurahan.xml b/indoteknik_custom/views/vit_kelurahan.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/vit_kota.xml b/indoteknik_custom/views/vit_kota.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_banner_banner.xml b/indoteknik_custom/views/x_banner_banner.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_banner_category.xml b/indoteknik_custom/views/x_banner_category.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_biaya_kirim.xml b/indoteknik_custom/views/x_biaya_kirim.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_manufactures.xml b/indoteknik_custom/views/x_manufactures.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_partner_purchase_order.xml b/indoteknik_custom/views/x_partner_purchase_order.xml old mode 100644 new mode 100755 diff --git a/indoteknik_custom/views/x_product_tags.xml b/indoteknik_custom/views/x_product_tags.xml old mode 100644 new mode 100755 -- cgit v1.2.3