OpenERP can not save the readonly field in sale order

Bug #881974 reported by Abdellatif Benzbiria on 2011-10-26

This bug report was converted into a question: question #177080: OpenERP can not save the readonly field in sale order.

This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fleet manager

Bug Description

Salam ,

In a sale order line, I try to make price_unit readonly for certain group , so to do this :
1- I created 2 groups : Sales / Readonly price unit & Sales / Write price unit
2- I used fields_get to redfine rights access like this :
  if == 'Sales / Readonly price unit':
                        res[field].setdefault('states', {})
                        res[field]['states']['draft'] = [('readonly', False)]

                    if == 'Sales / Write price unit':
                        res[field].setdefault('states', {})
                        res[field]['states']['draft'] = [('readonly', False)]

Everything works fine except that by recording the sale order the unit price is set by default to 0.00 for users who have the readonly group.

Thanks for your help

if == 'Sales / Readonly price unit':
                        res[field].setdefault('states', {})
                        res[field]['states']['draft'] = [('readonly', True)]

Changed in fleetmanager:
status: New → Invalid
Andrea Garcia (andrea-garcia) wrote :

Readonly works to achieve save when you call a function or field from any resulting estimates and calls a function. For example 'amount_tax': fields.function(_amount_all, string='Taxes', digits_compute=dp.get_precision('Point Of Sale'), multi='all'),

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers