[IMP]: stock: stock_move if state is Done raise an exception if the user is trying to modfiy the product detail
bzr revid: sbh@tinyerp.com-20100831063928-l18f61er7k8eutwh
This commit is contained in:
parent
9f9da50c81
commit
3ba7ce115e
|
@ -1444,6 +1444,20 @@ class stock_move(osv.osv):
|
||||||
'date_expected': time.strftime('%Y-%m-%d %H:%M:%S'),
|
'date_expected': time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
|
if not context:
|
||||||
|
context={}
|
||||||
|
group_id = self.pool.get('res.groups').search(cr, uid, [('name', 'in', ('Administration / Configuration','Administration / Access Rights'))])
|
||||||
|
user_obj = self.pool.get('res.users')
|
||||||
|
user_rec = user_obj.read(cr, uid, uid)
|
||||||
|
for move in self.browse(cr, uid, ids):
|
||||||
|
if move.state=='done':
|
||||||
|
for i in group_id:
|
||||||
|
if i not in user_rec['groups_id']:
|
||||||
|
raise osv.except_osv(_('Error!'), _('Quantities, UoMs, Products and Locations cannot be modified on stock moves in Done state (except by the Administrator ' ))
|
||||||
|
#
|
||||||
|
return super(stock_move, self).write(cr, uid, ids, vals, context=context)
|
||||||
|
|
||||||
def copy(self, cr, uid, id, default=None, context=None):
|
def copy(self, cr, uid, id, default=None, context=None):
|
||||||
if default is None:
|
if default is None:
|
||||||
default = {}
|
default = {}
|
||||||
|
|
Loading…
Reference in New Issue