Reference fields with Many2Many

31 views
Skip to first unread message

Jon Levy

unread,
Nov 2, 2016, 6:15:31 PM11/2/16
to tryton
I am trying to create a Many2Many field that has a Reference field on one side.  I need a Reference because I have several models that all inherit from a mix-in (they model similar things and have numerous fields in common), and the Many2Many needs to be able to point to instances of any of them.

I've tried writing the Many2Many as normal, but am getting the error: "'Reference' object has no attribute 'get_target'".

I see from https://identi.ca/cedrickrier that "Reference fields for One2Many and Many2Many" were added to Tryton about 4 years ago.

Any thoughts on what I may be missing?  Thank you, in advance.

Cédric Krier

unread,
Nov 2, 2016, 7:30:04 PM11/2/16
to tryton
Only the origin can be a Reference field, the target must be a Many2One.

--
Cédric Krier - B2CK SPRL
Email/Jabber: cedric...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Jon Levy

unread,
Nov 3, 2016, 10:43:55 PM11/3/16
to tryton
You nailed it.  Thank you.
Reply all
Reply to author
Forward
0 new messages