[MERGE] flag indicating whether a view template is or is not a page
Used to list all existing CMS pages from the RTE's link dialog bzr revid: xmo@openerp.com-20130821143404-r8hnemydlvg3cjvs
This commit is contained in:
@@ -82,9 +82,11 @@ class view(osv.osv):
|
||||
'groups_id': fields.many2many('res.groups', 'ir_ui_view_group_rel', 'view_id', 'group_id',
|
||||
string='Groups', help="If this field is empty, the view applies to all users. Otherwise, the view applies to the users of those groups only."),
|
||||
'model_ids': fields.one2many('ir.model.data', 'res_id', auto_join=True),
|
||||
'page': fields.boolean("Whether this view is a web page template (complete)"),
|
||||
}
|
||||
_defaults = {
|
||||
'priority': 16,
|
||||
'page': False,
|
||||
}
|
||||
_order = "priority,name"
|
||||
|
||||
|
||||
+14
-3
@@ -204,11 +204,22 @@
|
||||
|
||||
<rng:define name="template">
|
||||
<rng:element name="template">
|
||||
<rng:optional><rng:attribute name="id"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="t-name"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="name"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="forcecreate"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="context"/></rng:optional>
|
||||
<rng:choice>
|
||||
<rng:group>
|
||||
<rng:optional><rng:attribute name="inherit_id"/></rng:optional>
|
||||
<rng:optional><rng:attribute name="inherit_option_id"/></rng:optional>
|
||||
</rng:group>
|
||||
<rng:optional>
|
||||
<rng:attribute name="page"><rng:value>True</rng:value></rng:attribute>
|
||||
</rng:optional>
|
||||
</rng:choice>
|
||||
<rng:zeroOrMore>
|
||||
<rng:choice>
|
||||
<rng:attribute>
|
||||
<rng:anyName/>
|
||||
</rng:attribute>
|
||||
<rng:text/>
|
||||
<rng:ref name="any"/>
|
||||
</rng:choice>
|
||||
|
||||
+7
-8
@@ -4886,17 +4886,16 @@ class BaseModel(object):
|
||||
:rtype: List of dictionaries.
|
||||
|
||||
"""
|
||||
record_ids = self.search(cr, uid, domain or [], offset, limit or False, order or False, context or {})
|
||||
record_ids = self.search(cr, uid, domain or [], offset=offset, limit=limit, order=order, context=context)
|
||||
if not record_ids:
|
||||
return []
|
||||
result = self.read(cr, uid, record_ids, fields or [], context or {})
|
||||
result = self.read(cr, uid, record_ids, fields=fields, context=context)
|
||||
if len(result) <= 1:
|
||||
return result
|
||||
|
||||
# reorder read
|
||||
if len(result) >= 1:
|
||||
index = {}
|
||||
for r in result:
|
||||
index[r['id']] = r
|
||||
result = [index[x] for x in record_ids if x in index]
|
||||
return result
|
||||
index = dict((r['id'], r) for r in result)
|
||||
return [index[x] for x in record_ids if x in index]
|
||||
|
||||
def _register_hook(self, cr):
|
||||
""" stuff to do right after the registry is built """
|
||||
|
||||
@@ -872,6 +872,8 @@ form: module.record_id""" % (xml_id,)
|
||||
if el.get(key):
|
||||
record.append(etree.fromstring('<field name="%s" ref="%s"/>' % (key, el.get(key))))
|
||||
el.attrib.pop(key, None)
|
||||
if el.get('page'):
|
||||
record.append(etree.Element('field', name="page", eval="True"))
|
||||
return self._tag_record(cr, record, data_node)
|
||||
|
||||
def id_get(self, cr, id_str):
|
||||
|
||||
Reference in New Issue
Block a user