show owner of dlz
parent
68a5621d4b
commit
5d1a7ba4f1
|
@ -24,6 +24,8 @@
|
||||||
<field name="company_id" invisible="1"/>
|
<field name="company_id" invisible="1"/>
|
||||||
</group>
|
</group>
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
|
<field name="create_user_id"/>
|
||||||
|
<field name="write_user_id"/>
|
||||||
</group>
|
</group>
|
||||||
<group span="6" columns="1">
|
<group span="6" columns="1">
|
||||||
<template>
|
<template>
|
||||||
|
|
|
@ -2,6 +2,7 @@ import time
|
||||||
|
|
||||||
from netforce.model import Model, fields, get_model
|
from netforce.model import Model, fields, get_model
|
||||||
from netforce.access import get_active_company, get_active_user, set_active_user
|
from netforce.access import get_active_company, get_active_user, set_active_user
|
||||||
|
from netforce.database import get_connection
|
||||||
|
|
||||||
class Dialyzer(Model):
|
class Dialyzer(Model):
|
||||||
_name="clinic.dialyzer"
|
_name="clinic.dialyzer"
|
||||||
|
@ -10,6 +11,16 @@ class Dialyzer(Model):
|
||||||
_name_field="number"
|
_name_field="number"
|
||||||
_multi_company=True
|
_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={
|
_fields={
|
||||||
"name": fields.Char("Name",search=True),
|
"name": fields.Char("Name",search=True),
|
||||||
"number": fields.Char("Number",required=True,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']]),
|
"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),
|
'department_id': fields.Many2One("clinic.department","Department",search=True),
|
||||||
"membrane_type": fields.Selection([("unsub","Unsub cellul"),("sub","Sub cellul"),("synthetic","Synthetic")],"Membrane Type"),
|
"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={}):
|
def _get_number(self,context={}):
|
||||||
|
|
Loading…
Reference in New Issue