提交7252bug修改内容

This commit is contained in:
chenye
2025-07-11 16:36:18 +08:00
parent ff5925eb06
commit f1390e47c9
4 changed files with 10 additions and 2 deletions

View File

@@ -36,6 +36,9 @@ class SfDemandPlan(models.Model):
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类',
related='product_id.blank_type')
blank_precision = fields.Selection([('精坯', '精坯'), ('粗坯', '粗坯')], string='坯料类型',
related='product_id.blank_precision')
manual_quotation = fields.Boolean('人工编程',related='product_id.manual_quotation', default=False)
embryo_long = fields.Char('坯料尺寸(mm)', compute='_compute_embryo_long', store=True)
is_incoming_material = fields.Boolean('客供料', related='sale_order_line_id.is_incoming_material', store=True)
pending_qty = fields.Float(

View File

@@ -169,7 +169,7 @@ class SfProductionDemandPlan(models.Model):
finished_product_arrival_date = fields.Date('采购计划到货(成品)')
bom_id = fields.Many2one('mrp.bom', string="BOM", readonly=True)
location_id = fields.Many2one('stock.location', string='需求位置', default=get_location_id, readonly=True)
manual_quotation = fields.Boolean('人工编程',related='product_id.manual_quotation',default=False)
@api.constrains('plan_uom_qty')
def _check_plan_uom_qty(self):
line_ids = self.filtered(lambda p: p.plan_uom_qty == 0 or p.plan_uom_qty < 0)
@@ -642,6 +642,8 @@ class SfProductionDemandPlan(models.Model):
self.ensure_one()
if not self.new_supply_method:
raise ValidationError(f"供货方式不能为空!")
if self.product_id.manual_quotation and self.custom_made_type == 'automation':
raise ValidationError(f"产品{self.product_id.name}为人工编程,不能选择自动化产线加工")
check_overdelivery_allowed = False
if not self.demand_plan_id.overdelivery_allowed:
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')

View File

@@ -22,6 +22,7 @@
<field name="model_id" optional="hide"/>
<field name="part_name"/>
<field name="part_number"/>
<field name="manual_quotation" optional="hide"/>
<field name="is_incoming_material"/>
<field name="new_supply_method" attrs="{'readonly': [('status', '!=', '30')]}"/>
<field name="readonly_custom_made_type" invisible="1"/>

View File

@@ -20,7 +20,9 @@
<field name="part_number"/>
<field name="materials_id"/>
<field name="blank_type"/>
<field name="embryo_long"/>
<field name="blank_precision"/>
<field name="embryo_long"/>
<field name="manual_quotation"/>
<field name="is_incoming_material"/>
<field name="pending_qty"/>
<field name="planned_qty"/>