How can i display field as hyper link in my view?In my code i added widget="url" but its not showng as link.Please help
<?xml version="1.0" encoding="utf-8" ?>
<openerp>
<data>
<record id="voip_form_view" model="ir.ui.view">
<field name="name">Voip Details</field>
<field name="model">filedata</field>
<field name="arch" type="xml">
<form string="voip" version="7.0">
<!-- <style> .openerp .oe_view_manager table.oe_view_manager_header { display:none } </style> -->
<style>.openerp .oe_application .oe_breadcrumb_title {display:none }</style>
<style>.openerp .oe_view_manager table.oe_view_manager_header .oe_view_manager_buttons{display:none }</style>
<!-- <header style="padding-left: 5px; padding-top: 60px; padding-bottom: 10px;"> -->
<!-- <header> -->
<button name="get_filenames" type="object" string="List Files" />
<!-- </header> -->
<!--
<sheet>
</sheet> -->
</form>
</field>
</record>
<record id="voip_filter" model="ir.ui.view">
<field name="name">filedata.select</field>
<field name="model">filedata</field>
<field name="arch" type="xml">
<search string="File Details">
<field name="file_name" string="Name"/>
<field name="time_created" string="Time Created"/>
<field name="size" string="Size"/>
<group expand="0" string="Group By...">
<filter string="Name" name="name" icon="terp-personal" domain="[]" context="{'group_by':'file_name'}"/>
<filter string="Time Created" icon="terp-personal" domain="[]" context="{'group_by':'time_created'}"/>
<filter string="Size" icon="terp-personal" domain="[]" context="{'group_by':'size'}"/>
</group>
</search>
</field>
</record>
<record id="voipdata_tree_view" model="ir.ui.view">
<field name="name">File Details</field>
<field name="model">filedata</field>
<field name="priority" eval="1"/>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="File Names" >
<field name="file_name" widget='url'/>
<field name="file_path" widget='url'/>
<field name="time_created" string="Time Created"/>
<field name="size" string="Size"/>
<!--<button name="file_object" string="Download or Play" filename="file_name"/> -->
<!-- <button name="download_file" type="object" string="Downlaod"/> -->
<!-- <button name="play_file" type="object" string="Play or download" /> -->
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_voipdata_form">
<field name="name">Voip Details</field>
<field name="res_model">filedata</field>
<field name="view_type">tree</field>
<field name="view_mode">tree</field>
</record>
<record model="ir.actions.act_window" id="action_voip_form">
<field name="name">Voip Details</field>
<field name="res_model">filedata</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="voip_form_view"/>
</record>
<menuitem name="Voip" parent="base.menu_reporting" id="voip_menu_mainform"/>
<menuitem name="Voip" parent="voip_menu_mainform" id="voip_menu_subform" action="action_voip_form"/>
</data>
</openerp>
class filedata(osv.osv):
_name = 'filedata'
_log_access = False
_columns = {
'file_name' : fields.char('Name'),
'file_path' : fields.char('File Path'),
'time_created' : fields.datetime('Date Time'),
'size' : fields.char('Size')
}
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hello Anuradha, you have to define this in your xml code not in your python code: For example, in you xml code type <field name="field_name" widget="url">. It will definitely work!
i added in xml but not working :( .please help
Hello Anuradha,
You can make field as hyperlink using widget ="url" at your field.
Here i attached a image file where you can find your solution.
@Serpent Consulting I want to do it through code i tested by changing my code as <field name="file_name" string="Name" Widget="url"/> but its not showing as link please help!!
Did you upgrade the module after changing xml file?
yes i upgraded xml. but its not showing as link
Did you got any trace back in server or any error? If you got can you please send it to me ?
No my log is 2013-09-26 11:23:02,328 24707 INFO testdb werkzeug: 123.237.13.196 - - [26/Sep/2013 11:23:02] "POST /web/dataset/call_button HTTP/1.1" 200 - 2013-09-26 11:23:03,403 24707 INFO testdb werkzeug: 123.237.13.196 - - [26/Sep/2013 11:23:03] "POST /web/dataset/call_kw HTTP/1.1" 200 - 2013-09-26 11:23:03,438 24707 INFO testdb werkzeug: 123.237.13.196 - - [26/Sep/2013 11:23:03] "POST /web/dataset/call_kw HTTP/1.1" 200 - 2013-09-26 11:23:04,435 24707 INFO testdb werkzeug: 123.237.13.196 - - [26/Sep/2013 11:23:04] "POST /web/dataset/call_kw HTTP/1.1" 200 - 2013-09-26 11:23:04,449 24707 INFO
I will post my whole code i question please check
I can't figured it out here.If you can send me your module then i will check it in my system. My email id is "a.mehta.serpentcs@gmail.com"
hello, In xml view
<field name="url" widget="url"/>