prevent user to create/write/delete sickbed but can still update status of sickbed
parent
f32fd7dc19
commit
b984eb4c2a
|
@ -907,9 +907,13 @@ class HDCase(Model):
|
|||
obj.write({
|
||||
'state': 'completed',
|
||||
})
|
||||
#FIXME allow user to write sickbed status
|
||||
user_id=get_active_user()
|
||||
set_active_user(1)
|
||||
obj.sickbed_id.write({
|
||||
'state': 'available',
|
||||
})
|
||||
set_active_user(user_id)
|
||||
return {
|
||||
'next': {
|
||||
'name': 'clinic_hd_case',
|
||||
|
@ -1236,6 +1240,8 @@ class HDCase(Model):
|
|||
#################################################3
|
||||
|
||||
if 'sickbed_id' in vals.keys():
|
||||
user_id=get_active_user()
|
||||
set_active_user(1)
|
||||
if vals['sickbed_id']!=obj.sickbed_id.id and obj.state!='draft':
|
||||
if obj.sickbed_id:
|
||||
obj.sickbed_id.write({
|
||||
|
@ -1245,6 +1251,7 @@ class HDCase(Model):
|
|||
sb.write({
|
||||
'state': 'not_available',
|
||||
})
|
||||
set_active_user(user_id)
|
||||
self.function_store(ids)
|
||||
super().write(ids,vals,**kw)
|
||||
obj=self.browse(ids)[0]
|
||||
|
|
|
@ -3,7 +3,7 @@ from netforce.model import Model, fields
|
|||
class ProductCateg(Model):
|
||||
_inherit="product.categ"
|
||||
_fields={
|
||||
'expense': fields.Boolean("Expense"),
|
||||
'expense': fields.Boolean("Show On HD Case Expense Tab"),
|
||||
}
|
||||
|
||||
_defaults={
|
||||
|
|
Loading…
Reference in New Issue