Hemendra Paregi(Open ERP) has proposed merging 
lp:~openerp-dev/openerp-web/trunk-bug-862138-hpa into lp:openerp-web.

Requested reviews:
  OpenERP R&D Web Team (openerp-dev-web)
Related bugs:
  Bug #862138 in OpenERP Web: "when tried to click on answer button"
  https://bugs.launchpad.net/openerp-web/+bug/862138

For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-862138-hpa/+merge/78932

Add Reference Context if context found on Button.
-- 
https://code.launchpad.net/~openerp-dev/openerp-web/trunk-bug-862138-hpa/+merge/78932
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openerp-web/trunk-bug-862138-hpa.
=== modified file 'addons/web/static/src/js/view_form.js'
--- addons/web/static/src/js/view_form.js	2011-10-10 21:46:34 +0000
+++ addons/web/static/src/js/view_form.js	2011-10-11 09:33:24 +0000
@@ -15,7 +15,7 @@
     /**
      * @constructs openerp.web.FormView
      * @extends openerp.web.View
-     * 
+     *
      * @param {openerp.web.Session} session the current openerp session
      * @param {openerp.web.DataSet} dataset the dataset this view will work with
      * @param {String} view_id the identifier of the OpenERP view object
@@ -918,7 +918,8 @@
     },
     on_confirmed: function() {
         var self = this;
-
+		if(this.node.attrs.context && (!!f_context.__ref))
+			_.extend(this.view.dataset.context, this.view.datatarecord);
         return this.view.do_execute_action(
             this.node.attrs, this.view.dataset, this.view.datarecord.id, function () {
                 self.view.reload();
@@ -929,7 +930,7 @@
         this.check_disable();
     },
     check_disable: function() {
-        if (this.force_disabled || !this.view.is_interactible_record()) {
+        if (this.force_disabled || !this.view.is_interactible_record() || this.readonly) {
             this.$element.find("button").attr("disabled", "disabled");
             this.$element.find("button").css("color", "grey");
         } else {
@@ -2678,13 +2679,13 @@
     start: function() {
         this._super();
         this.selected_value = null;
-        
+
         this.render_list();
     },
     set_value: function(value) {
         this._super(value);
         this.selected_value = value;
-        
+
         this.render_list();
     },
     render_list: function() {
@@ -2692,7 +2693,7 @@
         var shown = _.map(((this.node.attrs || {}).statusbar_visible || "").split(","),
             function(x) { return x.trim(); });
         shown = _.select(shown, function(x) { return x.length > 0; });
-            
+
         if (shown.length == 0) {
             this.to_show = this.field.selection;
         } else {
@@ -2700,10 +2701,10 @@
                 return _.indexOf(shown, x[0]) !== -1 || x[0] === self.selected_value;
             });
         }
-        
+
         var content = openerp.web.qweb.render("FieldStatus.content", {widget: this, _:_});
         this.$element.html(content);
-        
+
         var colors = JSON.parse((this.node.attrs || {}).statusbar_colors || "{}");
         var color = colors[this.selected_value];
         if (color) {

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to