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?