Tooltip in list view-OpenERP Goal: Displaying additional information for each record in list through a tooltip. As in the following picture.
Change following in client code:- 1. web_client/openerp/widgets/listgrid.py In listgrid.py file there is a class list. It is having a list named params with various values. Like 'name', 'data', 'columns', 'headers', 'model', 'selectable', 'editable' etc. Do the following steps: proxy = rpc.RPCProxy(model) here model is name of the table and seller_ids is the column name to retrive. if model=='product.product': partners = proxy.read(ids, ['seller_ids'], ctx) for partner in partners: li_st.append(partner["seller_ids"]) for item in li_st: for l in item: part_list.append(l) proxy2 = rpc.RPCProxy("product.supplierinfo") supp_info_id = proxy2.read(part_list, ['name','product_id'], ctx)
for dic in supp_info_id: if not self.suppliers.has_key(dic['product_id'][0]): self.suppliers.update({dic['product_id'][0]:[dic['name'][1]]}) else: self.suppliers [dic['product_id'][0]].append(dic['name'][1])
for key in self.suppliers.keys(): str=" ".join(["%s" % el for el in self.suppliers[key]]) self.suppliers[key]=str Create a dictionary with keys equal to ids of the products and values equal to supplier of the product. <span> as <span>
data['id'] represents the id of each record(each product) in the list. |








