新增产线类型方法校验

This commit is contained in:
guanhuan
2025-07-16 15:46:03 +08:00
parent 5a98b20988
commit 4d959eab59
7 changed files with 65 additions and 4 deletions

View File

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