Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
2209 Zobrazení

If you delete partner from form view. you go actions> delete and then you get the message "Do you really want to delete this records?"

This is original method

on_button_delete: function() {
        var self = this;
        var def = $.Deferred();
        this.has_been_loaded.done(function() {
            if (self.datarecord.id && confirm(_t("Do you really want to delete this recordss?"))) {
                self.dataset.unlink([self.datarecord.id]).done(function() {
                    if (self.dataset.size()) {
                        self.execute_pager_action('next');
                    } else {
                        self.do_action('history_back');
                    }
                    def.resolve();
                });
            } else {
                $.async_when().done(function () {
                    def.reject();
                });
            }
        });
        return def.promise();

but if you add a contact to partner, when you want to delete it(it's in the bottom inside contact & addresses tab) there is no such message, so I want to make the same popup work when I delete a contact from a partner. But as have 0 knowledge in JS I need your help guys.

Avatar
Zrušit

Can mention which Odoo version are you using?

Related Posts Odpovědi Zobrazení Aktivita
0
čvc 25
331
1
čvc 25
5151
0
čvc 25
714
0
čvn 25
784
1
čvn 25
950