Help

2

Restricting user from editing the unit price for product.

Avatar
charlesraj

Hi all,

My client do not want anyone to change unit price from sales order line. Rather they want to control changing price from masterdata only.

I checked the filed 'price_unit' from sale order line and the field is readonly

I checked the view 'sale.order.line.form2' and the 'price_unit' has no readonly attributes.

Can anyone help me to make this field readonly so that no one can change the value?

Thanks

3 Comments
Avatar
Discard
Avatar
omadegbo
-

Any head way with this?

Avatar
charlesraj
-

No way to solve this

Avatar
omadegbo
-

Really weird! I thought it would be part of the Rules and security section.

2 Answers
0
Avatar
Bharat Devnani
Best Answer

It's better to customize the functionality by making the price unit readonly (Note: by default onchange will not be applicable on readonly, to bypass this you can refer to https://bharatrdevnani.wordpress.com/2016/02/04/readonly-attributes-onchange-odoo/)


OR


Write one more onchange on price unit, if someone tries to change the price unit field, a new onchange method will be triggered to get the values from the product master again.


Best Regards,

Bharat

Avatar
Discard
0
Avatar
Boris Ghelman
Best Answer

After many days investigating and googleling,  I solved using this function, very usefull, is not read only  , is a :  don't allow users to quote below the sales price of products, and you can make your particular changes.

 

http://stackoverflow.com/questions/23359684/dont-allow-to-quote-below-the-sales-price-of-a-product-in-openerp

 

 

Avatar
Discard