diff --git a/doc/index.rst.inc b/doc/index.rst.inc
index 842888aecb2..31ac2494a48 100644
--- a/doc/index.rst.inc
+++ b/doc/index.rst.inc
@@ -6,6 +6,7 @@ OpenERP Server
:maxdepth: 1
import
+ module-versioning
test-framework
Changed in 7.0
@@ -17,4 +18,4 @@ Changed in 7.0
api/user_img_specs
api/need_action_specs
api/font_style
- api/field_level_acl
\ No newline at end of file
+ api/field_level_acl
diff --git a/doc/module-versioning.rst b/doc/module-versioning.rst
new file mode 100644
index 00000000000..7a4c127d6d8
--- /dev/null
+++ b/doc/module-versioning.rst
@@ -0,0 +1,69 @@
+.. _module_versioning:
+
+Module versioning
+=================
+
+OpenERP has been developed with modularity in mind: OpenERP should be flexible
+enough so it can be adopted by any enterprise, of any size and in any market.
+By using modules one can adapt OpenERP in many different ways: from completely
+different business to smaller, company-specific changes.
+
+As modules (and the core framework itself) evolve, it is necessary to identify
+modules by their version so a sensible set of modules can be chosen for a
+particular deployment.
+
+There are two trends re-inforcing each others. Firstly OpenERP s.a. will work
+on a smaller number of official modules and let the community handles more and
+more development. Secondly all those modules will receive greater exposure on
+`OpenERP Apps`_ where each module will be owned by a single author.
+
+The solution advocated by OpenERP is straightforward and aims to avoid the
+`dependency hell`_. In particular we don't want to deal with versioned
+dependencies (i.e. a module depends on a specific version of another module).
+
+For each stable release (e.g. OpenERP 6.1, or OpenERP 7.0) or, said in other
+words, for each major version, there is only one (major) version of each
+module. The minor version is bumped for bug fixes but is otherwise not
+important here.
+
+Making variations on some business needs must be done by creating new modules,
+possibly depending on previously written modules. If depending on a module
+proves too difficult, you can write a new module (not a new _version_). But
+generally Python is flexible enough that depending on the existing module
+should work.
+
+For the next major version, refactoring modules can be done and similar
+functionalities can be brought together in a better module.
+
+.. _`OpenERP Apps`: http://apps.openerp.com/
+
+.. _`dependency hell`: http://en.wikipedia.org/wiki/Dependency_hell
+
+Example
+-------
+
+Whenever a new module is developed or must evolve, the above versioning policy
+should be respected.
+
+A particular concern one can face when deploying OpenERP to multiple customers
+is now detailed as an example to provide a few guidelines. The hypotethical
+situation is as follow. A partner needs to create a new module, called ``M``, for a
+customer. Shortly after (but still within a typical OpenERP release cycle, so
+there is no chance to bump the version number except for bug fixes), ``M`` must be
+adapted for another customer.
+
+The correct way to handle it is to leave ``M`` as it is and create a new module,
+say called ``X``, that depends on ``M`` for the second customer. Both modules have the
+same version (i.e. 6.1 or 7.0, targeting the corresponding OpenERP version).
+
+If leaving ``M`` as it is is not possible (which should be very rare as Python
+is incredibly flexible), the ``X`` module for the new customer can depend on a
+new module ``N``, derived from ``M``. At this point, ``N`` is a new,
+differently named module. It is not a ``M`` module with a increased version
+number. Your goal should be to make ``N`` as close as possible to ``M``, so
+that at the next version of OpenERP, the first customer can switch to ``N``
+instead of ``M`` (or include the changes in a new version of ``M``). At that
+point you are in the ideal situation: you have a module ``N`` for one customer,
+and a module ``X`` depending on N to account for the differences between those
+two customers.
+
diff --git a/openerp/addons/base/__openerp__.py b/openerp/addons/base/__openerp__.py
index d390d235f92..d4e7098c282 100644
--- a/openerp/addons/base/__openerp__.py
+++ b/openerp/addons/base/__openerp__.py
@@ -43,12 +43,22 @@ The kernel of OpenERP, needed for all installation.
'res/res_config.xml',
'data/res.country.state.csv',
'ir/wizard/wizard_menu_view.xml',
- 'ir/ir.xml',
- 'ir/ir_translation_view.xml',
- 'ir/ir_filters.xml',
+ 'ir/ir_actions.xml',
+ 'ir/ir_attachment_view.xml',
'ir/ir_config_parameter_view.xml',
- 'ir/workflow/workflow_view.xml',
+ 'ir/ir_cron_view.xml',
+ 'ir/ir_filters.xml',
+ 'ir/ir_mail_server_view.xml',
+ 'ir/ir_model_view.xml',
+ 'ir/ir_rule_view.xml',
+ 'ir/ir_sequence_view.xml',
+ 'ir/ir_translation_view.xml',
+ 'ir/ir_ui_menu_view.xml',
+ 'ir/ir_ui_view_view.xml',
+ 'ir/ir_values_view.xml',
+ 'ir/osv_memory_autovacuum.xml',
'ir/report/ir_report.xml',
+ 'ir/workflow/workflow_view.xml',
'module/module_view.xml',
'module/module_data.xml',
'module/module_report.xml',
diff --git a/openerp/addons/base/ir/__init__.py b/openerp/addons/base/ir/__init__.py
index ba8b785f39d..c6034e0f7ee 100644
--- a/openerp/addons/base/ir/__init__.py
+++ b/openerp/addons/base/ir/__init__.py
@@ -20,8 +20,6 @@
##############################################################################
import ir_model
-import ir_model_constraint
-import ir_model_relation
import ir_sequence
import ir_needaction
import ir_ui_menu
diff --git a/openerp/addons/base/ir/ir.xml b/openerp/addons/base/ir/ir.xml
deleted file mode 100644
index 491bc9c8131..00000000000
--- a/openerp/addons/base/ir/ir.xml
+++ /dev/null
@@ -1,1791 +0,0 @@
-
-
-
-
-
-
- ir.values.form.action
- ir.values
-
-
-
-
-
-
- ir.values.form.defaults
- ir.values
-
-
-
-
-
-
- ir.values.tree.action
- ir.values
-
-
-
-
-
-
-
-
-
-
- ir.values.search.action
- ir.values
-
-
-
-
-
-
-
-
-
-
-
-
- Action Bindings
- ir.actions.act_window
- ir.values
- form
- tree,form
-
- [('key','=','action')]
- {'default_key':'action'}
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
- User-defined Defaults
- ir.actions.act_window
- ir.values
- form
- tree,form
-
- [('key','=','default')]
- {'default_key':'default','default_key2':''}
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
-
- ir.sequence.form
- ir.sequence
-
-
-
-
-
-
- ir.sequence.tree
- ir.sequence
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ir.sequence.search
- ir.sequence
-
-
-
-
-
-
-
-
-
-
- Sequences
- ir.actions.act_window
- ir.sequence
- form
-
- {'active_test': False}
-
-
-
-
-
-
-
- ir.sequence.type.form
- ir.sequence.type
-
-
-
-
-
-
- ir.sequence.type.tree
- ir.sequence.type
-
-
-
-
-
-
-
-
-
- ir.sequence.type.search
- ir.sequence.type
-
-
-
-
-
-
-
-
- Sequence Codes
- ir.actions.act_window
- ir.sequence.type
- form
- tree,form
-
-
-
-
-
-
-
- ir.actions.actions
- ir.actions.actions
-
-
-
-
-
- ir.actions.actions.tree
- ir.actions.actions
-
-
-
-
-
-
-
-
- ir.actions.actions.search
- ir.actions.actions
-
-
-
-
-
-
-
-
- Actions
- ir.actions.act_window
- ir.actions.actions
- form
-
-
-
-
-
-
-
-
-
-
-
- ir.actions.report.xml
- ir.actions.report.xml
-
-
-
-
-
- ir.actions.report.xml.tree
- ir.actions.report.xml
-
-
-
-
-
-
-
-
-
-
-
-
- ir.actions.report.xml.search
- ir.actions.report.xml
-
-
-
-
-
-
-
-
-
-
-
- Reports
- ir.actions.act_window
- ir.actions.report.xml
- form
-
-
-
-
-
-
- ir.actions.windows.tree
- ir.actions.act_window
-
-
-
-
-
-
-
-
-
-
-
-
- ir.actions.windows.form
- ir.actions.act_window
-
-
-
-
-
- ir.actions.windows.search
- ir.actions.act_window
-
-
-
-
-
-
-
-
-
-
-
-
- Window Actions
- ir.actions.act_window
- ir.actions.act_window
- form
-
-
-
-
- tree
-
-
-
-
-
- form
-
-
-
-
-
-
- ir.actions.wizard.tree
- ir.actions.wizard
-
-
-
-
-
-
-
-
-
-
- ir.actions.wizard
- ir.actions.wizard
-
-
-
-
-
-
- ir.ui.menu.search
- ir.ui.menu
-
-
-
-
-
-
-
-
-
- Menu Items
- ir.ui.menu
- form
-
- {'ir.ui.menu.full_list':True}
-
- Manage and customize the items available and displayed in your OpenERP system menu. You can delete an item by clicking on the box at the beginning of each line and then delete it through the button that appeared. Items can be assigned to specific groups in order to make them accessible to some users within the system.
-
-
-
-
-
-
- ir.cron.tree
- ir.cron
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ir.cron.form
- ir.cron
-
-
-
-
-
-
- ir.actions.todo
- ir.actions.todo.select
-
-
-
-
-
-
-
-
-
-
- Configuration Wizards
- ir.actions.todo
-
- form
- The configuration wizards are used to help you configure a new instance of OpenERP. They are launched during the installation of new modules, but you can choose to restart some wizards manually from this menu.
-
-
-
-
-
- AutoVacuum osv_memory objects
- 30
- minutes
- -1
- True
-
- osv_memory.autovacuum
- power_on
- ()
-
-
-
-
- ir.mail.server.form
- ir.mail_server
-
-
+
+
+
+
+ ir.actions.todo
+ ir.actions.todo.select
+
+
+
+
+
+
+
+
+
+
+ Configuration Wizards
+ ir.actions.todo
+
+ form
+ The configuration wizards are used to help you configure a new instance of OpenERP. They are launched during the installation of new modules, but you can choose to restart some wizards manually from this menu.
+
+
+
+
+
+
+
diff --git a/openerp/addons/base/ir/ir_attachment_view.xml b/openerp/addons/base/ir/ir_attachment_view.xml
new file mode 100644
index 00000000000..4a65dd0ad0a
--- /dev/null
+++ b/openerp/addons/base/ir/ir_attachment_view.xml
@@ -0,0 +1,95 @@
+
+
+
+
+
+ ir.attachment
+
+
+
+
+
+ ir.mail_server
+
+
+
+
+
+
+
+
+
+
+
+ ir.mail_server
+
+
+
+
+
+
+
+
+ Outgoing Mail Servers
+ ir.mail_server
+ form
+ tree,form
+
+
+
+
+
+
diff --git a/openerp/addons/base/ir/ir_model.py b/openerp/addons/base/ir/ir_model.py
index 633db6de6a3..e477f2f09a5 100644
--- a/openerp/addons/base/ir/ir_model.py
+++ b/openerp/addons/base/ir/ir_model.py
@@ -24,8 +24,11 @@ import re
import time
import types
-from openerp.osv import fields,osv
+import openerp
+from openerp import SUPERUSER_ID
from openerp import netsvc, pooler, tools
+from openerp.osv import fields,osv
+from openerp.osv.orm import Model
from openerp.tools.safe_eval import safe_eval as eval
from openerp.tools import config
from openerp.tools.translate import _
@@ -58,7 +61,6 @@ def _in_modules(self, cr, uid, ids, field_name, arg, context=None):
result[k] = ', '.join(sorted(installed_modules & set(xml_id.split('.')[0] for xml_id in v)))
return result
-
class ir_model(osv.osv):
_name = 'ir.model'
_description = "Models"
@@ -204,7 +206,6 @@ class ir_model(osv.osv):
else:
x_name = a._columns.keys()[0]
x_custom_model._rec_name = x_name
-ir_model()
class ir_model_fields(osv.osv):
_name = 'ir.model.fields'
@@ -462,7 +463,128 @@ class ir_model_fields(osv.osv):
obj._auto_init(cr, ctx)
return res
-ir_model_fields()
+class ir_model_constraint(Model):
+ """
+ This model tracks PostgreSQL foreign keys and constraints used by OpenERP
+ models.
+ """
+ _name = 'ir.model.constraint'
+ _columns = {
+ 'name': fields.char('Constraint', required=True, size=128, select=1,
+ help="PostgreSQL constraint or foreign key name."),
+ 'model': fields.many2one('ir.model', string='Model',
+ required=True, select=1),
+ 'module': fields.many2one('ir.module.module', string='Module',
+ required=True, select=1),
+ 'type': fields.char('Constraint Type', required=True, size=1, select=1,
+ help="Type of the constraint: `f` for a foreign key, "
+ "`u` for other constraints."),
+ 'date_update': fields.datetime('Update Date'),
+ 'date_init': fields.datetime('Initialization Date')
+ }
+
+ _sql_constraints = [
+ ('module_name_uniq', 'unique(name, module)',
+ 'Constraints with the same name are unique per module.'),
+ ]
+
+ def _module_data_uninstall(self, cr, uid, ids, context=None):
+ """
+ Delete PostgreSQL foreign keys and constraints tracked by this model.
+ """
+
+ if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
+ raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
+
+ context = dict(context or {})
+
+ ids_set = set(ids)
+ ids.sort()
+ ids.reverse()
+ for data in self.browse(cr, uid, ids, context):
+ model = data.model.model
+ model_obj = self.pool.get(model)
+ name = openerp.tools.ustr(data.name)
+ typ = data.type
+
+ # double-check we are really going to delete all the owners of this schema element
+ cr.execute("""SELECT id from ir_model_constraint where name=%s""", (data.name,))
+ external_ids = [x[0] for x in cr.fetchall()]
+ if (set(external_ids)-ids_set):
+ # as installed modules have defined this element we must not delete it!
+ continue
+
+ if typ == 'f':
+ # test if FK exists on this table (it could be on a related m2m table, in which case we ignore it)
+ cr.execute("""SELECT 1 from pg_constraint cs JOIN pg_class cl ON (cs.conrelid = cl.oid)
+ WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('f', name, model_obj._table))
+ if cr.fetchone():
+ cr.execute('ALTER TABLE "%s" DROP CONSTRAINT "%s"' % (model_obj._table, name),)
+ _logger.info('Dropped FK CONSTRAINT %s@%s', name, model)
+
+ if typ == 'u':
+ # test if constraint exists
+ cr.execute("""SELECT 1 from pg_constraint cs JOIN pg_class cl ON (cs.conrelid = cl.oid)
+ WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('u', name, model_obj._table))
+ if cr.fetchone():
+ cr.execute('ALTER TABLE "%s" DROP CONSTRAINT "%s"' % (model_obj._table, name),)
+ _logger.info('Dropped CONSTRAINT %s@%s', name, model)
+
+ self.unlink(cr, uid, ids, context)
+
+class ir_model_relation(Model):
+ """
+ This model tracks PostgreSQL tables used to implement OpenERP many2many
+ relations.
+ """
+ _name = 'ir.model.relation'
+ _columns = {
+ 'name': fields.char('Relation Name', required=True, size=128, select=1,
+ help="PostgreSQL table name implementing a many2many relation."),
+ 'model': fields.many2one('ir.model', string='Model',
+ required=True, select=1),
+ 'module': fields.many2one('ir.module.module', string='Module',
+ required=True, select=1),
+ 'date_update': fields.datetime('Update Date'),
+ 'date_init': fields.datetime('Initialization Date')
+ }
+
+ def _module_data_uninstall(self, cr, uid, ids, context=None):
+ """
+ Delete PostgreSQL many2many relations tracked by this model.
+ """
+
+ if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
+ raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
+
+ ids_set = set(ids)
+ to_drop_table = []
+ ids.sort()
+ ids.reverse()
+ for data in self.browse(cr, uid, ids, context):
+ model = data.model
+ model_obj = self.pool.get(model)
+ name = openerp.tools.ustr(data.name)
+
+ # double-check we are really going to delete all the owners of this schema element
+ cr.execute("""SELECT id from ir_model_relation where name = %s""", (data.name,))
+ external_ids = [x[0] for x in cr.fetchall()]
+ if (set(external_ids)-ids_set):
+ # as installed modules have defined this element we must not delete it!
+ continue
+
+ cr.execute("SELECT 1 FROM information_schema.tables WHERE table_name=%s", (name,))
+ if cr.fetchone() and not name in to_drop_table:
+ to_drop_table.append(name)
+
+ self.unlink(cr, uid, ids, context)
+
+ # drop m2m relation tables
+ for table in to_drop_table:
+ cr.execute('DROP TABLE %s CASCADE'% (table),)
+ _logger.info('Dropped table %s', table)
+
+ cr.commit()
class ir_model_access(osv.osv):
_name = 'ir.model.access'
@@ -643,8 +765,6 @@ class ir_model_access(osv.osv):
res = super(ir_model_access, self).unlink(cr, uid, *args, **argv)
return res
-ir_model_access()
-
class ir_model_data(osv.osv):
"""Holds external identifier keys for records in the database.
This has two main uses:
@@ -978,5 +1098,4 @@ class ir_model_data(osv.osv):
_logger.info('Deleting %s@%s', res_id, model)
self.pool.get(model).unlink(cr, uid, [res_id])
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/openerp/addons/base/ir/ir_model_constraint.py b/openerp/addons/base/ir/ir_model_constraint.py
deleted file mode 100644
index a3099339131..00000000000
--- a/openerp/addons/base/ir/ir_model_constraint.py
+++ /dev/null
@@ -1,77 +0,0 @@
-import logging
-
-import openerp
-from openerp import SUPERUSER_ID
-from openerp.osv import fields
-from openerp.osv.orm import Model
-
-_logger = logging.getLogger(__name__)
-
-class ir_model_constraint(Model):
- """
- This model tracks PostgreSQL foreign keys and constraints used by OpenERP
- models.
- """
- _name = 'ir.model.constraint'
- _columns = {
- 'name': fields.char('Constraint', required=True, size=128, select=1,
- help="PostgreSQL constraint or foreign key name."),
- 'model': fields.many2one('ir.model', string='Model',
- required=True, select=1),
- 'module': fields.many2one('ir.module.module', string='Module',
- required=True, select=1),
- 'type': fields.char('Constraint Type', required=True, size=1, select=1,
- help="Type of the constraint: `f` for a foreign key, "
- "`u` for other constraints."),
- 'date_update': fields.datetime('Update Date'),
- 'date_init': fields.datetime('Initialization Date')
- }
-
- _sql_constraints = [
- ('module_name_uniq', 'unique(name, module)',
- 'Constraints with the same name are unique per module.'),
- ]
-
- def _module_data_uninstall(self, cr, uid, ids, context=None):
- """
- Delete PostgreSQL foreign keys and constraints tracked by this model.
- """
-
- if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
- raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
-
- context = dict(context or {})
-
- ids_set = set(ids)
- ids.sort()
- ids.reverse()
- for data in self.browse(cr, uid, ids, context):
- model = data.model.model
- model_obj = self.pool.get(model)
- name = openerp.tools.ustr(data.name)
- typ = data.type
-
- # double-check we are really going to delete all the owners of this schema element
- cr.execute("""SELECT id from ir_model_constraint where name=%s""", (data.name,))
- external_ids = [x[0] for x in cr.fetchall()]
- if (set(external_ids)-ids_set):
- # as installed modules have defined this element we must not delete it!
- continue
-
- if typ == 'f':
- # test if FK exists on this table (it could be on a related m2m table, in which case we ignore it)
- cr.execute("""SELECT 1 from pg_constraint cs JOIN pg_class cl ON (cs.conrelid = cl.oid)
- WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('f', name, model_obj._table))
- if cr.fetchone():
- cr.execute('ALTER TABLE "%s" DROP CONSTRAINT "%s"' % (model_obj._table, name),)
- _logger.info('Dropped FK CONSTRAINT %s@%s', name, model)
-
- if typ == 'u':
- # test if constraint exists
- cr.execute("""SELECT 1 from pg_constraint cs JOIN pg_class cl ON (cs.conrelid = cl.oid)
- WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('u', name, model_obj._table))
- if cr.fetchone():
- cr.execute('ALTER TABLE "%s" DROP CONSTRAINT "%s"' % (model_obj._table, name),)
- _logger.info('Dropped CONSTRAINT %s@%s', name, model)
-
- self.unlink(cr, uid, ids, context)
diff --git a/openerp/addons/base/ir/ir_model_relation.py b/openerp/addons/base/ir/ir_model_relation.py
deleted file mode 100644
index fc6dae2ca52..00000000000
--- a/openerp/addons/base/ir/ir_model_relation.py
+++ /dev/null
@@ -1,62 +0,0 @@
-import logging
-
-import openerp
-from openerp import SUPERUSER_ID
-from openerp.osv import fields
-from openerp.osv.orm import Model
-
-_logger = logging.getLogger(__name__)
-
-class ir_model_relation(Model):
- """
- This model tracks PostgreSQL tables used to implement OpenERP many2many
- relations.
- """
- _name = 'ir.model.relation'
- _columns = {
- 'name': fields.char('Relation Name', required=True, size=128, select=1,
- help="PostgreSQL table name implementing a many2many relation."),
- 'model': fields.many2one('ir.model', string='Model',
- required=True, select=1),
- 'module': fields.many2one('ir.module.module', string='Module',
- required=True, select=1),
- 'date_update': fields.datetime('Update Date'),
- 'date_init': fields.datetime('Initialization Date')
- }
-
- def _module_data_uninstall(self, cr, uid, ids, context=None):
- """
- Delete PostgreSQL many2many relations tracked by this model.
- """
-
- if uid != SUPERUSER_ID and not self.pool.get('ir.model.access').check_groups(cr, uid, "base.group_system"):
- raise except_orm(_('Permission Denied'), (_('Administrator access is required to uninstall a module')))
-
- ids_set = set(ids)
- to_drop_table = []
- ids.sort()
- ids.reverse()
- for data in self.browse(cr, uid, ids, context):
- model = data.model
- model_obj = self.pool.get(model)
- name = openerp.tools.ustr(data.name)
-
- # double-check we are really going to delete all the owners of this schema element
- cr.execute("""SELECT id from ir_model_relation where name = %s""", (data.name,))
- external_ids = [x[0] for x in cr.fetchall()]
- if (set(external_ids)-ids_set):
- # as installed modules have defined this element we must not delete it!
- continue
-
- cr.execute("SELECT 1 FROM information_schema.tables WHERE table_name=%s", (name,))
- if cr.fetchone() and not name in to_drop_table:
- to_drop_table.append(name)
-
- self.unlink(cr, uid, ids, context)
-
- # drop m2m relation tables
- for table in to_drop_table:
- cr.execute('DROP TABLE %s CASCADE'% (table),)
- _logger.info('Dropped table %s', table)
-
- cr.commit()
diff --git a/openerp/addons/base/ir/ir_model_view.xml b/openerp/addons/base/ir/ir_model_view.xml
new file mode 100644
index 00000000000..01ff918662f
--- /dev/null
+++ b/openerp/addons/base/ir/ir_model_view.xml
@@ -0,0 +1,416 @@
+
+
+
+
+
+ ir.model
+
+
+
+
+
+ ir.ui.menu
+
+
+
+
+
+
+
+
+
+ ir.ui.menu.search
+ ir.ui.menu
+
+
+
+
+
+
+
+
+ Menu Items
+ ir.ui.menu
+ form
+
+ {'ir.ui.menu.full_list':True}
+
+ Manage and customize the items available and displayed in your OpenERP system menu. You can delete an item by clicking on the box at the beginning of each line and then delete it through the button that appeared. Items can be assigned to specific groups in order to make them accessible to some users within the system.
+
+
+
+
+
diff --git a/openerp/addons/base/ir/ir_ui_view.py b/openerp/addons/base/ir/ir_ui_view.py
index 9208297cf84..868f634783c 100644
--- a/openerp/addons/base/ir/ir_ui_view.py
+++ b/openerp/addons/base/ir/ir_ui_view.py
@@ -44,7 +44,6 @@ class view_custom(osv.osv):
cr.execute('SELECT indexname FROM pg_indexes WHERE indexname = \'ir_ui_view_custom_user_id_ref_id\'')
if not cr.fetchone():
cr.execute('CREATE INDEX ir_ui_view_custom_user_id_ref_id ON ir_ui_view_custom (user_id, ref_id)')
-view_custom()
class view(osv.osv):
_name = 'ir.ui.view'
@@ -60,7 +59,7 @@ class view(osv.osv):
return result
_columns = {
- 'name': fields.char('View Name',size=64, required=True),
+ 'name': fields.char('View Name', required=True),
'model': fields.char('Object', size=64, required=True, select=True),
'priority': fields.integer('Sequence', required=True),
'type': fields.function(_type_field, type='selection', selection=[
@@ -88,11 +87,17 @@ class view(osv.osv):
_order = "priority,name"
# Holds the RNG schema
- _relaxng_validator = None
+ _relaxng_validator = None
def create(self, cr, uid, values, context=None):
if 'type' in values:
_logger.warning("Setting the `type` field is deprecated in the `ir.ui.view` model.")
+ if not values.get('name'):
+ if values.get('inherit_id'):
+ inferred_type = self.browse(cr, uid, values['inherit_id'], context).type
+ else:
+ inferred_type = etree.fromstring(values['arch'].encode('utf8')).tag
+ values['name'] = "%s %s" % (values['model'], inferred_type)
return super(osv.osv, self).create(cr, uid, values, context)
def _relaxng(self):
@@ -106,8 +111,7 @@ class view(osv.osv):
finally:
frng.close()
return self._relaxng_validator
-
-
+
def _check_render_view(self, cr, uid, view, context=None):
"""Verify that the given view's hierarchy is valid for rendering, along with all the changes applied by
its inherited views, by rendering it using ``fields_view_get()``.
@@ -267,7 +271,6 @@ class view(osv.osv):
'label' : labels,
'blank_nodes': blank_nodes,
'node_parent_field': _Model_Field,}
-view()
class view_sc(osv.osv):
_name = 'ir.ui.view_sc'
@@ -304,7 +307,5 @@ class view_sc(osv.osv):
('shortcut_unique', 'unique(res_id, resource, user_id)', 'Shortcut for this menu already exists!'),
]
-view_sc()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/openerp/addons/base/ir/ir_ui_view_view.xml b/openerp/addons/base/ir/ir_ui_view_view.xml
new file mode 100644
index 00000000000..59dfdd72b3f
--- /dev/null
+++ b/openerp/addons/base/ir/ir_ui_view_view.xml
@@ -0,0 +1,144 @@
+
+
+
+
+
+ ir.ui.view
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ir.ui.view
+
+
+
+
+
+
+
+
+
+
+
+
+ ir.ui.view
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Views
+ ir.actions.act_window
+ ir.ui.view
+
+ Views allows you to personalize each view of OpenERP. You can add new fields, move fields, rename them or delete the ones that you do not need.
+
+
+
+
+
+ ir.ui.view.custom
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ir.ui.view.custom
+
+
+
+
+
+
+
+
+ ir.ui.view.custom
+
+
+
+
+
+
+
+
+ Customized Views
+ ir.actions.act_window
+ ir.ui.view.custom
+ Customized views are used when users reorganize the content of their dashboard views (via web client)
+
+
+
+
+
+ ir.ui.view_sc
+
+