[IMP] ir.model.data: usability - rename `XML ID` -> `External ID`
bzr revid: odo@openerp.com-20110906075711-lev8g5tkfhc9j3c1
This commit is contained in:
parent
c94116f41b
commit
eab6a77a26
|
@ -241,7 +241,7 @@
|
|||
<field name="view_id" ref="sequence_view_tree"/>
|
||||
<field name="context">{'active_test': False}</field>
|
||||
</record>
|
||||
<menuitem id="next_id_5" name="Sequences" parent="base.menu_config"/>
|
||||
<menuitem id="next_id_5" name="Sequences & Identifiers" parent="base.menu_config"/>
|
||||
<menuitem action="ir_sequence_form" id="menu_ir_sequence_form" parent="next_id_5"/>
|
||||
|
||||
<!-- Sequences Types -->
|
||||
|
@ -1221,7 +1221,7 @@
|
|||
<field name="model">ir.model.data</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Object Identifiers">
|
||||
<form string="External Identifiers">
|
||||
<field name="name"/>
|
||||
<field name="module"/>
|
||||
<field name="model"/>
|
||||
|
@ -1239,7 +1239,7 @@
|
|||
<field name="model">ir.model.data</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Object Identifiers">
|
||||
<tree string="External Identifiers">
|
||||
<field name="module"/>
|
||||
<field name="name"/>
|
||||
<field name="model"/>
|
||||
|
@ -1253,7 +1253,7 @@
|
|||
<field name="model">ir.model.data</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Object Identifiers">
|
||||
<search string="External Identifiers">
|
||||
<filter icon="terp-camera_test"
|
||||
string="Updatable"
|
||||
domain="[('noupdate', '=', False)]"/>
|
||||
|
@ -1293,7 +1293,7 @@
|
|||
<menuitem action="action_model_fields" id="ir_model_model_fields" parent="base.next_id_9"/>
|
||||
|
||||
<record id="action_model_data" model="ir.actions.act_window">
|
||||
<field name="name">Object Identifiers</field>
|
||||
<field name="name">External Identifiers</field>
|
||||
<field name="res_model">ir.model.data</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_model_data_list"/>
|
||||
|
|
|
@ -561,14 +561,27 @@ class ir_model_access(osv.osv):
|
|||
ir_model_access()
|
||||
|
||||
class ir_model_data(osv.osv):
|
||||
"""Holds external identifier keys for records in the database.
|
||||
This has two main uses:
|
||||
|
||||
* allows easy data integration with third-party systems,
|
||||
making import/export/sync of data possible, as records
|
||||
can be uniquely identified across multiple systems
|
||||
* allows tracking the origin of data installed by OpenERP
|
||||
modules themselves, thus making it possible to later
|
||||
update them seamlessly.
|
||||
"""
|
||||
_name = 'ir.model.data'
|
||||
__logger = logging.getLogger('addons.base.'+_name)
|
||||
_order = 'module,model,name'
|
||||
_columns = {
|
||||
'name': fields.char('XML Identifier', required=True, size=128, select=1),
|
||||
'model': fields.char('Object', required=True, size=64, select=1),
|
||||
'name': fields.char('External Identifier', required=True, size=128, select=1,
|
||||
help="External Key/Identifier that can be used for "
|
||||
"data integration with third-party systems"),
|
||||
'model': fields.char('Model Name', required=True, size=64, select=1),
|
||||
'module': fields.char('Module', required=True, size=64, select=1),
|
||||
'res_id': fields.integer('Resource ID', select=1),
|
||||
'res_id': fields.integer('Record ID', select=1,
|
||||
help="ID of the target record in the database"),
|
||||
'noupdate': fields.boolean('Non Updatable'),
|
||||
'date_update': fields.datetime('Update Date'),
|
||||
'date_init': fields.datetime('Init Date')
|
||||
|
@ -580,7 +593,7 @@ class ir_model_data(osv.osv):
|
|||
'module': ''
|
||||
}
|
||||
_sql_constraints = [
|
||||
('module_name_uniq', 'unique(name, module)', 'You cannot have multiple records with the same id for the same module !'),
|
||||
('module_name_uniq', 'unique(name, module)', 'You cannot have multiple records with the same external ID in the same module!'),
|
||||
]
|
||||
|
||||
def __init__(self, pool, cr):
|
||||
|
|
|
@ -59,7 +59,7 @@ class ir_translation(osv.osv):
|
|||
# These two columns map to ir_model_data.module and ir_model_data.name.
|
||||
# They are used to resolve the res_id above after loading is done.
|
||||
'module': fields.char('Module', size=64, help='Maps to the ir_model_data for which this translation is provided.'),
|
||||
'xml_id': fields.char('XML Id', size=128, help='Maps to the ir_model_data for which this translation is provided.'),
|
||||
'xml_id': fields.char('External ID', size=128, help='Maps to the ir_model_data for which this translation is provided.'),
|
||||
}
|
||||
|
||||
def _auto_init(self, cr, context={}):
|
||||
|
|
|
@ -78,7 +78,7 @@ class view(osv.osv):
|
|||
'arch': fields.text('View Architecture', required=True),
|
||||
'inherit_id': fields.many2one('ir.ui.view', 'Inherited View', ondelete='cascade', select=True),
|
||||
'field_parent': fields.char('Child Field',size=64),
|
||||
'xml_id': fields.function(osv.osv.get_xml_id, type='char', size=128, string="XML ID",
|
||||
'xml_id': fields.function(osv.osv.get_xml_id, type='char', size=128, string="External ID",
|
||||
method=True, help="ID of the view defined in xml file"),
|
||||
}
|
||||
_defaults = {
|
||||
|
|
Loading…
Reference in New Issue