新增产线类型方法校验
This commit is contained in:
@@ -911,5 +911,25 @@ class SfProductionDemandPlan(models.Model):
|
||||
}
|
||||
return values
|
||||
|
||||
@api.model
|
||||
def check_other_custom_made_demands(self, plan_id, product_id, custom_made_type):
|
||||
return bool(self.env['sf.production.demand.plan'].sudo().search_count([
|
||||
('product_id', '=', product_id),
|
||||
('id', '!=', plan_id),
|
||||
('new_supply_method', '=', 'custom_made'),
|
||||
('status', '=', '30'),
|
||||
('custom_made_type', '!=', custom_made_type),
|
||||
], limit=1))
|
||||
|
||||
def button_plan_detail(self):
|
||||
pass
|
||||
return {
|
||||
'name': _('详情'),
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'sf.demand.plan.detail.wizard',
|
||||
'target': 'new',
|
||||
'views': [(False, 'form')],
|
||||
'context': {
|
||||
'default_demand_plan_line_ids': self.ids,
|
||||
'default_mrp_production_ids': self.mrp_production_ids.ids,
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user