I create a new module for one deployment that i need, but when i plublish
my module i receive the next error:
gnuhealth@trytonserv01:~/gnuhealth/tryton/server/trytond-3.8.10/bin $
./trytond -d gnuhealth -u medica
Traceback (most recent call last):
File "./trytond", line 80, in <module>
server.TrytonServer(options).run()
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/server.py",
line 113, in run
Pool(db_name).init(update=self.options.update, lang=lang)
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/pool.py",
line 155, in init
lang=lang)
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/modules/__init__.py",
line 427, in load_modules
_load_modules()
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/modules/__init__.py",
line 394, in _load_modules
load_module_graph(graph, pool, update, lang)
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/modules/__init__.py",
line 234, in load_module_graph
cls.__register__(module)
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/model/modelsql.py",
line 138, in __register__
table = TableHandler(Transaction().cursor, cls, module_name)
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/backend/postgresql/table.py",
line 71, in __init__
% (self.table_name, default))
File
"/home/gnuhealth/gnuhealth/tryton/server/trytond-3.8.10/trytond/backend/postgresql/database.py",
line 296, in execute
return self.cursor.execute(sql)
psycopg2.ProgrammingError: no existe la relación
«medica_accounting_entpservices_id_seq»
This is the code, i don't see why receive this error, the model at database
level is correct, i create this model on mysql for testing. But when i put
this on tryton, doesn't work.
# -*- coding: utf-8 -*-
##############################################################################
#
# Module developed by Mauricio Martinez for Torre Medica Santa Anita
##
##############################################################################
import datetime
from trytond.model import ModelView, ModelSQL, fields, ModelSingleton,
Unique
from trytond.pyson import Eval, Equal
from trytond.pool import Pool
from trytond.modules.product import price_digits
__all__ =
['AccountingServices','AccountingServicesLine','AccountingEntpServices','AccountingEntpServicesLine']
class AccountingServices(ModelSQL, ModelView):
'Servicios de Cuenta Individual'
__name__ = 'medica.accounting_services'
name = fields.Char('ID',readonly=True)
account_code = fields.Char('Codigo')
clientAccount = fields.Many2One('gnuhealth.patient', 'Paciente')
accounting_date = fields.Date('Fecha')
state = fields.Selection([('1', 'Borrador'),
('2', 'Abierto'),
('3', 'Cancelado'),
('4', 'Cerrado'),], 'Estado')
account_type = fields.Selection([('1', 'Consulta Unica'),
('2', 'Tratamiento'),], 'Tipo')
accounting_services_line =
fields.One2Many('medica.accounting_services.line',
'accounting_services_line', 'Servicios', help="Accounting Services Line")
@staticmethod
def default_accounting_date():
return datetime.date.today()
class AccountingServicesLine(ModelSQL, ModelView):
'Linea de Servicios de Cuenta Individual'
__name__ = 'medica.accounting_services.line'
#line_service = fields.Many2One('medica.accounting_services','Line
Service',readonly=True)
code = fields.Char('ID',readonly=True)
concepto = fields.Char('Concepto')
producto = fields.Many2One('product.product','Producto')
descripcion = fields.Many2One('product.template','Descripcion')
cantidad = fields.Float('Cantidad',
digits=(16, Eval('unit_digits', 2)),
states={
'invisible': Eval('type') != 'line',
'required': Eval('type') == 'line',
},
depends=['type', 'unit_digits'])
unit_digits = fields.Function(fields.Integer('Unit Digits'),
'on_change_with_unit_digits')
costo_unitario = fields.Numeric('Costo Unitario', digits=price_digits,
states={
'invisible': Eval('type') != 'line',
'required': Eval('type') == 'line',
},
depends=['type'])
total_costo = fields.Numeric('Costo Total')
iva_aplicar = fields.Numeric('IVA')
event_type = fields.Selection([('1', 'Consumo'),
('2', 'Abono'),], 'Tipo Evento')
class AccountingEntpServices(ModelSQL, ModelView):
'Servicios de Cuenta Empresarial'
__name__ = 'medica.accounting_Entpservices'
name = fields.Char('ID',readonly=True)
enterprise_code = fields.Char('Cuenta Empresarial')
accountingEntp_date = fields.Date('Fecha')
clientAccount = fields.Many2One('company.company', 'Empresa')
state = fields.Selection([('1', 'Draft'),
('2', 'Abierto'),
('3', 'Cancelado'),
('4', 'Cerrado'),], 'Estado')
accounting_Eservices_line =
fields.One2Many('medica.accounting_Entpservices.line',
'accounting_Entpservices_line', 'Servicios', help="Accounting EntpServices
Line")
@staticmethod
def default_accountingEntp_date():
return datetime.date.today()
class AccountingEntpServicesLine(ModelSQL, ModelView):
'Linea de Cuenta Empresarial'
__name__ = 'medica.accounting_Entpservices.line'
employee_code = fields.Char('Clave Empleado')
#line_service =
fields.Many2One('medica.accounting_services','Empleados',readonly=True)
line_service = fields.One2Many('medica.accounting_services',
'accounting_services', 'Empleados', help="Accounting Services Line")
employee_date = fields.Date('Fecha')
account_type = fields.Selection([('1', 'VIP'),
('2', 'Gerente'),
('3', 'Coordinador'),
('4', 'Empleado'),], 'Tipo Empleado')
adeudo_actual = fields.Numeric('Adeudo Actual')
please, help me to identify my error, i don't sleep because i don't see the
error, jeejjejeje.
thanks team!
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/6c59d5db-b0c4-4e44-8c3a-e6e6ff35f5e3%40googlegroups.com.