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

Hide edit button from sales order IF a field is true

By
Tony Richmond
on 7/3/13, 3:20 AM 1,656 views

Hi,

I'm developing a module that links openerp to a warehouse management system (Accellos One). I need to prevent sales orders from being edited while the orders are processed by the warehouse management system.

The module adds two fields to the sales order view. One of these fields is boolean. When this field is set to true, I need to remove the Edit button, When false, it need to be visible.

I can hide the edit button in the view.xml:

<xpath expr='//form[@string="Sale Order"]' position='attributes'>
     <attribute name="edit">false</attribute>
</xpath>

How do I hide the edit button when my filed is set to true?

Many thanks, Tony.

What do you mean with this question? By default, when an order is confirmed, you cannot edit anything, except the customer reference and the notes on the order. What causes you to want to remove the Edit-button?

patrick
on 7/3/13, 10:33 AM

Thanks Patrick, you right, nothing of any importance can be edited after the order has been confirmed. What i need to do is to stop modifications to the Delivery Orders. Our warehouse software takes care of this.

Tony Richmond
on 7/4/13, 2:55 AM

In that case you want to remove the edit-rights of every one regarding stock.picking en stock.move. But do not remove create, because they need to create the Delivery order.....

patrick
on 7/9/13, 8:09 AM
2

Ghanshyam Prajapati

--Ghanshyam Prajapati--
1377
| 4 4 8
Pune, India
--Ghanshyam Prajapati--
OpenERP Developer
Ghanshyam Prajapati
On 7/3/13, 7:34 AM

You can use Access Rights and Groups instead of hide edit button.

See Following Links,

Security in OpenERP: users, groups

But his question is about people who have access rights, and want to hide the edit, depending on a valiue of the boolean-field.

patrick
on 7/3/13, 10:20 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: 7/3/13, 3:20 AM
Seen: 1656 times
Last updated: 3/16/15, 8:10 AM