From deda36a0f9a5489305a1b77b7f2c6536542133a2 Mon Sep 17 00:00:00 2001 From: guanhuan Date: Wed, 25 Jun 2025 15:01:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E6=96=99=E9=9C=80=E6=B1=82=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- sf_demand_plan/models/sf_production_demand_plan.py | 5 ++--- sf_demand_plan/views/demand_plan.xml | 4 ++-- sf_demand_plan/views/demand_plan_info.xml | 4 ++-- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index 118494fc..3abdd0f3 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -30,7 +30,7 @@ class SfProductionDemandPlan(models.Model): ('50', '待下达生产'), ('60', '已下达'), ('100', '取消'), - ], string='状态', compute='_compute_status', store=True, readonly=False) + ], string='状态', default='30', compute='_compute_status', store=True) demand_plan_id = fields.Many2one(comodel_name="sf.demand.plan", string="物料需求", readonly=True) sale_order_id = fields.Many2one(comodel_name="sale.order", @@ -85,8 +85,7 @@ class SfProductionDemandPlan(models.Model): order_state = fields.Selection( string='订单状态', related='sale_order_line_id.state') - route_id = fields.Many2one('stock.route', string='路线', related='sale_order_line_id.route_id', store=True) - route_ids = fields.Many2many('stock.route', 'stock_route_demand_plan', 'demand_plan_id', 'route_id', '路线', + route_ids = fields.Many2many('stock.route', 'stock_route_demand_plan', 'demand_plan_id', 'route_id', '库存路线', domain=[('demand_plan_selectable', '=', True)], compute='_compute_route_ids', store=True) contract_date = fields.Date('合同日期', related='sale_order_id.contract_date') diff --git a/sf_demand_plan/views/demand_plan.xml b/sf_demand_plan/views/demand_plan.xml index 4c63fb8e..5f623267 100644 --- a/sf_demand_plan/views/demand_plan.xml +++ b/sf_demand_plan/views/demand_plan.xml @@ -21,7 +21,7 @@ - + @@ -38,7 +38,7 @@ - diff --git a/sf_demand_plan/views/demand_plan_info.xml b/sf_demand_plan/views/demand_plan_info.xml index 0e7c7794..16f75b35 100644 --- a/sf_demand_plan/views/demand_plan_info.xml +++ b/sf_demand_plan/views/demand_plan_info.xml @@ -41,8 +41,8 @@ - - + +