Bhumi Thakkar (Open ERP) has proposed merging
lp:~openerp-dev/openerp-web/6.1-opw-576817-bth into lp:openerp-web/6.1.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576817-bth/+merge/116432
Hello,
In email template, Add sidebar button,context error in window action.
1. Settings => Configuration => Email => Templates
2. Open any record. Open Advanced tab, Add sidebar button.
3. Settings => Customization => Low Level Objects => Actions => Window Actions
4. Open Send Mail Action and context is :
{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : 1}
Note: mail.compose.template_id is that on which template you add sidebar button.
Observed: error is coming : TypeError: Context
{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : 1} " is
not a dict or a nonliteral Context
Expected: Error not coming and and should in a dict format or in literal
Context and perform operation.
{'mail.compose.message.mode':'mass_mail', 'mail.compose.template_id' : 2}
context got in string format so have to convert in json object.
Thanks.
--
https://code.launchpad.net/~openerp-dev/openerp-web/6.1-opw-576817-bth/+merge/116432
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openerp-web/6.1-opw-576817-bth.
=== modified file 'addons/web/static/src/js/views.js'
--- addons/web/static/src/js/views.js 2012-06-29 10:53:25 +0000
+++ addons/web/static/src/js/views.js 2012-07-24 10:07:15 +0000
@@ -1133,7 +1133,15 @@
active_model: dataset.model
});
}
- ncontext.add(action.context || {});
+ if(action.context && typeof(action.context) == "string") {
+ action.context = action.context.replace(/'/g, '"')
+ ncontext.add(jQuery.parseJSON(action.context));
+ } else if(action.context && typeof(action.context) == "object") {
+ ncontext.add(action.context);
+ }
+ else{
+ ncontext.add({});
+ }
return self.rpc('/web/session/eval_domain_and_context', {
contexts: [ncontext],
domains: []
_______________________________________________
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