master
David Janssens 2014-08-19 16:42:24 +07:00
parent 4f11da524c
commit d148bf8178
1 changed files with 4 additions and 4 deletions

View File

@ -1,11 +1,11 @@
from netforce.model import add_method,add_default
from netforce.log import app_log
from datetime import *
from dateutil.relativedelta import *
import logging
@add_method("hos.patient")
def get_age(self,ids,context={}):
logging.info("get_age")
app_log.info("get_age")
vals={}
for obj in self.browse(ids):
if obj.birth_date:
@ -17,11 +17,11 @@ def get_age(self,ids,context={}):
@add_method("hos.visit")
def set_done(self,ids,context={}):
logging.info("set_done")
app_log.info("set_done")
obj=self.browse(ids)[0]
obj.write({"state":"done"})
@add_default("hos.visit","date")
def get_date(self,context={}):
logging.info("get_date")
app_log.info("get_date")
return datetime.today().strftime("%Y-%m-%d")