I have two USER: USER 1 and USER 2
USER 1 will have an access for over all accounting while USER 2 has limitations like this I want to hide the VALIDATE BUTTON How will i going to give limitation in each USERS? I've already created a groups but it didn't work the button is still there. Anyone here does have an idea to this?? Please any help is much appreciated. Thanks in advance..
<xpath expr="//button[@name='invoice_open']" position="replace">
<button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_highlight" groups="biz1_pcci_dec9.group_pcci_accounting_user2"/>
Did you use the groups tag in your XML code when overriding this button? That should help. Also make sure that you are on the right form-view. Make sure that in your xml-view your replace the button entirely. Sometimes (for reasons unknown) the adding of attributes does not seem to work.
Also, in developer mode, make sure that your groups configuration was actually set by opening the form view that you are on.
The last method (which is NOT recommended and considered a dirty hack) is to overwrite the method that is called from the button and have Odoo search for a list of user that can press it. If the current user (uid) is not in that list, raise an error.
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
|Asked: 12/12/14, 3:11 AM|
|Seen: 801 times|
|Last updated: 3/16/15, 8:10 AM|