Merge lp:~openerp-dev/openobject-addons/7.0-opw-586534-msh into lp:openobject-addons/7.0

Proposed by Mohammed Shekha(Open ERP)
Status: Merged
Approved by: Naresh(OpenERP)
Approved revision: no longer in the source branch.
Merged at revision: 9210
Proposed branch: lp:~openerp-dev/openobject-addons/7.0-opw-586534-msh
Merge into: lp:openobject-addons/7.0
Diff against target: 23 lines (+3/-3)
1 file modified
share/static/src/js/share.js (+3/-3)
To merge this branch: bzr merge lp:~openerp-dev/openobject-addons/7.0-opw-586534-msh
Reviewer Review Type Date Requested Status
Olivier Dony (Odoo) Approve
Naresh(OpenERP) (community) Approve
Review via email: mp+151876@code.launchpad.net

Description of the change

Hello,

Fixed the issue of context not passed call, due to which view strings are not translated.

Demo:- Go to any menu tree view, select any record and share that record(do this any other language than english), wizard is opened but string of wizard is not translated.

Reason: Context is not passed in method call.

Thanks.

To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) :
review: Approve
Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Looks good, but the addition of $.when() was not necessary as DataSet.create() always returns a Deferred, and the use of then() instead of done() was not necessary either (cfr the jQuery Deferred documentation).

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'share/static/src/js/share.js'
--- share/static/src/js/share.js 2012-12-15 16:28:57 +0000
+++ share/static/src/js/share.js 2013-03-06 06:00:32 +0000
@@ -16,7 +16,7 @@
16 domains: [domain],16 domains: [domain],
17 contexts: [view.dataset.context]17 contexts: [view.dataset.context]
18 }).done(function (result) {18 }).done(function (result) {
19 Share.create({19 $.when(Share.create({
20 name: action.name,20 name: action.name,
21 record_name: rec_name,21 record_name: rec_name,
22 domain: result.domain,22 domain: result.domain,
@@ -24,8 +24,8 @@
24 user_type: user_type || 'embedded',24 user_type: user_type || 'embedded',
25 view_type: view.fields_view.type,25 view_type: view.fields_view.type,
26 invite: invite || false,26 invite: invite || false,
27 }).done(function(share_id) {27 })).then(function(share_id) {
28 var step1 = Share.call('go_step_1', [[share_id]]).done(function(result) {28 var step1 = Share.call('go_step_1', [[share_id], result.context]).done(function(result) {
29 var action = result;29 var action = result;
30 self.do_action(action);30 self.do_action(action);
31 });31 });