From f4ffbd79f417c6445b630a5a33979321dba67cc0 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Mon, 3 Oct 2011 15:26:53 +0200 Subject: [PATCH] [IMP] field.m2m: better doc for auto-named m2m relationships bzr revid: odo@openerp.com-20111003132653-413c41exoj64q416 --- openerp/osv/fields.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/openerp/osv/fields.py b/openerp/osv/fields.py index 0d60a1cbb95..9b437de86e4 100644 --- a/openerp/osv/fields.py +++ b/openerp/osv/fields.py @@ -495,6 +495,15 @@ class one2many(_column): class many2many(_column): """Encapsulates the logic of a many-to-many bidirectional relationship, handling the low-level details of the intermediary relationship table transparently. + A many-to-many relationship is always symmetrical, and can be declared and accessed + from either endpoint model. + If ``rel`` (relationship table name), ``id1`` (source foreign key column name) + or id2 (destination foreign key column name) are not specified, the system will + provide default values. This will by default only allow one single symmetrical + many-to-many relationship between the source and destination model. + For multiple many-to-many relationship between the same models and for + relationships where source and destination models are the same, ``rel``, ``id1`` + and ``id2`` should be specified explicitly. :param str obj: destination model :param str rel: optional name of the intermediary relationship table. If not specified,