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

fields_view_get current id problem

By
Shivam Goyal
on 4/3/14, 4:16 AM 2,307 views

Hello Everyonne!!!!!!!! i am in need of urgent help. I want to display the view according to a particular values of a record.For this purpose i used the function fields_view_get() but as u know we cannot access the current record id in this functions. When i use this method i get the context as None or an empty dictionary.I do not get the key of 'active_id' .Hence i cannot use context.get('active_id').So is there a way to update this context with the acitve_id or the current record id.I have seen other posts but either the steps given are not clear or they are actually not working

Please I am in urgent need Thanx in advance Regards Shivam Goyal

0

Prakash

--Prakash--
3173
| 5 4 7
Bikaner, India
--Prakash--

OpenERP Devloper at SunARC Technology

Prakash
On 4/3/14, 4:51 AM
0
Shivam Goyal
On 4/3/14, 5:08 AM

Hi!!! Prakash....thank you for the interest shown. the link that u have sent me does not work or may be i am doing sthing wronng .I request you to plz guide me into it. What i did is in the form view of sale.order i added the field "order_id" but not specifically where it is given in the link but somewhere in the sale_order form view only, which i think won't matter.I added the "order_id" field after the "name" field using xpath Obviously i have declared this field in _columns also.I added the _defauts line exactly as given in the link So in the xml it goes like this

<xpath expr "////xxx/fields[@name="name"]" postion="after">
       <field name="order_id" context="{'order_id': active_id}"/>
</xpath>

This is what i did exactly but when my fields_view_get() is called my context does not have "order_id" key. I am new to openerp.Please guide me if i have got it all wrong or whether i am missing something which i dont know

Best Regards Shivam Goyal

you added context active_id using xml path using position after tag. I think need to use replace tag.

Prakash
on 4/3/14, 5:44 AM

So you are saying i should replace the "name" fields in sales_order form with order_id?

Shivam Goyal
on 4/3/14, 5:48 AM

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

0 follower(s)

Stats

Asked: 4/3/14, 4:16 AM
Seen: 2307 times
Last updated: 3/16/15, 8:10 AM