Discussion:
[tryton] bool object ?
Cato Nano
2018-01-21 09:33:08 UTC
Permalink
I' m getting this error

$ tryton
/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form.py:48: Warning: value "0" of type 'guint' is invalid or out of range for property 'n-columns' of type 'guint'
self.table = gtk.Table(1, col)
ERROR:tryton.common.common:Traceback (most recent call last):
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'

'bool' object has no attribute 'get'


I understand that record[field] returns a boolean

How is that ?

I have a bunch of calculated fields on my Bolletta line, but when I click the "Ok" button, this happens

Thanks
--
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/162f1d09-04cf-48b8-98a9-57245e53ad32%40googlegroups.com.
Cédric Krier
2018-01-21 10:04:34 UTC
Permalink
Post by Cato Nano
I' m getting this error
$ tryton
/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form.py:48: Warning: value "0" of type 'guint' is invalid or out of range for property 'n-columns' of type 'guint'
self.table = gtk.Table(1, col)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'
'bool' object has no attribute 'get'
I understand that record[field] returns a boolean
How is that ?
The sequence attribute has a value that is not a field name.

I submit https://bugs.tryton.org/issue7073 to improve the exception.

Also you should consider using at least the standard ModuleTestCase
which should catch such errors.
--
Cédric Krier - B2CK SPRL
Email/Jabber: ***@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
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/20180121100434.GC4239%40kei.
Cato Nano
2018-01-21 15:58:53 UTC
Permalink
Post by Cédric Krier
Post by Cato Nano
I' m getting this error
$ tryton
/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form.py:48: Warning: value "0" of type 'guint' is invalid or out of range for property 'n-columns' of type 'guint'
self.table = gtk.Table(1, col)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'
'bool' object has no attribute 'get'
I understand that record[field] returns a boolean
How is that ?
The sequence attribute has a value that is not a field name.
I submit https://bugs.tryton.org/issue7073 to improve the exception.
Also you should consider using at least the standard ModuleTestCase
which should catch such errors.
--
Cédric Krier - B2CK SPRL
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
ok, thanks

The manual says that I nee dto run

run-tests.py -m my_module

but I can't find it

It' s not a binary in my virtualenv

With grep, I found this file
env/lib/python3.6/site-packages/trytond/tests/__pycache__/run-tests.cpython-36.pyc

How am I supposed to call it ?

Please forgive my naive question
--
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/25596692-8b15-4ad5-a248-41e9684beebe%40googlegroups.com.
Cédric Krier
2018-01-21 16:49:38 UTC
Permalink
Post by Cato Nano
The manual says that I nee dto run
run-tests.py -m my_module
but I can't find it
It' s not a binary in my virtualenv
With grep, I found this file
env/lib/python3.6/site-packages/trytond/tests/__pycache__/run-tests.cpython-36.pyc
How am I supposed to call it ?
$ python -m trytond.tests.run-tests -m my_module
--
Cédric Krier - B2CK SPRL
Email/Jabber: ***@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
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/20180121164938.GF4239%40kei.
Cato Nano
2018-01-22 18:02:11 UTC
Permalink
Post by Cédric Krier
Post by Cato Nano
The manual says that I nee dto run
run-tests.py -m my_module
but I can't find it
It' s not a binary in my virtualenv
With grep, I found this file
env/lib/python3.6/site-packages/trytond/tests/__pycache__/run-tests.cpython-36.pyc
How am I supposed to call it ?
$ python -m trytond.tests.run-tests -m my_module
--
Cédric Krier - B2CK SPRL
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
Ok, I managed to pass the tests but the error in the client remains

These are the tests
$ python run-tests.py -m tributi
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead.
module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143: DeprecationWarning: This method will be removed in future versions. Use 'parser.read_file()' instead.
module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:281: UserWarning: Unable to remove not null with SQLite backend
warnings.warn('Unable to remove not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:245: UserWarning: Unable to drop foreign key with SQLite backend
warnings.warn('Unable to drop foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:289: UserWarning: Unable to drop constraint with SQLite backend
warnings.warn('Unable to drop constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:176: UserWarning: Unable to set default on column with SQLite backend
warnings.warn('Unable to set default on column with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:279: UserWarning: Unable to set not null with SQLite backend
warnings.warn('Unable to set not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:286: UserWarning: Unable to add constraint with SQLite backend
warnings.warn('Unable to add constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:242: UserWarning: Unable to add foreign key with SQLite backend
warnings.warn('Unable to add foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/model/fields/function.py:100: DeprecationWarning: inspect.getargspec() is deprecated, use inspect.signature() or inspect.getfullargspec()
if 'names' in inspect.getargspec(method)[0]:
----------------------------------------------------------------------
Ran 13 tests in 8.199s

OK


And this is the error in the client when I go to save a line

ERROR:tryton.common.common:Traceback (most recent call last):
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'

'bool' object has no attribute 'get'



The sequence attribute is not a field name

The attribute of which field are you referring to ?

Thanks
Ciao
--
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/5eb76b9d-8ed2-4178-a75c-caa12e042a58%40googlegroups.com.
Sergi Almacellas Abellana
2018-01-23 08:25:41 UTC
Permalink
Post by Cato Nano
And this is the error in the client when I go to save a line
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'
'bool' object has no attribute 'get'>
The sequence attribute is not a field name
The attribute of which field are you referring to ?
This is about a tree view which have a sequence attribute which is wrong
as the pointed field does not exist on the model.

You should either use a field from the model or remove the sequence
attribute.

Hope it helps.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
--
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/02a3f6bf-530c-3100-1ecc-bc91d074fa73%40koolpi.com.
Cato Nano
2018-01-23 16:00:36 UTC
Permalink
Post by Sergi Almacellas Abellana
Post by Cato Nano
And this is the error in the client when I go to save a line
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/win_form.py", line 421, in response
self.callback(result)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 364, in <lambda>
WinForm(self.screen, lambda a: update_sequence(), new=True,
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/view/form_gtk/one2many.py", line 355, in update_sequence
self.screen.group.set_sequence(field=sequence)
File "/home/catonano/tryton-client/lib/python2.7/site-packages/tryton/gui/window/view_form/model/group.py", line 316, in set_sequence
value = record[field].get(record)
AttributeError: 'bool' object has no attribute 'get'
'bool' object has no attribute 'get'>
The sequence attribute is not a field name
The attribute of which field are you referring to ?
This is about a tree view which have a sequence attribute which is wrong
as the pointed field does not exist on the model.
You should either use a field from the model or remove the sequence
attribute.
Hope it helps.
--
Sergi Almacellas Abellana
www.koolpi.com
Yes Sergi, that helped.

Thanks

Now There are some other problems but the error messages are clearer at least
--
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/fb687ac6-5410-4a18-ae21-f3950514df4d%40googlegroups.com.
Loading...