Odoo Help

3

0
2 Answers
5
Avatar

Sudhir Arya (ERP Harbor Consulting Services) India

--Sudhir Arya (ERP Harbor Consulting Services)--
26852
| 8 9 10
Ahmedabad, India
--Sudhir Arya (ERP Harbor Consulting Services)--

• Co-Founder & Co-Owner at ERP Harbor Consulting Services

• ERP Consultant / ERP Customization / TechnoFunctional Expert

• Sound knowledge in Python, Odoo (Open ERP), XML, PostgreSQL

• Domain knowledge of Sale Management, Purchase Management, Warehouse Management, Manufacturing, Multi Company Configuration & Management, HR Management, Medical Management, Construction Management, Education Management, Point of Sale, Third Party Integrations

• Positive attitude and quick Learner

• Good analytical skill, quick bug and issue tracing and find the solution

• Good knowledge and experience in payment gateway integration with Odoo

• Ready to accept new challenges

• Active Memeber On Stackoverflow 

LinkedIn

Blog

Stackoverflow

ERP Harbor Consulting Services

Skype:sudhir@erpharbor.com
Website: http://www.erpharbor.com
Sudhir Arya (ERP Harbor Consulting Services) India
9/3/15, 3:37 AM

Hello Aneesh,

In xml, you cannot hide the page using any condition or attrs.

For that, you can override fields_view_get and add the `invisible="1"` attribute on your page on a specific condition(s).

Example:

from lxml import etree

def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False): if context is None: context = {} res = super(class_name, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu) doc = etree.XML(res['arch']) for node in doc.xpath("//page[@string='My Page']"): if uid in [1, 2, 3]: #ID of the users for whom page should be invisible node.set('invisible', "1") res['arch'] = etree.tostring(doc) return res
Hope this will help you.
3 Comments
Ankit H Gandhi(AHG) India
9/13/15, 9:35 AM

Good replay..@ Sudhir Arya

Sudhir Arya (ERP Harbor Consulting Services) India
9/14/15, 4:57 AM

Thank you Ankit for the compliment.

twanda AG, Ermin Trevisan Switzerland
2/15/17, 3:10 PM

Whoever did flag Sudhir's answer should refrain from doing so! Flagging a post means giving -100 karma points and marking the post as flagged for the moderators.

0
Juan Muñoz Spain
9/7/15, 4:23 AM

Maybe you can add any Group in your XML.

Ask a Question
Keep Informed
1 follower(s)
About This Community

This platform 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.

Register
Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now