El 22/01/18 a les 05:11, Cato Nano ha escrit:
> In testing my module for the first time, this error is reported
> 
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/tests/test_tryton.py",
>  line 198, in wrapper
>     result = func(*args, **kwargs)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/tests/test_tryton.py",
>  line 361, in test_field_methods
>     getattr(record, attr)()
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/model/fields/field.py",
>  line 106, in wrapper
>     return func(self, *args, **kwargs)
>   File 
> "/home/catonano/tributi/build/lib/trytond/modules/tributi/affissione.py", 
> line 38, in on_change_with_fattoreGiorni
>     ng = abs((self.on_change_with_bollettaDataFine() - 
> self.on_change_with_bollettaDataInizio()).days)
> TypeError: unsupported operand type(s) for -: 'NoneType' and 'NoneType'
> 
> ----------------------------------------------------------------------

The problem is that both on_change functions return a None value and
python does not know how too substract None from None. That's because
the test suite call all on_change functions with an empty object to
ensure that they correctly work when there is no value on the form.

You should take in account None values on your function.
> 
> 
> but when I run it in the GUI, fattoreGiorni DOES WORK
> 
> I swear !
> 
> You can see a picture here
> https://imgur.com/a/kUUjs
> 


-- 
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/2709c9d9-0dbc-7403-1881-3373f7782c93%40koolpi.com.

Reply via email to