Sun 24 Aug 2014 06:12:26 PM UTC, comment #5:
Just to double check. This is a newly created party, with the default activation date on the current GNU Health.
health26=# select name, activation_date from party_party;
name | activation_date
------------------------+-----------------
Rejon | 2014-08-24
No issues found when creating a new party and assigning it a default activation date.
But you are right, the type should be datetime.date, so no need for type casting . I just commit the changes to the default branch
Thanks Oscar !
|
Sun 24 Aug 2014 03:26:22 PM UTC, comment #3:
The field activation_date, require date type in this model:
activation_date = fields.Date(
'Activation date', help='Date of activation of the party')
But with this simple test, you can see that fail, default method.
line 24 health.py file:
>>> from datetime import datetime, timedelta
line 300 health.py file:
>>> datetime.today()
datetime.datetime(2014, 8, 24, 10, 18, 28, 424916)
@staticmethod
def default_activation_date():
return datetime.today()
The problem is that datetime.today() return datetime not date as the field expect.
|
Fri 22 Aug 2014 04:08:11 AM UTC, original submission:
I installed tryton 3.2 and several basic official modules, so next I try install only the health module, with
$trytond -d DATABASENAME -u health
I get this:
[Fri Aug 22 03:34:59 2014] INFO:modules:health
[Fri Aug 22 03:34:59 2014] INFO:modules:health:register gnuhealth.operational_area
[Fri Aug 22 03:35:01 2014] INFO:modules:health:register gnuhealth.operational_sector
[Fri Aug 22 03:35:01 2014] INFO:modules:health:register gnuhealth.du
[Fri Aug 22 03:35:02 2014] INFO:modules:health:register gnuhealth.occupation
[Fri Aug 22 03:35:02 2014] INFO:modules:health:register gnuhealth.ethnicity
[Fri Aug 22 03:35:02 2014] INFO:modules:health:register party.party
Traceback (most recent call last):
File "/home/oscar/.virtualenvs/gnu_tryton32/bin/trytond", line 113, in <module>
trytond.server.TrytonServer(options).run()
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/server.py", line 123, in run
Pool(db_name).init(update=update, lang=lang)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/pool.py", line 151, in init
lang=lang)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 429, in load_modules
_load_modules()
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 397, in _load_modules
load_module_graph(graph, pool, lang)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/modules/__init__.py", line 237, in load_module_graph
cls.__register__(module)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/modules/health/health.py", line 386, in _register_
super(PartyPatient, cls).__register__(module_name)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/model/modelsql.py", line 112, in _register_
default_fun, field_size, string=field.string)
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/backend/postgresql/table.py", line 270, in add_raw_column
(column_format(default),))
File "/home/oscar/.virtualenvs/gnu_tryton32/local/lib/python2.7/site-packages/trytond/model/fields/date.py", line 31, in sql_format
or value.time() == datetime.time())
AssertionError
So trying from ui I get the same message.
So all modules was installed with pip, including trytond_health
|