Skip to Content
Menu
This question has been flagged
1 Reply
2790 Views

Great tutorial brother. I just wanted to redirect to a view after creating the record as like:

@api.model
def create(self, vals):
if self.env.user.has_group('smart_courier.group_courier_merchant'):
vals['merchant'] = self.env.user.id
if self.env['courier.merchant.banks'].is_merchant_bank_missing():
super(MerchantPickupPoint, self).create(vals)
return {
'res_model': 'courier.merchant.banks',
'type'
: 'ir.actions.act_window',
'view_id'
: self.env.ref('smart_courier.view_courier_merchant_bank_form').id,
'view_mode'
: 'form'
}

return super(MerchantPickupPoint, self).create(vals)

but I am getting the following error:

AttributeError: 'dict' object has no attribute 'id'. Any idea?


Avatar
Discard
Best Answer

Hello!

Create method doesn't permit to redirect to another form.

Avatar
Discard
Related Posts Replies Views Activity
2
Nov 24
277
1
Oct 24
339
4
Oct 24
327
2
Oct 24
365
2
Dec 24
682