* Oscar Alvarez [2018-06-28 01:53:28]:
> Hi Devs
Hello,
> It is possible to use field reference (origin) instead of Many2One? for
> example in this case:
>
> class A(...):
>
> name = fields.Char(......)
>
> documents = field.One2Many('document.notification', 'origin',
> '???')
>
> class B(...):
>
> name = fields.Char(......)
>
> documents = field.One2Many('document.notification', 'origin',
> '???')
> class DocumentNotification(...):
> anotherfields = .....
> origin = fields.Reference('Origin', selection='get_origin') --> this
> field keep reference to records from A model or B model or C model,
> etc.
> Or some type of Mixing is the best solution?
> Thanks for advance.
Yes.
For example the shipment on the stock.move is a reference field yet
it's used as the origin of the corresponding One2Many in the different
shipments kind.
BTW this question should rather go to tryton instead of tryton-dev
--
Nicolas Évrard - B2CK SPRL
E-mail/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/
--
You received this message because you are subscribed to the Google Groups
"tryton-dev" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton-dev/153017505695.27309.11094995074743831791%40balisto.