StackUP
StackUP

Reputation: 1303

warnings in OpenERP while nevigating from page?

I have some questions :

  1. Is is possible to show a warning message while saving a record(in create) method like record saved successfully.

2.I want to show a warning message while nevigating from the page after clicking create and leaving page without save by clicking on some menu item ,backspace or back button of browser?

Upvotes: 0

Views: 562

Answers (2)

user3035230
user3035230

Reputation: 11

strong textHi Yes sure you can raise Alert Message when saving record through JS script it is possible you have to write single line code in path addons/web/static/src/js/viewform.js

on_button_save: function() {
    var self = this;
    return this.save().done(function(result){
        **if (!confirm(_t("The record has been saved"))) {
            return false;
        }**
        self.trigger("save", result);
        self.reload().then(function() {
            self.to_view_mode();
            var parent = self.ViewManager.ActionManager.getParent();
            if(parent){
                parent.menu.do_reload_needaction();
            }
        });
    });
},

Upvotes: 0

Heroic
Heroic

Reputation: 980

  1. I can't understand why you want to show a warning message on save when everything is goes fine. Warning message is shown when something goes wrong or user break a rule eg. when user don't have a right to create a record of particular object and user try to create a record.

IMHO It is better to use a workflow to define the flow of process like we have a two state new and done default state is new when user create and enter all required field and click on save trigger a workflow and change state from new to done. That tell user that he complete the flow like wise you can put a state as you required. for more detail on workflow please read from http://doc.openerp.com/v6.0/developer/3_9_Workflow_Business_Process/index.html

2.I think this feature is already implemented in new upcoming version 7.0.

Upvotes: 1

Related Questions