Accept Merge Request #2279: (feature/7249 -> develop)
Merge Request: Merge branch 'develop' into feature/7249 Created By: @陈烨 Reviewed By: @胡尧 Approved By: @胡尧 Accepted By: @陈烨 URL: https://jikimo-hn.coding.net/p/jikimo_sfs/d/jikimo_sf/git/merge/2279
This commit is contained in:
@@ -36,6 +36,9 @@ class SfDemandPlan(models.Model):
|
|||||||
|
|
||||||
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类',
|
blank_type = fields.Selection([('圆料', '圆料'), ('方料', '方料')], string='坯料分类',
|
||||||
related='product_id.blank_type')
|
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)
|
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)
|
is_incoming_material = fields.Boolean('客供料', related='sale_order_line_id.is_incoming_material', store=True)
|
||||||
pending_qty = fields.Float(
|
pending_qty = fields.Float(
|
||||||
|
|||||||
@@ -169,7 +169,7 @@ class SfProductionDemandPlan(models.Model):
|
|||||||
finished_product_arrival_date = fields.Date('采购计划到货(成品)')
|
finished_product_arrival_date = fields.Date('采购计划到货(成品)')
|
||||||
bom_id = fields.Many2one('mrp.bom', string="BOM", readonly=True)
|
bom_id = fields.Many2one('mrp.bom', string="BOM", readonly=True)
|
||||||
location_id = fields.Many2one('stock.location', string='需求位置', default=get_location_id, 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')
|
@api.constrains('plan_uom_qty')
|
||||||
def _check_plan_uom_qty(self):
|
def _check_plan_uom_qty(self):
|
||||||
line_ids = self.filtered(lambda p: p.plan_uom_qty == 0 or p.plan_uom_qty < 0)
|
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()
|
self.ensure_one()
|
||||||
if not self.new_supply_method:
|
if not self.new_supply_method:
|
||||||
raise ValidationError(f"供货方式不能为空!")
|
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
|
check_overdelivery_allowed = False
|
||||||
if not self.demand_plan_id.overdelivery_allowed:
|
if not self.demand_plan_id.overdelivery_allowed:
|
||||||
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
customer_location_id = self.env['ir.model.data']._xmlid_to_res_id('stock.stock_location_customers')
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
<field name="model_id" optional="hide"/>
|
<field name="model_id" optional="hide"/>
|
||||||
<field name="part_name"/>
|
<field name="part_name"/>
|
||||||
<field name="part_number"/>
|
<field name="part_number"/>
|
||||||
|
<field name="manual_quotation" optional="hide"/>
|
||||||
<field name="is_incoming_material"/>
|
<field name="is_incoming_material"/>
|
||||||
<field name="new_supply_method" attrs="{'readonly': [('status', '!=', '30')]}"/>
|
<field name="new_supply_method" attrs="{'readonly': [('status', '!=', '30')]}"/>
|
||||||
<field name="readonly_custom_made_type" invisible="1"/>
|
<field name="readonly_custom_made_type" invisible="1"/>
|
||||||
|
|||||||
@@ -20,7 +20,9 @@
|
|||||||
<field name="part_number"/>
|
<field name="part_number"/>
|
||||||
<field name="materials_id"/>
|
<field name="materials_id"/>
|
||||||
<field name="blank_type"/>
|
<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="is_incoming_material"/>
|
||||||
<field name="pending_qty"/>
|
<field name="pending_qty"/>
|
||||||
<field name="planned_qty"/>
|
<field name="planned_qty"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user