Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How to show default form view with existing data (instead of new form) when clicked on menu action

By
Sairam Bandaru
on 12/14/15, 2:27 AM 636 views

I need to show user tagged to employee form view when user logged in to system(User should see his employee details in form view)

I tried like this

<record id="hr_profile" model="ir.actions.act_window">

<field name="name">My Information</field>

<field name="res_model">hr.employee</field>

<field name="view_type">form</field>

<field name="view_mode">form,tree,kanban</field>

<field name="domain">[('user_id','=',user.id)]</field>

<field name="context">{'my_self':1}</field> </record>

<menuitem parent ="hr.menu_hr_main" sequence="1" string="My Details" id="menu_self" action="hr_profile"/>   

I inherited search view and passed arg(i.e., [('user_id','=',user.id)]) but its not even calling the search method and its showing new form when I given default form in action,but search method called when we used default view tree or kanban

help me out
 

0

Ankit H Gandhi(AHG)

--Ankit H Gandhi(AHG)--
996
| 5 3 6
Rajkot, India
--Ankit H Gandhi(AHG)--

Learning Python..

Ankit H Gandhi(AHG)
On 12/14/15, 3:05 AM

Dear Sairam,

You need to do some change in ir.actions.act_window in xml file

Just add to 'view_id' tag in action like

<field name="view_id" ref="your_module_name.new_modify_tree_id"/>

Example

<field name="view_id" ref="base.res_partner_kanban_view"/>

Hope this help for you.

Best Regards,

Ankit H Gandhi.

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

2 follower(s)

Stats

Asked: 12/14/15, 2:27 AM
Seen: 636 times
Last updated: 3/9/16, 12:29 AM