From a3c057d4ddf660ce1214b55c791fd436cc7a6100 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Tue, 12 Nov 2024 15:35:12 +0700 Subject: add new table of fulfillment v2 --- indoteknik_custom/models/sales_order_fullfillment.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/indoteknik_custom/models/sales_order_fullfillment.py b/indoteknik_custom/models/sales_order_fullfillment.py index ab416e8d..9e9457f1 100644 --- a/indoteknik_custom/models/sales_order_fullfillment.py +++ b/indoteknik_custom/models/sales_order_fullfillment.py @@ -6,6 +6,22 @@ import logging _logger = logging.getLogger(__name__) +class SalesOrderFullfillmentV2(models.Model): + _name = 'sales.order.fulfillment.v2' + + sale_order_id = fields.Many2one('sale.order', string='Sale Order') + sale_order_line_id = fields.Many2one('sale.order.line', string='Sale Order Line') + picking_id = fields.Many2one('stock.picking', string='Picking') + move_id = fields.Many2one('stock.move', string='Move') + move_line_id = fields.Many2one('stock.move.line', string='Move Line') + product_id = fields.Many2one('product.product', string='Product') + so_qty = fields.Float(string='SO Qty') + reserved_stock_qty = fields.Float(string='Reserved Stock Qty') + po_ids = fields.Many2many('purchase.order', string='Purchase Order') + po_qty = fields.Float(string='PO Qty', help='Totalan dari semua PO Outstanding') + received_qty = fields.Float(string='Received Qty', help='Totalan dari barang yang diterima dari PO tsb') + + class SalesOrderFullfillment(models.Model): _name = 'sales.order.fullfillment' -- cgit v1.2.3 From b44f26591a67b1a33132bcbcb9190920eb52e6f3 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 13 Nov 2024 09:04:27 +0700 Subject: view of fulfillment version 2 --- indoteknik_custom/models/sale_order.py | 9 +++++---- indoteknik_custom/models/sales_order_fullfillment.py | 5 +++-- indoteknik_custom/security/ir.model.access.csv | 1 + indoteknik_custom/views/sale_order.xml | 20 ++++++++++++++++++++ 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/indoteknik_custom/models/sale_order.py b/indoteknik_custom/models/sale_order.py index 5545e28c..31ea8902 100755 --- a/indoteknik_custom/models/sale_order.py +++ b/indoteknik_custom/models/sale_order.py @@ -11,6 +11,7 @@ _logger = logging.getLogger(__name__) class SaleOrder(models.Model): _inherit = "sale.order" + fulfillment_line_v2 = fields.One2many('sales.order.fulfillment.v2', 'sale_order_id', string='Fullfillment2') fullfillment_line = fields.One2many('sales.order.fullfillment', 'sales_order_id', string='Fullfillment') reject_line = fields.One2many('sales.order.reject', 'sale_order_id', string='Reject Lines') order_sales_match_line = fields.One2many('sales.order.purchase.match', 'sales_order_id', string='Purchase Match Lines', states={'cancel': [('readonly', True)], 'done': [('readonly', True)]}, copy=True) @@ -346,10 +347,10 @@ class SaleOrder(models.Model): def _compute_fullfillment(self): for rec in self: - rec.fullfillment_line.unlink() - - for line in rec.order_line: - line._compute_reserved_from() + # rec.fullfillment_line.unlink() + # + # for line in rec.order_line: + # line._compute_reserved_from() rec.compute_fullfillment = True diff --git a/indoteknik_custom/models/sales_order_fullfillment.py b/indoteknik_custom/models/sales_order_fullfillment.py index 9e9457f1..42544c15 100644 --- a/indoteknik_custom/models/sales_order_fullfillment.py +++ b/indoteknik_custom/models/sales_order_fullfillment.py @@ -16,8 +16,9 @@ class SalesOrderFullfillmentV2(models.Model): move_line_id = fields.Many2one('stock.move.line', string='Move Line') product_id = fields.Many2one('product.product', string='Product') so_qty = fields.Float(string='SO Qty') - reserved_stock_qty = fields.Float(string='Reserved Stock Qty') - po_ids = fields.Many2many('purchase.order', string='Purchase Order') + reserved_stock_qty = fields.Float(string='Reserved Stock Qty', help='Sudah ter-reserved oleh sistem') + delivered_qty = fields.Float(string='Delivered Qty', help='Yang sudah terkirim ke Customer') + po_ids = fields.Many2many('purchase.order', string='Purchase Order', help='PO yang dibuat, bisa lebih dari satu') po_qty = fields.Float(string='PO Qty', help='Totalan dari semua PO Outstanding') received_qty = fields.Float(string='Received Qty', help='Totalan dari barang yang diterima dari PO tsb') diff --git a/indoteknik_custom/security/ir.model.access.csv b/indoteknik_custom/security/ir.model.access.csv index 49b38e6a..e817a28d 100755 --- a/indoteknik_custom/security/ir.model.access.csv +++ b/indoteknik_custom/security/ir.model.access.csv @@ -145,3 +145,4 @@ access_v_brand_product_category,access.v.brand.product.category,model_v_brand_pr access_web_find_page,access.web.find.page,model_web_find_page,,1,1,1,1 access_v_requisition_match_po,access.v.requisition.match.po,model_v_requisition_match_po,,1,1,1,1 access_approval_retur_picking,access.approval.retur.picking,model_approval_retur_picking,,1,1,1,1 +access_sales_order_fulfillment_v2,access.sales.order.fulfillment.v2,model_sales_order_fulfillment_v2,,1,1,1,1 diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 98001589..676a822d 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -227,6 +227,9 @@ + + + @@ -341,6 +344,23 @@ + + + + + sales.order.fulfillment.v2.tree + sales.order.fulfillment.v2 + + + + + + + + + + + sales.order.fullfillment.tree -- cgit v1.2.3 From d71a8ead26eaf1d44da38b94b1a114f97f407bd8 Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Wed, 13 Nov 2024 09:50:19 +0700 Subject: add po ids in fulfillment v2 --- indoteknik_custom/views/sale_order.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indoteknik_custom/views/sale_order.xml b/indoteknik_custom/views/sale_order.xml index 676a822d..02531966 100755 --- a/indoteknik_custom/views/sale_order.xml +++ b/indoteknik_custom/views/sale_order.xml @@ -356,6 +356,7 @@ + -- cgit v1.2.3