From 584e5a4dfa513d4ea9e277cc93ae2d4145a8be8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Wed, 17 Apr 2013 17:46:24 +0200 Subject: [PATCH] Improve domain doc about deferencing to related models review800002 --- doc/topics/domain.rst | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/doc/topics/domain.rst b/doc/topics/domain.rst index 9a937d41ce..616d1fdae0 100644 --- a/doc/topics/domain.rst +++ b/doc/topics/domain.rst @@ -26,14 +26,24 @@ by this pattern:: :ref:`pyson ` statement, that evaluates to a string. - A field of type :class:`trytond.model.fields.Many2One` can be - dereferenced to related models. This is illustrated by the - following example:: + A field of type :class:`trytond.model.fields.Many2One` or + :class:`trytond.model.fields.Many2Many` or + :class:`trytond.model.fields.One2Many` or + :class:`trytond.model.fields.One2One` or + :class:`trytond.model.fields.Reference` can be dereferenced to related + models. This is illustrated by the following example:: domain = [('country.name', '=', 'Japan')] The number of *dots* in a clause is not limited. +.. warning:: + For :class:`trytond.model.fields.Reference`, an extra ending clause is + needed to define the target model to join, for example:: + + domain = [('origin.party.name', '=', 'John Doe', 'sale.sale')] +.. + ``operator`` Is an operator out of `Domain Operators`_ or a :ref:`pyson ` statement, that evaluates to