跳至内容
菜单
此问题已终结
2195 查看

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.

形象
丢弃

Can mention which Odoo version are you using?

相关帖文 回复 查看 活动
0
7月 25
323
1
7月 25
5128
0
7月 25
685
0
6月 25
748
1
6月 25
919