物料需求计划管理
This commit is contained in:
@@ -50,19 +50,10 @@ class ReSaleOrder(models.Model):
|
||||
def action_view_demand_plan(self):
|
||||
self.ensure_one()
|
||||
demand_plan_ids = self.env['sf.production.demand.plan'].sudo().search([('sale_order_id', '=', self.id)]).ids
|
||||
action = {
|
||||
return {
|
||||
'res_model': 'sf.production.demand.plan',
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _("需求计划"),
|
||||
'domain': [('id', 'in', demand_plan_ids)],
|
||||
'view_mode': 'tree',
|
||||
}
|
||||
if len(demand_plan_ids) == 1:
|
||||
action.update({
|
||||
'view_mode': 'form',
|
||||
'res_id': demand_plan_ids[0],
|
||||
})
|
||||
else:
|
||||
action.update({
|
||||
'name': _("需求计划"),
|
||||
'domain': [('id', 'in', demand_plan_ids)],
|
||||
'view_mode': 'tree',
|
||||
})
|
||||
return action
|
||||
|
||||
Reference in New Issue
Block a user