From 60e7415a27cc15f18b5a5efabf00521479f86e73 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 9 Jul 2025 10:25:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/models/sf_demand_plan.py | 3 --- sf_demand_plan/models/sf_production_demand_plan.py | 6 ++++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/sf_demand_plan/models/sf_demand_plan.py b/sf_demand_plan/models/sf_demand_plan.py index c1f325dc..63371dfd 100644 --- a/sf_demand_plan/models/sf_demand_plan.py +++ b/sf_demand_plan/models/sf_demand_plan.py @@ -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: diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index f0bbd708..a0b5bb92 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -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' # 未齐套