Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Raimon Esteve
Hola Manuel,

Si conoces python, no uses este modulo. Declara tus valores por defecto en
tu propio modulo.

Sobre lo que comentas, en la 3.8 lo desinstalas, actualizas y si quieres,
lo instalas de nuevo en la 4.0

Saludos


Re: [tryton-es] Agregar datos en Campo One2Many en un on_change

2017-02-13 Por tema Tatiana Quizhpe


El lunes, 13 de febrero de 2017, 4:09:46 (UTC-5), Sergi Almacellas Abellana 
escribió:
>
> El 11/02/17 a les 00:24, Tatiana Quizhpe ha escrit: 
> > Buscando información encontre el módulo [3] que se relaciona más o 
> > o  menos con lo que necesito, (claro que es en otro modelo) en el 
> > módulo [3] al hacer un Comprobante de Pago (voucher), cuando se 
> > cambia el Tercero se actualizan las lineas Pendientes de Pago, hice 
> > pruebas en la version 3.4 y 4.0 igual demora en presentar los registros, 
> > (esto cuando los registros pasan de 60). Espero su respuesta, gracias 
> > por la ayuda. 
> Entonces ya habria que mirar porqué tarda en cargar estos registros y si 
> se puede hacer algun parche para solucionar-lo. I en caso de encontrar 
> alguna mejora subirla como parche del cliente. 
>
> Gracias por la ayuda, cualquier cosa la haré saber.

Saludos


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Sergi Almacellas Abellana


On 13 de febrer de 2017 20.11.31 CET, Manuel Bailen 
 wrote:
>
>Hola de nuevo, el error no salta actualizando solo el módulo con la
>opción 
>-u default_value  pero sí aparece si actualizo la base de datos
>completa 
>con --all
>
>2017-02-13 11:34:29,321]
>WARNING:trytond.backend.postgresql.table:Unable to 
>migrate column login on table res_user_login_attempt from varchar() to 
>varchar(512).
>Exception in thread Thread-1:
>Traceback (most recent call last):
> File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
>self.run()
>  File "/usr/lib/python2.7/threading.py", line 754, in run
>self.__target(*self.__args, **self.__kwargs)
>  File 
>"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
>
>line 159, in load_default_values
>cls.set_default_values()
>  File 
>"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
>
>line 203, in set_default_values
>Model = pool.get(str(default_value.model.model))
>File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 172, in
>get
>return self._pool[self.database_name][type][name]
>KeyError: 'party.party'
>
>Perdón por la torpeza

Tengo una corazonada:

Puedes añadir el modulo party como dependencia del default_value? Esto deberia 
solucionar el problema (aunque de forma temporal)

Suerte!

-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi 
brevedad.


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Manuel Bailen

Hola de nuevo, el error no salta actualizando solo el módulo con la opción 
-u default_value  pero sí aparece si actualizo la base de datos completa 
con --all

2017-02-13 11:34:29,321] WARNING:trytond.backend.postgresql.table:Unable to 
migrate column login on table res_user_login_attempt from varchar() to 
varchar(512).
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
self.run()
  File "/usr/lib/python2.7/threading.py", line 754, in run
self.__target(*self.__args, **self.__kwargs)
  File 
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
 
line 159, in load_default_values
cls.set_default_values()
  File 
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
 
line 203, in set_default_values
Model = pool.get(str(default_value.model.model))
  File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 172, in get
return self._pool[self.database_name][type][name]
KeyError: 'party.party'

Perdón por la torpeza



Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Manuel Bailen
Muchas gracias Sergi por tu ayuda


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Sergi Almacellas Abellana

El 13/02/17 a les 12:12, Manuel Bailen ha escrit:

Solo aparecen estos dos Warnings

(tryton401) manuel@localhost:~/.tryton/t401$ python
trytond/bin/trytond-admin -c trytond.conf -d dv4 --logconf
config.logfile -u default_value
2017-02-13 11:08:53,266] INFO:server:using config.logfile as logging
configuration
file

2017-02-13 11:08:53,283]
INFO:trytond.backend.postgresql.database:connect to
"dv4"

2017-02-13 11:08:53,431]
WARNING:py.warnings:/usr/lib/python2.7/dist-packages/relatorio/templates/__init__.py:29:
UserWarning: Unable to load plugin 'chart'
  warnings.warn("Unable to load plugin '%s'" %
name)



Este es normal.



2017-02-13 11:08:54,163] WARNING:root:Post init hooks disabled

Este no se lo que es.

Però ahora te deberia saltar un error y no un warning :$

Lo siento, pero no te puedo decir mucho mas. Quizas contactando con el 
desarrollador del módulo el te pueda ayudar.


Un saludo,

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Manuel Bailen
Solo aparecen estos dos Warnings

(tryton401) manuel@localhost:~/.tryton/t401$ python 
trytond/bin/trytond-admin -c trytond.conf -d dv4 --logconf config.logfile 
-u default_value 
2017-02-13 11:08:53,266] INFO:server:using config.logfile as logging 
configuration 
file
 
 
2017-02-13 11:08:53,283] INFO:trytond.backend.postgresql.database:connect 
to 
"dv4"   
   
 
2017-02-13 11:08:53,431] 
WARNING:py.warnings:/usr/lib/python2.7/dist-packages/relatorio/templates/__init__.py:29:
 
UserWarning: Unable to load plugin 'chart' 
  warnings.warn("Unable to load plugin '%s'" % 
name)   
 
 



 
2017-02-13 11:08:54,163] WARNING:root:Post init hooks disabled  


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Sergi Almacellas Abellana

El 13/02/17 a les 11:44, Manuel Bailen ha escrit:

Perdón, aquí está.

Traceback (most recent call last):
  File "trytond/bin/trytond-admin", line 21, in 
admin.run(options)
  File "/home/manuel/.tryton/t401/trytond/trytond/admin.py", line 48, in run
Pool(db_name).init(update=options.update, lang=lang)
  File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 144, in
init
self.start()
  File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 97, in
start
register_classes()
  File "/home/manuel/.tryton/t401/trytond/trytond/modules/__init__.py",
line 362, in register_classes
mod_file, pathname, description)
  File
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/__init__.py",
line 5, in 
from .default_value import *
  File
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
line 165
@classmethod
^
IndentationError: unexpected unindent
Esto tiene pinta que no has modificado correctamente el fichero. Te 
explico con mas detalle. Debes reemplazar este trozo de código:


@classmethod
def load_default_values(cls, db_name, user):
sleep(5)
with Transaction().start(db_name, user):
try:
cls.set_default_values()
except:
logger.warning(
'Error loading default values. Try reload them 
again by '

'restarting the server')


Y dejarlo cómo:

@classmethod
def load_default_values(cls, db_name, user):
sleep(5)
with Transaction().start(db_name, user):
cls.set_default_values()

Una vez hecho el cambio, deberías volver a ejecutarlo y poner la 
excepción, que tiene que ser una de distinta.


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Manuel Bailen
Perdón, aquí está.

Traceback (most recent call last):
  File "trytond/bin/trytond-admin", line 21, in 
admin.run(options)
  File "/home/manuel/.tryton/t401/trytond/trytond/admin.py", line 48, in run
Pool(db_name).init(update=options.update, lang=lang)
  File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 144, in 
init
self.start()
  File "/home/manuel/.tryton/t401/trytond/trytond/pool.py", line 97, in 
start
register_classes()
  File "/home/manuel/.tryton/t401/trytond/trytond/modules/__init__.py", 
line 362, in register_classes
mod_file, pathname, description)
  File 
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/__init__.py", 
line 5, in 
from .default_value import *
  File 
"/home/manuel/.tryton/t401/trytond/trytond/modules/default_value/default_value.py",
 
line 165
@classmethod
^
IndentationError: unexpected unindent


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Sergi Almacellas Abellana

El 13/02/17 a les 11:40, Manuel Bailen ha escrit:


Entiendo que te refieres a lo siguiente,
Tras comentar el except:

Si, me refiero justo a esto però esta cortado :(

Debería ser un poco mas largo :P

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Manuel Bailen
Estos son todos los WARNINGS:

2017-02-13 10:07:45,988] 
WARNING:py.warnings:/usr/lib/python2.7/dist-packages/relatorio/templates/__init__.py:29:
 
UserWarning: Unable to load plugin 'chart'
  warnings.warn("Unable to load plugin '%s'" % name)

2017-02-13 10:07:46,723] WARNING:root:Post init hooks disabled
2017-02-13 10:07:55,745] WARNING:trytond.backend.postgresql.table:Unable to 
migrate column login on table res_user_login_attempt from varchar() to 
varchar(512).
2017-02-13 10:08:04,650] 
WARNING:trytond.modules.default_value.default_value:Error loading default 
values. Try reload them again by restarting the server
2017-02-13 10:10:16,210] WARNING:trytond.backend.postgresql.table:Unable to 
set column company of table bank_account-party_party not null !
Try to re-run: trytond.py --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE "bank_account-party_party" ALTER COLUMN "company" SET NOT NULL
2017-02-13 10:10:18,156] WARNING:trytond.backend.postgresql.table:Unable to 
set column date of table account_move_reconciliation not null !
Try to re-run: trytond.py --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE "account_move_reconciliation" ALTER COLUMN "date" SET NOT NULL
2017-02-13 10:13:46,749] WARNING:trytond.backend.postgresql.table:Unable to 
set column date of table account_move_reconciliation not null !
Try to re-run: trytond.py --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE "account_move_reconciliation" ALTER COLUMN "date" SET NOT NULL
2017-02-13 10:14:02,981] WARNING:trytond.backend.postgresql.table:Unable to 
set column date of table account_move_reconciliation not null !
Try to re-run: trytond.py --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE "account_move_reconciliation" ALTER COLUMN "date" SET NOT NULL
2017-02-13 10:14:05,602] WARNING:trytond.backend.postgresql.table:Unable to 
set column date of table account_move_reconciliation not null !
Try to re-run: trytond.py --update=module
If it doesn't work, update records and execute manually:
ALTER TABLE "account_move_reconciliation" ALTER COLUMN "date" SET NOT NULL



Re: [tryton-es] Agregar datos en Campo One2Many en un on_change

2017-02-13 Por tema Sergi Almacellas Abellana

El 11/02/17 a les 00:24, Tatiana Quizhpe ha escrit:

Buscando información encontre el módulo [3] que se relaciona más o
o  menos con lo que necesito, (claro que es en otro modelo) en el
módulo [3] al hacer un Comprobante de Pago (voucher), cuando se
cambia el Tercero se actualizan las lineas Pendientes de Pago, hice
pruebas en la version 3.4 y 4.0 igual demora en presentar los registros,
(esto cuando los registros pasan de 60). Espero su respuesta, gracias
por la ayuda.
Entonces ya habria que mirar porqué tarda en cargar estos registros y si 
se puede hacer algun parche para solucionar-lo. I en caso de encontrar 
alguna mejora subirla como parche del cliente.


Un saludo,

--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk


Re: [tryton-es] Problema con Migración 3.8 a 4.0

2017-02-13 Por tema Sergi Almacellas Abellana

El 12/02/17 a les 14:05, Manuel Bailen ha escrit:

Muchas gracias por responder Sergi,

Desde el cliente accediendo al módulo aparecen las dependencias de "ir"
y "res" como instaladas
tras la actualización accediendo desde pgadmin3 a la tabla
ir.module.dependecy también aparece la dependencia.


Entonces esta todo bien. Me he mirado con cariñó el módulo y la verdad 
que lo implementaria de otra forma, utilizando las funcionalidades de 
este patch:


https://bugs.tryton.org/issue4735



por otro lado, haciendo pruebas he observado que si reinicio el cliente
(SIN reiniciar el servidor) obtengo este otro error:

Traceback (most recent call last):
  File "/trytond/wsgi.py", line 47, in dispatch_request
return endpoint(request, **request.view_args)
  File "/trytond/protocols/dispatcher.py", line 61, in rpc
request, database_name, *request.params)
  File "/trytond/protocols/dispatcher.py", line 72, in login
session = security.login(database_name, user, password)
  File "/trytond/security.py", line 32, in login
session, = Session.create([{}])
  File "/trytond/model/modelsql.py", line 601, in create
cls._validate(sub_records)
  File "/trytond/model/modelstorage.py", line 894, in _validate
ctx_pref = User.get_preferences(context_only=True)
  File "/trytond/res/user.py", line 367, in get_preferences
preferences = cls._get_preferences(user, context_only=context_only)
  File "/trytond/modules/company/company.py", line 165, in _get_preferences
context_only=context_only)
  File "/trytond/res/user.py", line 332, in _get_preferences
res[field] = [x.id for x in getattr(user, field)]
  File "/trytond/model/modelstorage.py", line 1366, in __getattr__
read_data = self.read(list(ids), ffields.keys())
  File "/trytond/modules/company/company.py", line 214, in read
result = super(User, cls).read(ids, fields_names=fields_names)
  File "/trytond/res/user.py", line 231, in read
result = super(User, cls).read(ids, fields_names=fields_names)
  File "/trytond/model/modelsql.py", line 744, in read
getter_result = field.get(ids, cls, fname, values=result)
  File "/trytond/model/fields/many2many.py", line 96, in get
relations.append(Relation.search(clause, order=order))
  File "/trytond/model/modelsql.py", line 1120, in search
forder = field.convert_order(oexpr, tables, cls)
  File "/trytond/model/fields/many2one.py", line 236, in convert_order
if Target._rec_name in Target._fields:
AttributeError: type object 'res.group' has no attribute '_fields'



Tiene pinta que hay alguna cosa que no se ha inicilizado correctamente. 
Por cierto, en los logs de los servidores véis algun tipo de 
error/warning relacionado con este módulo?


Un saludo,


--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk