[MERGE] Allow to use many2one for qweb template (work also with view_id)
bzr revid: jke@openerp.com-20140416085136-xxqsqjyie5vtf6f3
This commit is contained in:
commit
ca8b6cc703
|
@ -383,6 +383,10 @@ class Contact(orm.AbstractModel):
|
|||
_name = 'website.qweb.field.contact'
|
||||
_inherit = ['ir.qweb.field.contact', 'website.qweb.field.many2one']
|
||||
|
||||
class QwebView(orm.AbstractModel):
|
||||
_name = 'website.qweb.field.qweb'
|
||||
_inherit = ['ir.qweb.field.qweb']
|
||||
|
||||
|
||||
def html_to_text(element):
|
||||
""" Converts HTML content with HTML-specified line breaks (br, p, div, ...)
|
||||
|
|
|
@ -128,8 +128,6 @@ class view(osv.osv):
|
|||
|
||||
if isinstance(id_or_xml_id, list):
|
||||
id_or_xml_id = id_or_xml_id[0]
|
||||
if isinstance(id_or_xml_id, (int, long)):
|
||||
id_or_xml_id = self.get_view_xmlid(cr, uid, id_or_xml_id)
|
||||
|
||||
if not context:
|
||||
context = {}
|
||||
|
|
|
@ -221,10 +221,13 @@ class website(osv.osv):
|
|||
)
|
||||
|
||||
def get_template(self, cr, uid, ids, template, context=None):
|
||||
if '.' not in template:
|
||||
template = 'website.%s' % template
|
||||
module, xmlid = template.split('.', 1)
|
||||
model, view_id = request.registry["ir.model.data"].get_object_reference(cr, uid, module, xmlid)
|
||||
if isinstance(template, (int, long)):
|
||||
view_id = template
|
||||
else:
|
||||
if '.' not in template:
|
||||
template = 'website.%s' % template
|
||||
module, xmlid = template.split('.', 1)
|
||||
model, view_id = request.registry["ir.model.data"].get_object_reference(cr, uid, module, xmlid)
|
||||
return self.pool["ir.ui.view"].browse(cr, uid, view_id, context=context)
|
||||
|
||||
def _render(self, cr, uid, ids, template, values=None, context=None):
|
||||
|
|
Loading…
Reference in New Issue