Merge lp:~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh into lp:openerp-web/6.1

Proposed by Mohammed Shekha(Open ERP)
Status: Needs review
Proposed branch: lp:~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh
Merge into: lp:openerp-web/6.1
Diff against target: 18 lines (+4/-0)
1 file modified
addons/web/static/src/js/view_form.js (+4/-0)
To merge this branch: bzr merge lp:~openerp-dev/openerp-web/6.1-opw-577195ReloadRecordIssue-msh
Reviewer Review Type Date Requested Status
Mohammed Shekha(Open ERP) (community) Disapprove
OpenERP Core Team Pending
Review via email: mp+118309@code.launchpad.net

Description of the change

Hello,

Fixed the issue of button click which is inside one2many list, here when workflow buttons are clicked record is not reloaded from the database, hence buttons are not shown properly based on workflow state.

Demo -: Manufacturing -> Manufacturing Order -> Edit any record which is in "ready to produce" state, activate workorder tab, click on start, pause or finish button record is not reloaded.

Reason :- The is faced only in one2many list view because when record is reloaded it will read the record from the cache, hence it will load the same record, instead the record should be read from the database, hence removed the cache record object so that the id in read_ids can set into to_get list and goes to read from the database.

Thanks.

To post a comment you must log in.
2427. By Mohammed Shekha(Open ERP)

[FIX]Refixed the issue of record reload in one2many when button is clicked.

Revision history for this message
Mohammed Shekha(Open ERP) (msh-openerp) wrote :

Hello,

The same has been fixed and superseded by http://bazaar.launchpad.net/~openerp/openerp-web/6.1/revision/2451.

Revision No.: 2451.

Hence I am rejecting this one.

Thanks.

review: Disapprove

Unmerged revisions

2427. By Mohammed Shekha(Open ERP)

[FIX]Refixed the issue of record reload in one2many when button is clicked.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'addons/web/static/src/js/view_form.js'
2--- addons/web/static/src/js/view_form.js 2012-07-20 12:48:22 +0000
3+++ addons/web/static/src/js/view_form.js 2012-08-09 05:43:18 +0000
4@@ -2805,10 +2805,14 @@
5 });
6 },
7 do_button_action: function (name, id, callback) {
8+ var self = this;
9 var _super = _.bind(this._super, this);
10
11 this.o2m.view.do_save().then(function () {
12 _super(name, id, callback);
13+ var cached = _.detect(self.dataset.cache, function(x) {return x.id === id; });
14+ var idx = _.indexOf(self.dataset.cache, cached);
15+ self.dataset.cache.splice(idx, 1)
16 });
17 }
18 });