diff --git a/sf_demand_plan/models/sf_production_demand_plan.py b/sf_demand_plan/models/sf_production_demand_plan.py index d43c2eb6..d312a2f5 100644 --- a/sf_demand_plan/models/sf_production_demand_plan.py +++ b/sf_demand_plan/models/sf_production_demand_plan.py @@ -72,6 +72,7 @@ class SfProductionDemandPlan(models.Model): model_long = fields.Char('尺寸(mm)', compute='_compute_model_long') blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类', related='product_id.blank_type') + blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型', related='product_id.blank_precision') embryo_long = fields.Char('坯料尺寸(mm)', compute='_compute_embryo_long') materials_id = fields.Char('材料', compute='_compute_materials_id', store=True) model_machining_precision = fields.Selection(selection=_get_machining_precision, string='精度', diff --git a/sf_demand_plan/static/src/scss/style.css b/sf_demand_plan/static/src/scss/style.css index 9662a10a..08d382c1 100644 --- a/sf_demand_plan/static/src/scss/style.css +++ b/sf_demand_plan/static/src/scss/style.css @@ -81,4 +81,9 @@ input,label { cursor: pointer; } -} \ No newline at end of file +} + +th[data-name=processing_time] + th::before{ + content: '待执行单据'; + line-height: 38px; +} diff --git a/sf_demand_plan/views/demand_plan.xml b/sf_demand_plan/views/demand_plan.xml index a316df5a..24ac8416 100644 --- a/sf_demand_plan/views/demand_plan.xml +++ b/sf_demand_plan/views/demand_plan.xml @@ -4,14 +4,13 @@ sf.production.demand.plan + class="demand_plan_tree freeze-columns-before-part_number">
- @@ -29,6 +28,7 @@ + @@ -44,7 +44,10 @@ - + @@ -63,6 +66,7 @@ + @@ -92,7 +96,8 @@ - + + + + + + \ No newline at end of file diff --git a/sf_dlm/models/product_supplierinfo.py b/sf_dlm/models/product_supplierinfo.py index f4278e03..a631efe4 100644 --- a/sf_dlm/models/product_supplierinfo.py +++ b/sf_dlm/models/product_supplierinfo.py @@ -3,6 +3,7 @@ import logging import re from odoo import models, fields, api +from odoo.exceptions import ValidationError class ResProductCategory(models.Model): @@ -47,11 +48,14 @@ class ResMrpBomMo(models.Model): item.subcontractor_name = '' def bom_create_line_has(self, embryo): + product = self.product_tmpl_id + if product.unit_number in (0, None, False): + raise ValidationError(f'产品{product.name}单件用量的值不能为{product.unit_number}') vals = { 'bom_id': self.id, 'product_id': embryo.id, 'product_tmpl_id': embryo.product_tmpl_id.id, - 'product_qty': 1, + 'product_qty': product.unit_number, 'product_uom_id': 1 } return self.env['mrp.bom.line'].sudo().create(vals) @@ -122,7 +126,7 @@ class ResMrpBomMo(models.Model): # 查bom的原材料 def get_raw_bom(self, product): raw_bom = self.env['product.product'].search( - [('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)],limit=1) + [('categ_id.type', '=', '原材料'), ('materials_type_id', '=', product.materials_type_id.id)], limit=1) return raw_bom diff --git a/sf_dlm_management/views/product_template_management_view.xml b/sf_dlm_management/views/product_template_management_view.xml index bb9904a7..75262611 100644 --- a/sf_dlm_management/views/product_template_management_view.xml +++ b/sf_dlm_management/views/product_template_management_view.xml @@ -95,6 +95,8 @@ + +