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 define view_ids field view in xml

By
Yves Nicolas
on 2/16/16, 9:47 AM 526 views

I am trying to customize the crm lead object. Class is defined this way

class yvleads(models.Model):
_inherit = 'crm.lead'
_name = 'crm.lead'

Now I added a menu item to display the added elements for which I have both a tree view and a form view. I have added a lett menu item referening a ir.actions.act_window. When this action is defined as

 <record model="ir.actions.act_window" id="yvleads_mgt">
     <field name="name">Leads Yves</field>
     <field name="res_model">crm.lead</field>
     <field name="view_type">form</field>
     <field name="view_mode">form,tree</field>
     <field name="view_id" ref="tree_view_yves_leads"/>
</record>

this works fine for the list-tree view but when I click on any item or the create button, I get the default form view for crm.

To add my customized view for form also, my understanding of [odoo documentation](https://www.odoo.com/documentation/8.0/reference/actions.html#notquitem2m) is that I should use view_ids element but I was not able to get it right

I have tried several syntaxes with/without brackets, using eval="" or inside the xml definition but with no success. Searching this forum for string name="view_ids" was not very helfull, may be it is not the best practice to do that? any help appreciated

 <record model="ir.actions.act_window" id="yvleads_mgt">
     <field name="name">Leads Yves</field>
     <field name="res_model">crm.lead</field>
     <field name="view_type">form</field>
     <field name="view_mode">form,tree</field>
     <field name="view_ids">(tree,tree_view_yves_leads),(form,form_view_yves_leads)</field>
</record>


0

Ahmed M.Elmubarak

--Ahmed M.Elmubarak--
2988
| 5 3 5
Sudan
--Ahmed M.Elmubarak--


Ahmed M.Elmubarak
On 2/17/16, 4:56 AM

Hello,

I think it is better to use ir.actions.act_window.view ...

You can check these lines ...

Regards

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

1 follower(s)

Stats

Asked: 2/16/16, 9:47 AM
Seen: 526 times
Last updated: 2/17/16, 4:56 AM