修复需求计划生成的bom编码时间少8小时

This commit is contained in:
guanhuan
2025-07-09 16:57:20 +08:00
parent acb6fd42ca
commit d02babaf0a
2 changed files with 3 additions and 3 deletions

View File

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

View File

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