I had def create(self,values) method that return similar number when a customer create new one.
@api.model
def create(self, values):
record=super(similar_contact,self).create(values)
val=self.env['checked.criteria'].search([('name','=',record.name)])
if (val != 0):
count=0
for x in val:
if x:
count=count+1
logging.info("Data are")
logging.info(x.id)
return record
logging.info(x.id) get ids of similar contacts.I want to pass these ids to tree view to show the similar lists according to these ids.I don't know how to pass it to tree view.
@api.multi
def similar_list_button_action(self):
tree_view_id = self.env.ref('similar_contact.similar_detail_tree_view').id
my_id = context["active_ids"]
logging.info(my_id)
return{
'name' : 'Similar Detail Tree View',
'type' : 'ir.actions.act_window',
'res_model' : 'similar.task',
'view_type' : 'form',
'view_mode' : 'tree',
'view_id' : [(tree_view_id,'tree')],
'res_id' : my_id,
'target' : 'new'
}