Community mailing list archives

community@mail.odoo.com

Re: Benevolent Record Dictator

by
dar
- 11/04/2015 00:17:54
Hi Chico, thanks for your answer.

I'm not sure, if I understand you or if we are on the same page, either is possible.

I have Model A.
I have Records 1, 2 & 3.
3 is "protected" (corresponds to: [('create_uid','!=',1)] permissions: write, unlink) - means: 3 has create_uid = 1

Now on model 1 & 2 user X can do anything he wants, but on record 3 he can't. He doesn't know, that he can't upfront. So I want to disable the edit button for record 3.

Is this possible without JS? (remember, that the button interchange from view mode to edit mode is JS based on a pure client side contextual state: "mode")



Saludos Cordiales
David Arnold

David Arnold BA HSG / Analista
315 304 13 68/ dar@devco.co

devCO - empresa de consultoría de sistemas (en fundación)
http://www.devco.co

This e-mail message may contain confidential or legally privileged information and is intended only for the use of the intended recipient(s). Any unauthorized disclosure, dissemination, distribution, copying or the taking of any action in reliance on the information herein is prohibited. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, or contain viruses. Anyone who communicates with us by e-mail is deemed to have accepted these risks. devCO is not responsible for errors or omissions in this message and denies any responsibility for any damage arising from the use of e-mail. Any opinion and other statement contained in this message and any attachment are solely those of the author and do not necessarily represent those of the company.


2015-11-03 20:22 GMT-05:00 Chico Venancio <chicocvenancio@gmail.com>:
No JS needed. Just group security. 

The edit button needs to be restricted to a certain security group, ideally a group congruent with the users who have write access on the.

Chico Venancio
CEO e Diretor de Criação
VM TECH - (98) 9 8800 2743

2015-11-03 21:22 GMT-03:00 David Arnold <dar@devco.co>:
Hi

I doublechecked, and yes, the edit button is "available" on the tax record which was protected by:

[('create_uid','!=',1)] permissions: write, unlink

Is there any elegant way to disable the create button? I reference the html for what I mean...

<button accesskey="E" class="oe_form_button_edit btn btn-default btn-sm" type="button">Edit</button>

I have a hard time to imagine that I'm the first person stumbling over this behavior...

Christian, where you referring to the same? This would imply that there has been a js script that made this magic in v8, which has gone in v9... Frankly, I doubt that.

_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe


_______________________________________________
Mailing-List: https://www.odoo.com/groups/community-59
Post to: mailto:community@mail.odoo.com
Unsubscribe: https://www.odoo.com/groups?unsubscribe