On 28/06/18 03:37, Nicolas Évrard wrote:
* 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
Thanks works!
-- Best regards / Atentamente, Oscar Andrés Alvarez M. CEO, Presik SAS
Cel. 301 245 7967 www.presik.com < Empresas Inteligentes >
--
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/2544d01d-e92d-4be0-ef8c-97e533f1c862%40gmail.com.