From 9b269cb0ddb5a274a16072be0f84ea37241cbbee Mon Sep 17 00:00:00 2001 From: Martin Geubelle Date: Wed, 31 Aug 2016 13:14:54 +0200 Subject: [PATCH] [IMP] base: simplify model & field views As these views will soon be accessible out of debug mode, let's simplify them by hiding some fields in non-debug mode. --- openerp/addons/base/ir/ir_model_view.xml | 186 +++++++++++---------- openerp/addons/base/ir/ir_ui_menu_view.xml | 2 +- openerp/addons/base/ir/ir_ui_view_view.xml | 10 +- 3 files changed, 105 insertions(+), 93 deletions(-) diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml index ae3cf215ce5..85c0a71dc6b 100644 --- a/openerp/addons/base/ir/ir_model_view.xml +++ b/openerp/addons/base/ir/ir_model_view.xml @@ -31,11 +31,11 @@ - + - - + + @@ -47,15 +47,19 @@ - - + +
- - - - + + + + + + + + @@ -63,47 +67,47 @@ - - - + + + - - - - - - - - + @@ -111,36 +115,38 @@ -

How to define a computed field

-

Computed fields are defined with the fields - Dependencies and Compute.

-

The field Dependencies lists the fields that - the current field depends on. It is a comma-separated list of - field names, like name, size. You can also refer to - fields accessible through other relational fields, for instance - partner_id.company_id.name.

-

The field Compute is the Python code to - compute the value of the field on a set of records. The value of - the field must be assigned to each record with a dictionary-like - assignment.

-
+                                            
+

How to define a computed field

+

Computed fields are defined with the fields + Dependencies and Compute.

+

The field Dependencies lists the fields that + the current field depends on. It is a comma-separated list of + field names, like name, size. You can also refer to + fields accessible through other relational fields, for instance + partner_id.company_id.name.

+

The field Compute is the Python code to + compute the value of the field on a set of records. The value of + the field must be assigned to each record with a dictionary-like + assignment.

+
     for record in self:
         record['size'] = len(record.name)
 
-

The only predefined variables are

-
    -
  • self (the set of records to compute)
  • -
  • datetime (Python module)
  • -
  • dateutil (Python module)
  • -
  • time (Python module)
  • -
-

Other features are accessible through self, like - self.env, etc.

+

The only predefined variables are

+
    +
  • self (the set of records to compute)
  • +
  • datetime (Python module)
  • +
  • dateutil (Python module)
  • +
  • time (Python module)
  • +
+

Other features are accessible through self, like + self.env, etc.

+
- + - + @@ -149,7 +155,7 @@ -