if ('lang' in context) and not result:
if node.get('string'):
trans = self.pool.get('ir.translation')._get_source(cr, user, self._name, 'view', context['lang'], node.get('string'))
- if not trans and ('base_model_name' in context):
+ if trans == node.get('string') and ('base_model_name' in context):
++ # If translation is same as source, perhaps we'd have more luck with the alternative model name
++ # (in case we are in a mixed situation, such as an inherited view where parent_view.model != model
trans = self.pool.get('ir.translation')._get_source(cr, user, context['base_model_name'], 'view', context['lang'], node.get('string'))
if trans:
node.set('string', trans)
result['field_parent'] = False
result['view_id'] = 0
- xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=context)
+ if parent_view_model != self._name:
- ctx = context.copy()
- ctx['base_model_name'] = parent_view_model
++ ctx = context.copy()
++ ctx['base_model_name'] = parent_view_model
+ else:
- ctx = context
++ ctx = context
+ xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
result['arch'] = xarch
result['fields'] = xfields