El 25/08/16 a les 10:02, Jesús Martín Jiménez ha escrit:
> Hi,
>
> I'm testing a customized module and I run into an issue I'm not sure how
> to resolve. My module has an extras_depend of stock_lot and an on_change
> method for lot field. It works well, but when I try to pass the unittest
> test, it fails with this traceback [1]. I'm not sure if it is a bug or
> the desired behavior.
For me is the expected behavior if you define the on_change_lot method
when the stock_lot module is not installed.
That can be solved by defining the on_change only if the stock_lot
module is installed, which can be done on the __setup__ method of the
class.
>
> [1]
> FAIL: test_field_methods
> (trytond.modules.stock_number_of_packages.tests.test_stock_number_of_packages.TestCase)
> Test field methods
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File
> "/home/jesus/projectes/tryton/.../trytond/trytond/tests/test_tryton.py",
> line 80, in wrapper
> result = func(*args, **kwargs)
> File
> "/home/jesus/projectes/tryton/.../trytond/trytond/tests/test_tryton.py",
> line 201, in test_field_methods
> mname, attr))
> AssertionError: Field method "stock.inventory.line"."on_change_lot" for
> unknown field
>
> --
> 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/56ad77e9-c67a-477c-ad96-edb7384977e8%40googlegroups.com
> <
https://groups.google.com/d/msgid/tryton/56ad77e9-c67a-477c-ad96-edb7384977e8%40googlegroups.com?utm_medium=email&utm_source=footer>.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk