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 hide workflow buttons

By
Samba Faye
on 12/10/13, 10:51 AM 1,561 views

Hi, How can I do to hide the buttons of the workflow when editing a leave request? What I want is: when you click on the edit button to edit a leave request, workflow buttons are hidden. How can I do it?

0

I had this same problem (and in my humble opinion, this should be a native option in OpenERP) and finaly I found the answer here:

help.openerp.com/question/11853/inverse-of-css-class-oe_edit_only

(I guess my karma isn't high enough to post a link to the answer, so i'll adapt it)

In my case, since I'm developing an entire new module, I created a CSS file with the following content (so, no need to edit base.css!)

.openerp .oe_form_editable .oe_view_mode_only, .openerp .oe_form_editable .oe_form_field:empty {
  display: none !important;
}

Don't forget to add it's declaration it in __openerp__.py:

'css': [ 'static/css/uc_css.css' ],

And to add the class to your workflow buttons

<button name="submit_request" class="oe_highlight oe_view_mode_only" string="Submit Request" type="workflow" states="draft"/>

And this way you can remove all extra (and confusing) buttons on form editing view, leaving only the "Save" or cancel options to the user

Thanks for the edit! :)

Luis Filipe Castanheira
on 4/8/14, 11:10 AM
0
El hadji Dem
On 2/9/15, 11:04 AM

Try this: http://stackoverflow.com/questions/23568345/how-to-hide-a-workflow-button-based-on-user-in-openerp-7

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

0 follower(s)

Stats

Asked: 12/10/13, 10:51 AM
Seen: 1561 times
Last updated: 3/16/15, 8:10 AM