diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-08-15 18:35:48 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-08-15 18:35:48 +0700 |
| commit | cbcf8d34bdc4d0ac2c47184dc46a3393d43bf145 (patch) | |
| tree | 99eeb9932968207f651fff58db84a08e3fa478d5 | |
| parent | 3ea9850077463648743e0ae87966687dd63c378e (diff) | |
add sum_sale_monitoring
44 files changed, 32 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index b24d71e2..b24d71e2 100644..100755 --- a/.gitignore +++ b/.gitignore diff --git a/indoteknik_custom/__init__.py b/indoteknik_custom/__init__.py index 9a7e03ed..9a7e03ed 100644..100755 --- a/indoteknik_custom/__init__.py +++ b/indoteknik_custom/__init__.py diff --git a/indoteknik_custom/__manifest__.py b/indoteknik_custom/__manifest__.py index d18f1582..d18f1582 100644..100755 --- a/indoteknik_custom/__manifest__.py +++ b/indoteknik_custom/__manifest__.py diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py index 03b01fc4..03b01fc4 100644..100755 --- a/indoteknik_custom/models/__init__.py +++ b/indoteknik_custom/models/__init__.py diff --git a/indoteknik_custom/models/coupon_program.py b/indoteknik_custom/models/coupon_program.py index 4c839c9f..4c839c9f 100644..100755 --- a/indoteknik_custom/models/coupon_program.py +++ b/indoteknik_custom/models/coupon_program.py diff --git a/indoteknik_custom/models/crm_lead.py b/indoteknik_custom/models/crm_lead.py index 15ec4119..15ec4119 100644..100755 --- a/indoteknik_custom/models/crm_lead.py +++ b/indoteknik_custom/models/crm_lead.py diff --git a/indoteknik_custom/models/product_public_category.py b/indoteknik_custom/models/product_public_category.py index bb661772..bb661772 100644..100755 --- a/indoteknik_custom/models/product_public_category.py +++ b/indoteknik_custom/models/product_public_category.py diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 348bda99..348bda99 100644..100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 2c589d36..2c589d36 100644..100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py diff --git a/indoteknik_custom/models/purchase_order_line.py b/indoteknik_custom/models/purchase_order_line.py index 74b46e4c..74b46e4c 100644..100755 --- a/indoteknik_custom/models/purchase_order_line.py +++ b/indoteknik_custom/models/purchase_order_line.py diff --git a/indoteknik_custom/models/purchase_pricelist.py b/indoteknik_custom/models/purchase_pricelist.py index 25e551ae..25e551ae 100644..100755 --- a/indoteknik_custom/models/purchase_pricelist.py +++ b/indoteknik_custom/models/purchase_pricelist.py diff --git a/indoteknik_custom/models/res_users.py b/indoteknik_custom/models/res_users.py index 16820952..16820952 100644..100755 --- a/indoteknik_custom/models/res_users.py +++ b/indoteknik_custom/models/res_users.py diff --git a/indoteknik_custom/models/sale_monitoring.py b/indoteknik_custom/models/sale_monitoring.py index 6fabb2df..6fabb2df 100644..100755 --- a/indoteknik_custom/models/sale_monitoring.py +++ b/indoteknik_custom/models/sale_monitoring.py diff --git a/indoteknik_custom/models/stock_vendor.py b/indoteknik_custom/models/stock_vendor.py index 78baf14c..78baf14c 100644..100755 --- a/indoteknik_custom/models/stock_vendor.py +++ b/indoteknik_custom/models/stock_vendor.py 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 index 558e5b5c..558e5b5c 100644..100755 --- a/indoteknik_custom/models/user_activity_log.py +++ b/indoteknik_custom/models/user_activity_log.py diff --git a/indoteknik_custom/models/x_banner_banner.py b/indoteknik_custom/models/x_banner_banner.py index a402789a..a402789a 100644..100755 --- a/indoteknik_custom/models/x_banner_banner.py +++ b/indoteknik_custom/models/x_banner_banner.py diff --git a/indoteknik_custom/models/x_banner_category.py b/indoteknik_custom/models/x_banner_category.py index 7c91bd78..7c91bd78 100644..100755 --- a/indoteknik_custom/models/x_banner_category.py +++ b/indoteknik_custom/models/x_banner_category.py diff --git a/indoteknik_custom/models/x_biaya_kirim.py b/indoteknik_custom/models/x_biaya_kirim.py index 5bf48c62..5bf48c62 100644..100755 --- a/indoteknik_custom/models/x_biaya_kirim.py +++ b/indoteknik_custom/models/x_biaya_kirim.py diff --git a/indoteknik_custom/models/x_manufactures.py b/indoteknik_custom/models/x_manufactures.py index 8aff7f26..8aff7f26 100644..100755 --- a/indoteknik_custom/models/x_manufactures.py +++ b/indoteknik_custom/models/x_manufactures.py diff --git a/indoteknik_custom/models/x_partner_purchase_order.py b/indoteknik_custom/models/x_partner_purchase_order.py index 6beca5df..6beca5df 100644..100755 --- a/indoteknik_custom/models/x_partner_purchase_order.py +++ b/indoteknik_custom/models/x_partner_purchase_order.py diff --git a/indoteknik_custom/models/x_product_tags.py b/indoteknik_custom/models/x_product_tags.py index dac7ffe1..dac7ffe1 100644..100755 --- a/indoteknik_custom/models/x_product_tags.py +++ b/indoteknik_custom/models/x_product_tags.py diff --git a/indoteknik_custom/report/report.xml b/indoteknik_custom/report/report.xml index 9524566c..9524566c 100644..100755 --- a/indoteknik_custom/report/report.xml +++ b/indoteknik_custom/report/report.xml diff --git a/indoteknik_custom/report/report_banner_banner.xml b/indoteknik_custom/report/report_banner_banner.xml index 4e51f0a2..4e51f0a2 100644..100755 --- a/indoteknik_custom/report/report_banner_banner.xml +++ b/indoteknik_custom/report/report_banner_banner.xml diff --git a/indoteknik_custom/report/report_banner_banner2.xml b/indoteknik_custom/report/report_banner_banner2.xml index 47e44045..47e44045 100644..100755 --- a/indoteknik_custom/report/report_banner_banner2.xml +++ b/indoteknik_custom/report/report_banner_banner2.xml diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 60667274..60667274 100644..100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv diff --git a/indoteknik_custom/views/coupon_program.xml b/indoteknik_custom/views/coupon_program.xml index e4ad0bd8..e4ad0bd8 100644..100755 --- a/indoteknik_custom/views/coupon_program.xml +++ b/indoteknik_custom/views/coupon_program.xml diff --git a/indoteknik_custom/views/crm_lead.xml b/indoteknik_custom/views/crm_lead.xml index 58c27050..58c27050 100644..100755 --- a/indoteknik_custom/views/crm_lead.xml +++ b/indoteknik_custom/views/crm_lead.xml diff --git a/indoteknik_custom/views/product_public_category.xml b/indoteknik_custom/views/product_public_category.xml index 858d7ada..858d7ada 100644..100755 --- a/indoteknik_custom/views/product_public_category.xml +++ b/indoteknik_custom/views/product_public_category.xml diff --git a/indoteknik_custom/views/product_template.xml b/indoteknik_custom/views/product_template.xml index 78aac34a..78aac34a 100644..100755 --- a/indoteknik_custom/views/product_template.xml +++ b/indoteknik_custom/views/product_template.xml diff --git a/indoteknik_custom/views/purchase_order.xml b/indoteknik_custom/views/purchase_order.xml index f209d18a..f209d18a 100644..100755 --- a/indoteknik_custom/views/purchase_order.xml +++ b/indoteknik_custom/views/purchase_order.xml diff --git a/indoteknik_custom/views/purchase_pricelist.xml b/indoteknik_custom/views/purchase_pricelist.xml index d6abcec1..d6abcec1 100644..100755 --- a/indoteknik_custom/views/purchase_pricelist.xml +++ b/indoteknik_custom/views/purchase_pricelist.xml diff --git a/indoteknik_custom/views/sale_monitoring.xml b/indoteknik_custom/views/sale_monitoring.xml index 275fd205..275fd205 100644..100755 --- a/indoteknik_custom/views/sale_monitoring.xml +++ b/indoteknik_custom/views/sale_monitoring.xml diff --git a/indoteknik_custom/views/stock_vendor.xml b/indoteknik_custom/views/stock_vendor.xml index ebf63a6a..ebf63a6a 100644..100755 --- a/indoteknik_custom/views/stock_vendor.xml +++ b/indoteknik_custom/views/stock_vendor.xml diff --git a/indoteknik_custom/views/user_activity_log.xml b/indoteknik_custom/views/user_activity_log.xml index db242505..db242505 100644..100755 --- a/indoteknik_custom/views/user_activity_log.xml +++ b/indoteknik_custom/views/user_activity_log.xml diff --git a/indoteknik_custom/views/vit_kecamatan.xml b/indoteknik_custom/views/vit_kecamatan.xml index 09ae6920..09ae6920 100644..100755 --- a/indoteknik_custom/views/vit_kecamatan.xml +++ b/indoteknik_custom/views/vit_kecamatan.xml diff --git a/indoteknik_custom/views/vit_kelurahan.xml b/indoteknik_custom/views/vit_kelurahan.xml index afbf84e0..afbf84e0 100644..100755 --- a/indoteknik_custom/views/vit_kelurahan.xml +++ b/indoteknik_custom/views/vit_kelurahan.xml diff --git a/indoteknik_custom/views/vit_kota.xml b/indoteknik_custom/views/vit_kota.xml index 97c7e66c..97c7e66c 100644..100755 --- a/indoteknik_custom/views/vit_kota.xml +++ b/indoteknik_custom/views/vit_kota.xml diff --git a/indoteknik_custom/views/x_banner_banner.xml b/indoteknik_custom/views/x_banner_banner.xml index f48b20c4..f48b20c4 100644..100755 --- a/indoteknik_custom/views/x_banner_banner.xml +++ b/indoteknik_custom/views/x_banner_banner.xml diff --git a/indoteknik_custom/views/x_banner_category.xml b/indoteknik_custom/views/x_banner_category.xml index 0c2e053d..0c2e053d 100644..100755 --- a/indoteknik_custom/views/x_banner_category.xml +++ b/indoteknik_custom/views/x_banner_category.xml diff --git a/indoteknik_custom/views/x_biaya_kirim.xml b/indoteknik_custom/views/x_biaya_kirim.xml index f8291b70..f8291b70 100644..100755 --- a/indoteknik_custom/views/x_biaya_kirim.xml +++ b/indoteknik_custom/views/x_biaya_kirim.xml diff --git a/indoteknik_custom/views/x_manufactures.xml b/indoteknik_custom/views/x_manufactures.xml index afecea9b..afecea9b 100644..100755 --- a/indoteknik_custom/views/x_manufactures.xml +++ b/indoteknik_custom/views/x_manufactures.xml diff --git a/indoteknik_custom/views/x_partner_purchase_order.xml b/indoteknik_custom/views/x_partner_purchase_order.xml index 4b858726..4b858726 100644..100755 --- a/indoteknik_custom/views/x_partner_purchase_order.xml +++ b/indoteknik_custom/views/x_partner_purchase_order.xml diff --git a/indoteknik_custom/views/x_product_tags.xml b/indoteknik_custom/views/x_product_tags.xml index 54378aee..54378aee 100644..100755 --- a/indoteknik_custom/views/x_product_tags.xml +++ b/indoteknik_custom/views/x_product_tags.xml |
