Hi Luis,
  Thanks for the answer.

  I already find the solution. It was fields.Selection wrong defined. I
defined wrongly one of the tuples on selection as ('',None ) instead of
(None, '').
  It works fine on the previous gnuhealth version, because the client was
on python2, and compairing a string to a None value returns false. But on
the currently client version, on python3, it returns an error.

  Regards.

El mar., 21 abr. 2020 a las 7:46, Luis Falcon (<fal...@gnuhealth.org>)
escribió:

> Hi Francisco!
> On Sun, 19 Apr 2020 19:50:43 -0300
> Francisco Maria Moyano Casco <moyanocasco.francis...@gmail.com> wrote:
>
> > Hi,
> > I am having some issues using tryton 4.6 module on tryton 5.0
> > The issue is with a One2Many list based on a ModelView class.
> > I tried to scrap an example of the code, so I don’t have to copy all
> > the original.
> > The idea behind is to fullfill a list (the one2many) with something.
> >
> > class Element(ModelView):
> >    'Element'
> >     __name__ = 'list.element'
> >
> >     foo = fields.Char("Foo")
> >
> > class ListElement(ModelView):
> >     'List Element'
> >     __name__ = 'list.list'
> >
> >     elements = fields.One2Many('list.element',None,'Cobertura',
> >         readonly=True)
> >
> >
> > TypeError: '<' not supported between instances of 'str' and 'NoneType'
> >
> > Could it be possible due to the one2many refers to ModelView and not
> > to a ModelSQL? If I change the one2many target to party.party, it
> > gives me no error.
> >
> > Thanks in advance
> I haven't looked much into the details, but a O2M field needs a M2O
> counterpart to establish the relationship.
>
> On your example, you're referring to None, instead you
> should be referring to a M2O field on the Element class that refers to
> ListElement.
>
> Hope this helps.
>
> Luis
>
>
>
>

Reply via email to