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.

1

How to remove edit button in form issue for user?

By
Fransis L. Yoas
on 7/16/13, 12:20 AM 3,372 views

I want to remove edit button for user in form issue but not for manager or admin. I didn't find any code for edit button. I have tried access control and record rules but it's not working. I also have tried to change models project.issue for project user and uncheck in "write access" , it's working..But user also can't create issue. I want user still can create issue but can't edit any recorded issue..anyone can help me?thank you

2

Sudhir Arya (SA)

--Sudhir Arya (SA)--
10150
| 6 8 8
Ahmedabad, India
--Sudhir Arya (SA)--

Working as an OpenERP/Odoo developer and a Team Leader 

Top 5 Odoo contributor On Stackoverflow

LinkedIn

Blog

Stackoverflow

Sudhir Arya (SA)
On 7/16/13, 2:35 AM

Create your own group and then try given xml code. You need to pass your group in groups_id.

    <record id="view_issue_form_remove_edit" model="ir.ui.view">
        <field name="name">view.issue.form.remove.edit</field>
        <field name="model">project.issue</field>
        <field name="inherit_id" ref="project_issue.project_issue_form_view"/>
        <field name="groups_id" eval="[(6, 0, [ref('your_group')])]"/>
        <field name="arch" type="xml">
            <xpath expr="//form" position="attributes">
                <attribute name="edit">false</attribute>
            </xpath>
        </field>
    </record>

This will hide edit button for those users who belongs to new group.

I have tried in file project_issue_view.xml , and it's not working..em sorry , btw which file that I have to write those code?is it in project_issue_view.xml?thank you..

Fransis L. Yoas
on 7/16/13, 3:12 AM

Mr Sudhir Arya please reply my comment..sorry because It's urgent for my project..thank you

Fransis L. Yoas
on 7/16/13, 5:00 AM

Yes , I also need this function..I'm waiting for your response Mr Sudhir Arya..

alvin
on 7/16/13, 7:13 AM

How can i hide a <page> for particular stage not state? For eg: In recruitment module, it has contract proposed stage. When i click the stage, i want to see my customized <page> tab. is it possible?

Remya
on 7/27/13, 6:10 AM
0
jolevq
On 4/27/16, 10:35 PM

Also, with something like this It's possible to hide the buttons from an specific user groups. This example hide the buttom edit in the Invoice Form. The users of the groups have write privileges only for posting on the messages an communication history but not the fields of the invoices.

   <record model="ir.ui.view" id="YOURNEWVIEWID">
         <field name="name">account.invoice.form</field>
         <field name="model">account.invoice</field>
         <field name="inherit_id" ref="PARENTFORMID" />
         <field name="groups_id" eval="[(6,0, [ref('YOURSPECIFICGROUP')])]" />
         <field name="arch" type="xml">
            <xpath expr="//form[@string='Invoice']" position="attributes">
                <attribute name="edit">false</attribute>
            </xpath>
         </field>
    </record>
To hide a page it is similar, the difference will be in the xpath section
   <record model="ir.ui.view" id="YOURNEWVIEWID">         
        <field name="name">account.invoice.form</field>         
        <field name="model">account.invoice</field>         
        <field name="inherit_id" ref="PARENTFORMID" />         
        <field name="groups_id" eval="[(6,0, [ref('YOURSPECIFICGROUP')])]" />         
        <field name="arch" type="xml">             
            <xpath expr="//page[@string='Invoice Lines']" position="replace">    
            <!-- nothing here-->
            </xpath>
            <!-- OR -->
            <xpath expr="//page[@string='Invoice Lines']" position="attributes">     
               <attribute name="invisible">True</attribute>
            </xpath            
        </field>     
    </record>
0
Maximiliano
On 7/26/14, 7:37 PM

Can you find a solution, i need the same?

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: 7/16/13, 12:20 AM
Seen: 3372 times
Last updated: 4/27/16, 10:35 PM