Ejemplo n.º 1
0
 def _get_model_merger_view(self, field_names, active_model):
     tree = self.env.ref('xopgi_object_merger.view_merger_tree')
     tree.model = active_model
     self._get_view_field_tree(tree, field_names)
     res = get_treeview_action(self.env[active_model])
     res['name'] = _("Merger object")
     res['view_id'] = tree.id
     res['context'] = {'force_view': True, 'create': False}
     return res
Ejemplo n.º 2
0
    def action_merge_view(self):
        '''Merger objects from models that do not have a menu entry,
        Models that do not have the reserved field name are built
        in a view by removing the automatic fields.

        '''
        active_model = self.model
        description = self.env[active_model]._description
        field_names = self._get_show_fields(active_model)
        if 'name' in field_names:
            res = get_treeview_action(self.env[active_model])
            res['name'] = 'Merge %s' % description
            res['context'] = {'create': False}
        else:
            res = self._get_model_merger_view(field_names, active_model)
        return res
 def test_views_load(self):
     from xoeuf.models.extensions import get_treeview_action
     self.Model.search([], limit=1).get_formview_action()
     get_treeview_action(self.Model.search([], limit=1))
Ejemplo n.º 4
0
 def generate(self):
     from xoeuf.models.extensions import get_treeview_action
     moves = self._do_generate()
     return get_treeview_action(moves)