summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/product_template.py
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2025-05-23 11:16:30 +0700
committerstephanchrst <stephanchrst@gmail.com>2025-05-23 11:16:30 +0700
commit019bba2a3ff2ed08f53200df02c0638ddabbbe22 (patch)
tree7da620a897a3329b5d52160205a65df91db9ce25 /indoteknik_custom/models/product_template.py
parent1ce12e1b817079a1fd74c892a880bd8efff72e41 (diff)
bf outgoing with hold qty and change formula of reordering rule
Diffstat (limited to 'indoteknik_custom/models/product_template.py')
-rwxr-xr-xindoteknik_custom/models/product_template.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py
index 34b8fd2c..c62ca63e 100755
--- a/indoteknik_custom/models/product_template.py
+++ b/indoteknik_custom/models/product_template.py
@@ -1116,7 +1116,8 @@ class ProductProduct(models.Model):
domain=[
('product_id', '=', product.id),
('location_id', 'in', [57, 83]),
- ('mo_id', '=', False)
+ ('mo_id', '=', False),
+ ('hold_outgoing', '=', False)
],
fields=['qty_need'],
groupby=[]
@@ -1359,6 +1360,7 @@ class OutstandingMove(models.Model):
location_id = fields.Many2one('stock.location', string='Location', help='Lokasi asal')
location_dest_id = fields.Many2one('stock.location', string='Location To', help='Lokasi tujuan')
mo_id = fields.Many2one('mrp.production', string='Manufacturing Order')
+ hold_outgoing = fields.Boolean(string='Hold Outgoing')
def init(self):
# where clause 'state in' follow the origin of outgoing and incoming odoo
@@ -1368,8 +1370,11 @@ class OutstandingMove(models.Model):
select sm.id, sm.reference, sm.product_id,
sm.product_uom_qty as qty_need,
sm.location_id, sm.location_dest_id,
- sm.raw_material_production_id as mo_id
+ sm.raw_material_production_id as mo_id,
+ so.hold_outgoing
from stock_move sm
+ left join procurement_group pg on pg.id = sm.group_id
+ left join sale_order so on so.id = pg.sale_id
where 1=1
and sm.state in(
'waiting',