更新报错
This commit is contained in:
@@ -164,9 +164,6 @@ class SfDemandPlan(models.Model):
|
||||
line.hide_button_release_plan = bool(line.line_ids.filtered(
|
||||
lambda p: p.status == '30'))
|
||||
|
||||
def button_release_plan(self):
|
||||
pass
|
||||
|
||||
@api.depends('line_ids.status', 'sale_order_id.state')
|
||||
def _compute_state(self):
|
||||
for line in self:
|
||||
|
||||
@@ -215,8 +215,9 @@ class SfProductionDemandPlan(models.Model):
|
||||
@api.depends('sale_order_line_id.qty_to_deliver')
|
||||
def _compute_qty_to_deliver(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,
|
||||
precision_rounding=line.product_id.uom_id.rounding) == -1:
|
||||
precision_rounding=rounding) == -1:
|
||||
line.qty_to_deliver = 0
|
||||
else:
|
||||
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:
|
||||
total_reserved_availability = sum(
|
||||
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,
|
||||
precision_rounding=record.product_id.uom_id.rounding) >= 0:
|
||||
precision_rounding=rounding) >= 0:
|
||||
record.material_check = '1' # 已齐套
|
||||
else:
|
||||
record.material_check = '0' # 未齐套
|
||||
|
||||
Reference in New Issue
Block a user