bool object ?

37 views
Skip to first unread message

Cato Nano

unread,
Jan 21, 2018, 4:33:09 AM1/21/18
to tryton
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

Cédric Krier

unread,
Jan 21, 2018, 5:05:06 AM1/21/18
to tryton
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: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Cato Nano

unread,
Jan 21, 2018, 10:58:53 AM1/21/18
to tryton
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

Cédric Krier

unread,
Jan 21, 2018, 11:50:09 AM1/21/18
to tryton
On 2018-01-21 07:58, Cato Nano wrote:
> 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

Cato Nano

unread,
Jan 22, 2018, 1:02:11 PM1/22/18
to tryton
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

Sergi Almacellas Abellana

unread,
Jan 23, 2018, 3:25:44 AM1/23/18
to try...@googlegroups.com
El 22/01/18 a les 19:02, Cato Nano ha escrit:
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

Cato Nano

unread,
Jan 23, 2018, 11:00:36 AM1/23/18
to tryton
Yes Sergi, that helped.

Thanks

Now There are some other problems but the error messages are clearer at least
Reply all
Reply to author
Forward
0 new messages