diff --git a/netforce_clinic/layouts/clinic_dialyzer_form.xml b/netforce_clinic/layouts/clinic_dialyzer_form.xml
index 583ad80..63b996f 100644
--- a/netforce_clinic/layouts/clinic_dialyzer_form.xml
+++ b/netforce_clinic/layouts/clinic_dialyzer_form.xml
@@ -24,6 +24,8 @@
+
+
diff --git a/netforce_clinic/models/dialyzer.py b/netforce_clinic/models/dialyzer.py
index ac97b11..518776a 100644
--- a/netforce_clinic/models/dialyzer.py
+++ b/netforce_clinic/models/dialyzer.py
@@ -2,6 +2,7 @@ import time
from netforce.model import Model, fields, get_model
from netforce.access import get_active_company, get_active_user, set_active_user
+from netforce.database import get_connection
class Dialyzer(Model):
_name="clinic.dialyzer"
@@ -9,7 +10,17 @@ class Dialyzer(Model):
_audit_log=True
_name_field="number"
_multi_company=True
-
+
+ def _get_user(self,ids,context={}):
+ res={}
+ db=get_connection()
+ for r in db.query("""select id,create_uid, write_uid from clinic_dialyzer where id in %s""",tuple(ids)):
+ res[r['id']]={
+ 'create_user_id': r['create_uid'],
+ 'write_user_id': r['write_uid'],
+ }
+ return res
+
_fields={
"name": fields.Char("Name",search=True),
"number": fields.Char("Number",required=True,search=True),
@@ -32,6 +43,8 @@ class Dialyzer(Model):
"hd_cases_dlz": fields.One2Many("clinic.hd.case.dialyzer","dialyzer_id","Dialyzer History",domain=[['hd_case_id.state','in','waiting_payment','paid']]),
'department_id': fields.Many2One("clinic.department","Department",search=True),
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type"),
+ 'write_user_id': fields.Many2One("base.user","Updated By",function="_get_user",function_multi=True),
+ 'create_user_id': fields.Many2One("base.user","Create By",function="_get_user",function_multi=True),
}
def _get_number(self,context={}):