From af292cac781b69830f66882de42c8f3500a58605 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 16 Mar 2015 10:05:25 +0100 Subject: [PATCH] Improve documentation of 'on_write' attribute review11071002 --- doc/topics/views/index.rst | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/doc/topics/views/index.rst b/doc/topics/views/index.rst index e567d3c1ff..479670c065 100644 --- a/doc/topics/views/index.rst +++ b/doc/topics/views/index.rst @@ -153,11 +153,19 @@ Each form view must start with this tag. * ``string``: The text that will be used as default title for the tab or the window. - * ``on_write``: The name of a function that will be called when the record - is saved. The function must have this syntax: + .. _form-attributes-on_write: + + * ``on_write``: The name of a method on the Model of the view that will be + called when a record is saved. The method must return a list of record + ids that the client must reload if they are already loaded. The function + must have this syntax: ``on_write(self, ids)`` + .. note:: + The method must be registered in :attr:`trytond.model.Model.__rpc__`. + .. + * ``col``: The number of columns for the view. * ``cursor``: The name of the field that must have the cursor by default. @@ -479,10 +487,7 @@ Each tree view must start with this tag. * ``string``: The text that will be used as default title for the tab or the window. - * ``on_write``: The name of a function that will be called when a record is - saved. The function must have this syntax: - - ``on_write(self, ids)`` + * ``on_write``: see form-attributes-on_write_. * ``editable``: If it is set to ``top`` or ``bottom``, the list becomes editable and the new record will be added on ``top`` or ``bottom`` of the