Accept Merge Request #2272: (feature/物料需求计划管理 -> develop)
Merge Request: 更新报错 Created By: @管欢 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @管欢 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2272
This commit is contained in:
@@ -164,9 +164,6 @@ class SfDemandPlan(models.Model):
|
|||||||
line.hide_button_release_plan = bool(line.line_ids.filtered(
|
line.hide_button_release_plan = bool(line.line_ids.filtered(
|
||||||
lambda p: p.status == '30'))
|
lambda p: p.status == '30'))
|
||||||
|
|
||||||
def button_release_plan(self):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@api.depends('line_ids.status', 'sale_order_id.state')
|
@api.depends('line_ids.status', 'sale_order_id.state')
|
||||||
def _compute_state(self):
|
def _compute_state(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
|
|||||||
@@ -215,8 +215,9 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
@api.depends('sale_order_line_id.qty_to_deliver')
|
@api.depends('sale_order_line_id.qty_to_deliver')
|
||||||
def _compute_qty_to_deliver(self):
|
def _compute_qty_to_deliver(self):
|
||||||
for line in self:
|
for line in self:
|
||||||
|
rounding = line.product_id.uom_id.rounding or 0.01
|
||||||
if float_compare(line.sale_order_line_id.qty_to_deliver, 0,
|
if float_compare(line.sale_order_line_id.qty_to_deliver, 0,
|
||||||
precision_rounding=line.product_id.uom_id.rounding) == -1:
|
precision_rounding=rounding) == -1:
|
||||||
line.qty_to_deliver = 0
|
line.qty_to_deliver = 0
|
||||||
else:
|
else:
|
||||||
line.qty_to_deliver = line.sale_order_line_id.qty_to_deliver
|
line.qty_to_deliver = line.sale_order_line_id.qty_to_deliver
|
||||||
@@ -286,8 +287,9 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
if record.mrp_production_ids and record.mrp_production_ids.move_raw_ids:
|
if record.mrp_production_ids and record.mrp_production_ids.move_raw_ids:
|
||||||
total_reserved_availability = sum(
|
total_reserved_availability = sum(
|
||||||
record.mrp_production_ids.mapped('move_raw_ids.reserved_availability'))
|
record.mrp_production_ids.mapped('move_raw_ids.reserved_availability'))
|
||||||
|
rounding = record.product_id.uom_id.rounding or 0.01
|
||||||
if float_compare(total_reserved_availability, record.plan_uom_qty,
|
if float_compare(total_reserved_availability, record.plan_uom_qty,
|
||||||
precision_rounding=record.product_id.uom_id.rounding) >= 0:
|
precision_rounding=rounding) >= 0:
|
||||||
record.material_check = '1' # 已齐套
|
record.material_check = '1' # 已齐套
|
||||||
else:
|
else:
|
||||||
record.material_check = '0' # 未齐套
|
record.material_check = '0' # 未齐套
|
||||||
|
|||||||
Reference in New Issue
Block a user