summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2025-04-30 15:35:02 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2025-04-30 15:35:02 +0700
commit4c4414b0a4b0a51acfe7324c4c556cd0aa57c3c6 (patch)
tree8776c43299ab6a215cb33e459fdfa3600a4bbac7
parent7b5b79e03e08dff76981dd9734d20c52f90c0b36 (diff)
push
-rw-r--r--indoteknik_custom/models/mrp_production.py8
-rw-r--r--indoteknik_custom/models/stock_move.py22
-rw-r--r--indoteknik_custom/views/mrp_production.xml4
3 files changed, 23 insertions, 11 deletions
diff --git a/indoteknik_custom/models/mrp_production.py b/indoteknik_custom/models/mrp_production.py
index 87d75faf..8179fe56 100644
--- a/indoteknik_custom/models/mrp_production.py
+++ b/indoteknik_custom/models/mrp_production.py
@@ -13,6 +13,14 @@ class MrpProduction(models.Model):
sale_order = fields.Many2one('sale.order', string='Sale Order', copy=False)
production_purchase_match = fields.One2many('production.purchase.match', 'production_id', string='Purchase Matches', auto_join=True)
is_po = fields.Boolean(string='Is PO')
+ state_reserve = fields.Selection([
+ ('waiting', 'Waiting For Fullfilment'),
+ ('ready', 'Ready to Ship'),
+ ('done', 'Done'),
+ ('cancel', 'Cancelled'),
+ ], string='Status Reserve', tracking=True, copy=False, help="The current state of the stock picking.")
+ date_reserved = fields.Datetime(string="Date Reserved", help='Tanggal ter-reserved semua barang nya', copy=False)
+
@api.constrains('check_bom_product_lines')
def constrains_check_bom_product_lines(self):
diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py
index e75c75f0..42a6307a 100644
--- a/indoteknik_custom/models/stock_move.py
+++ b/indoteknik_custom/models/stock_move.py
@@ -15,18 +15,18 @@ class StockMove(models.Model):
barcode = fields.Char(string='Barcode', related='product_id.barcode')
vendor_id = fields.Many2one('res.partner' ,string='Vendor')
- @api.model_create_multi
- def create(self, vals_list):
- moves = super(StockMove, self).create(vals_list)
+ # @api.model_create_multi
+ # def create(self, vals_list):
+ # moves = super(StockMove, self).create(vals_list)
- for move in moves:
- if move.product_id and move.location_id.id == 58 and move.location_dest_id.id == 57 and move.picking_type_id.id == 75:
- po_line = self.env['purchase.order.line'].search([
- ('product_id', '=', move.product_id.id),
- ('order_id.name', '=', move.origin)
- ], limit=1)
- if po_line:
- move.write({'purchase_line_id': po_line.id})
+ # for move in moves:
+ # if move.product_id and move.location_id.id == 58 and move.location_dest_id.id == 57 and move.picking_type_id.id == 75:
+ # po_line = self.env['purchase.order.line'].search([
+ # ('product_id', '=', move.product_id.id),
+ # ('order_id.name', '=', move.origin)
+ # ], limit=1)
+ # if po_line:
+ # move.write({'purchase_line_id': po_line.id})
return moves
diff --git a/indoteknik_custom/views/mrp_production.xml b/indoteknik_custom/views/mrp_production.xml
index 419737f9..3de52a08 100644
--- a/indoteknik_custom/views/mrp_production.xml
+++ b/indoteknik_custom/views/mrp_production.xml
@@ -49,6 +49,10 @@
<field name="desc"/>
<field name="sale_order"/>
</field>
+ <field name="state" position="after">
+ <field name="state_reserve" optional="hide"/>
+ <field name="date_reserved" optional="hide"/>
+ </field>
</field>
</record>