From cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 Mon Sep 17 00:00:00 2001 From: Raphael Collet Date: Sun, 6 Jul 2014 16:44:26 +0200 Subject: [MERGE] new v8 api by rco A squashed merge is required as the conversion of the apiculture branch from bzr to git was not correctly done. The git history contains irrelevant blobs and commits. This branch brings a lot of changes and fixes, too many to list exhaustively. - New orm api, objects are now used instead of ids - Environements to encapsulates cr uid context while maintaining backward compatibility - Field compute attribute is a new object oriented way to define function fields - Shared browse record cache - New onchange protocol - Optional copy flag on fields - Documentation update - Dead code cleanup - Lots of fixes --- doc/03_module_dev_03.rst | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'doc/03_module_dev_03.rst') diff --git a/doc/03_module_dev_03.rst b/doc/03_module_dev_03.rst index e5e309fe00e..74fb4772f84 100644 --- a/doc/03_module_dev_03.rst +++ b/doc/03_module_dev_03.rst @@ -70,15 +70,21 @@ As we can see below in the purple zone of the screen, there is also a way to dis On Change +++++++++ -The on_change attribute defines a method that is called when the content of a view field has changed. +The on_change attribute defines a method that is called when the +content of a view field has changed. -This method takes at least arguments: cr, uid, ids, which are the three classical arguments and also the context dictionary. You can add parameters to the method. They must correspond to other fields defined in the view, and must also be defined in the XML with fields defined this way:: +This method takes at least arguments: cr, uid, ids, which are the +three classical arguments and also the context dictionary. You can add +parameters to the method. They must correspond to other fields defined +in the view, and must also be defined in the XML with fields defined +this way:: The example below is from the sale order view. -You can use the 'context' keyword to access data in the context that can be used as params of the function.:: +You can use the 'context' keyword to access data in the context that +can be used as params of the function.:: @@ -100,7 +106,10 @@ You can use the 'context' keyword to access data in the context that can be used return {'value':v} -When editing the shop_id form field, the onchange_shop_id method of the sale_order object is called and returns a dictionary where the 'value' key contains a dictionary of the new value to use in the 'project_id', 'pricelist_id' and 'payment_default_id' fields. +When editing the shop_id form field, the onchange_shop_id method of +the sale_order object is called and returns a dictionary where the +'value' key contains a dictionary of the new value to use in the +'project_id', 'pricelist_id' and 'payment_default_id' fields. Note that it is possible to change more than just the values of fields. For example, it is possible to change the value of some fields -- cgit v1.2.3