2

I want to show a wizard, I try with this, but it does not show the wizard.

Someone can help me.

if self.move_id:
   view = self.env.ref('modified_pos.pos_assign_manual_quants_form_view')
   wiz = self.env['pos.assign.manual.quants']
   return {
      'name': _('Change quantity'),
      'type': 'ir.actions.act_window',
      'view_type': 'form',
      'view_mode': 'form',
      'res_model': 'pos.assign.manual.quants',
      'views': [(view.id, 'form')],
      'view_id': view.id,
      'target': 'new',
      'res_id': wiz.id,
      'context': self.env.context,
   }
Nikolai Shevchenko
  • 7,083
  • 8
  • 33
  • 42

1 Answers1

1

If you want to open a specific record please pass the 'res_id' correctly, here you are trying to open a specific record but for id, you are passing nothing.

If you want to create a new record on the fly with specific values please use:-

wiz = self.env['pos.assign.manual.quants'].create({field:value,...})

Or remove res_id completely.

Baiju KS
  • 659
  • 8
  • 12