Skip to Content
Menu
This question has been flagged
1 Reply
3156 Views

I am trying to replace DUPLICATE button. I tried and add the button in base.xml

<button t-if="widget.is_action_enabled('duplicate')"
                type="button" class="oe_button on_button_duplicate oe_sidebar_action_a" target="_blank" >Duplicate</button>

But an i am unable to call the function. Where is the function located.

Remove DUPLICATE link from More dropdown and paste it next to EDIT or CREATE button.

Avatar
Discard
Author Best Answer

I got solution

go to base.css file and and below line:

.openerp_ie .oe_view_manager_buttons button .oe_form_button_duplicate {
  padding-top: 0;
  padding-bottom: 0;
}

go to view_form.js and add below line: line number 180

this.$buttons.on('click', '.oe_form_button_create',
                         this.guard_active(this.on_button_create));
        this.$buttons.on('click', '.oe_form_button_edit',
                         this.guard_active(this.on_button_edit));
        ***this.$buttons.on('click', '.oe_form_button_duplicate',
                         this.guard_active(this.on_button_duplicate));***
        this.$buttons.on('click', '.oe_form_button_save',
                         this.guard_active(this.on_button_save));
        this.$buttons.on('click', '.oe_form_button_cancel',
                         this.guard_active(this.on_button_cancel));

we will get that button.

go to base.xml and add below line:

<button t-if="widget.is_action_enabled('create')"
                type="button" class="oe_button oe_form_button_duplicate" >Duplicate</button>
Avatar
Discard