diff options
| author | Raphael Collet <rco@openerp.com> | 2014-07-06 16:44:26 +0200 |
|---|---|---|
| committer | Antony Lesuisse <al@openerp.com> | 2014-07-06 17:05:41 +0200 |
| commit | cbe2dbb672a6c55d86f2e515f9d1cdfee426ef80 (patch) | |
| tree | d6ff62b719fce32392397783c961b734b1e4c50e /doc/03_module_dev_03.rst | |
| parent | d78192c489d3be66cd6487b39f5ce7ba4733a187 (diff) | |
[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
Diffstat (limited to 'doc/03_module_dev_03.rst')
| -rw-r--r-- | doc/03_module_dev_03.rst | 17 |
1 files changed, 13 insertions, 4 deletions
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:: <field name="name_of_field" on_change="name_of_method(other_field'_1_', ..., other_field'_n_')"/> 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.:: <field name="shop_id" on_change="onchange_shop_id(shop_id)"/> @@ -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 |
