Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

How do I limit bread crumb depth?

By
AJ Schrafel Paper Corp
on 7/23/13, 4:18 PM 1,307 views

I have a form view with two buttons. One button accepts a change and the other button rejects a change, both functions write the result to the database then move to the next record which has not been accepted or denied.

My problem is after reviewing 10 or 15 records, i have a whole screen full of bread crumbs i don't need. What can i return in the function which will tell openERP not to create a new bread crumb?

Here is what my functions return:

            return {
                'name': 'act_sync_display_form_view',
                'res_id': res_id[0],
                'view_type': 'form',
                'res_model': 'module.sync',
                'view_id': view_id,
                'view_mode': 'form',
                'nodestroy': False,
                'target': 'current',
                'context': context,
                'type': 'ir.actions.act_window',
            }
1
Evans Bernier
On 3/31/15, 3:13 PM

When you call your action, you can add an "options" for that: clear_breadcrumbs

In my case, I am on javascript side.

var action = {	
     name: 'act_sync_display_form_view',
     res_id: res_id[0],
     view_type: 'form',
     res_model: 'module.sync',
     view_id: view_id,
     view_mode: 'form',
     nodestroy: False,
     target: 'current',
     context: context,
     type: 'ir.actions.act_window',
};

var options = {
     clear_breadcrumbs: true,
}


self.do_action(action, options);

0
Wang Yue Ming
On 8/17/14, 1:11 AM

Maybe you can do that by hacking views.js in web module.

    ir_actions_act_window: function (action, options) {
        var self = this;
        if ('clear_breadcrumb' in action) {
            this.clear_breadcrumbs();
        }

 

And also add a line to your returned value as below:

            return {
                'name': 'act_sync_display_form_view',
                'res_id': res_id[0],
                'view_type': 'form',
                'res_model': 'module.sync',
                'view_id': view_id,
                'view_mode': 'form',
                'nodestroy': False,
                'target': 'current',
                'context': context,
                'clear_breadcrumb': True,
                'type': 'ir.actions.act_window',
            }

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

0 follower(s)

Stats

Asked: 7/23/13, 4:18 PM
Seen: 1307 times
Last updated: 3/31/15, 3:13 PM