Mon 27 May 2013 11:17:00 PM UTC, comment #1:
Emilien, now the script checks if the health module was not previously installed before creating the Betz Family data.
Also added command line options: passwords, modules to install and database name.
Features taken from Tryton Demo Script. Thanks Cédric Krier!
changeset 777:5b032a984550
|
Thu 23 May 2013 06:53:36 PM UTC, original submission:
If the demo script is run multiple times, it will:
- create multiple "GNU SOLIDARIO Hospital" parties
- create multiple "Insurator" parties
- end up crashing (Traceback copied below)
In the process of creating the Debian package for GNU Health, I plan to create a gnuhealth-demo package which will create the demo database for the user. The creation script will be run each time the package is updated.
My suggestion is to add a check as the first thing in the script, to see if the gnuhealth-demo database already exists. If that's the case, then don't go further and stop the script.
Traceback (most recent call last):
File "../health_demo_server.py", line 192, in <module>
LoadBetzFamilyInfo()
File "../health_demo_server.py", line 82, in LoadBetzFamilyInfo
party.save()
File "/usr/lib/python2.7/dist-packages/proteus/__init__.py", line 649, in save
self.__id = self._proxy.create(values, context)
File "/usr/lib/python2.7/dist-packages/proteus/config.py", line 144, in _call_
result = rpc.result(meth(args, *kwargs))
File "/usr/lib/python2.7/dist-packages/trytond/modules/health/health.py", line 578, in create
return super(PartyPatient, cls).create(values)
File "/usr/lib/python2.7/dist-packages/trytond/modules/party/party.py", line 165, in create
return super(Party, cls).create(values)
File "/usr/lib/python2.7/dist-packages/trytond/model/modelsql.py", line 371, in create
cls.raise_user_error(error)
File "/usr/lib/python2.7/dist-packages/trytond/error.py", line 70, in raise_user_error
raise UserError(error)
trytond.exceptions.UserError: ('UserError', ('This health professional is already assigned to a party', ''))
|