hi, im try to use trytond-admin -d test -u z_nurse_call
command, to add my own module to gnuhealth and this is my module:
class NurseCall(ModelSQL, ModelView):
"Nurse Call"
__name__ = "arnika.nurseCall"
__rec_name = "name"
name = fields.Many2One('gnuhealth.patient', 'Patient')
date = fields.DateTime('Date')
bed = fields.Many2One('gnuhealth.hospital.bed', 'Hospital Bed',)
health_professional = fields.Many2One('gnuhealth.healthprofessional','Health Professional', readonly=True)
@classmethod
def __setup__(cls):
super().__setup__()
t = cls.__table__()
cls._sql_constraints = [
('name_uniq', Unique(t, t.name), 'The Name must be unique !'),]
and i get this error :
3636 140440737433408 [2023-04-05 13:21:46,503] WARNING py.warnings /usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import fnmatch, glob, traceback, errno, sys, atexit, imp, stat
Traceback (most recent call last):
File "gnuhealth/tryton/server/trytond-6.0.27/bin/trytond-admin", line 23, in <module>
admin.run(options)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/admin.py", line 53, in run
pool.init(update=options.update, lang=list(lang),
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/pool.py", line 164, in init
restart = not load_modules(
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/modules/__init__.py", line 438, in load_modules
_load_modules(update)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/modules/__init__.py", line 406, in _load_modules
load_module_graph(graph, pool, update, lang)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/modules/__init__.py", line 238, in load_module_graph
cls.__register__(module)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/model/modelsql.py", line 228, in __register__
table = cls.__table_handler__(module_name)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/model/modelsql.py", line 212, in __table_handler__
return backend.TableHandler(cls, module_name, history=history)
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/backend/postgresql/table.py", line 56, in __init__
cursor.execute(
File "/home/gnuhealth/gnuhealth/tryton/server/trytond-6.0.27/trytond/backend/postgresql/database.py", line 74, in execute
cursor.execute(self, sql, args)
psycopg2.errors.UndefinedTable: relation "arnika_nursecall_id_seq" does not exist
any help make me happy .