更新报错

This commit is contained in:
guanhuan
2025-07-09 10:25:19 +08:00
parent 4c6cf0ba5e
commit 60e7415a27
2 changed files with 4 additions and 5 deletions

View File

@@ -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:

View File

@@ -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' # 未齐套