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 a field which is visible that by the one who has it to create but not the others?

By
tansadio
on 1/22/15, 4:12 AM 441 views

Here is the field which I want to mask to the others

'planned_revenue': fields.float('Expected Revenue', track_visibility='always'),

thanks for your help,

Can you tell me how to use groups on a model or view? stp

2015-01-22 10:16 GMT+01:00 Ivan <niecw@mail.odoo.com>:

A new answer for How to define a field which is visible that by the one who has it to create but not the others? has been posted. Click here to access the post.

--
Ivan
Sent by Odoo Inc. using Odoo about Forum Post How to define a field which is visible that by the one who has it to create but not the others?

tansadio
on 1/22/15, 5:30 AM
0

Ivan

--Ivan--
3210
| 5 3 6
Jakarta, Indonesia
--Ivan--
Ivan
On 1/22/15, 4:16 AM

You can use groups in that fields to limit the access to the field.  Groups can be added in the fields definition (you need to inherit the model) or in the view definition (you need to inherit the view).

0
tansadio
On 1/22/15, 5:28 AM

I put the groups on a view that I inherited the CRM module. Can you tell me what does not work?

<record model="ir.ui.view" id="crm_case_kanban_view_leads_inherit">
                <field name="name">CRM - Leads Kanban Inherit</field>
                <field name="model">crm.lead</field>
                <field name="inherit_id" ref="crm.crm_case_kanban_view_leads"/>
                <field name="arch" type="xml">
                    <xpath expr="//div[@class='oe_kanban_content']/div" position="replace">
                        <div groups="base.group_user">
                         <b><field name="name"/></b>
                          <t t-if="record.planned_revenue.raw_value">
                            - <i><t t-esc="record.planned_revenue.value"/>
                            <field name="company_currency"/></i>
                          </t>    
                        </div>                              
                    </xpath>
                </field>
            </record>

Put the groups in the field (view element tags) not HTML tags.

Ivan
on 1/22/15, 5:32 AM

I can hide for evrybody with groups="group_no_one" on a field, but when I use groups="group_user" for a single user none effect.

tansadio
on 1/22/15, 6:07 AM

If what you mean is base.group_user, it is a group that is used for Employees. So, I imagine that most users will belongs to that group and can view that field. If you want that field to be visible to only certain user, then create a group first, assign the users that should have access to this group, and add this group to the groups attribute.

Ivan
on 1/22/15, 6:57 AM

Made it is a field owner whom I want to create, It is accessible to nobody except that who has him to create.

tansadio
on 1/22/15, 7:24 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

1 follower(s)

Stats

Asked: 1/22/15, 4:12 AM
Seen: 441 times
Last updated: 3/16/15, 8:10 AM