diff --git a/sf_demand_plan/models/sf_demand_plan.py b/sf_demand_plan/models/sf_demand_plan.py index 864f8002..c873dd7b 100644 --- a/sf_demand_plan/models/sf_demand_plan.py +++ b/sf_demand_plan/models/sf_demand_plan.py @@ -197,7 +197,7 @@ class SfDemandPlan(models.Model): def name_get(self): result = [] for plan in self: - result.append((plan.id, plan.sale_order_id.name)) + result.append((plan.id, plan.product_id.name)) return result def button_production_release_plan(self): diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index 4daa7ae3..4428acce 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -686,9 +686,9 @@ class SfProductionDemandPlan(models.Model): # 复制成品模板上的属性 self.product_id.product_tmpl_id.copy_template(product_template_id) - + future_time = datetime.now() + timedelta(hours=8) # 生成BOM单据编码 - code = f"{self.product_id.default_code}-{bom_type}-{datetime.now().strftime('%Y%m%d%H%M%S')}" + code = f"{self.product_id.default_code}-{bom_type}-{future_time.strftime('%Y%m%d%H%M%S')}" order_id = self.sale_order_id product = self.product_id