openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #05520
[Merge] lp:~openerp-dev/openobject-client-web/6.0-opw-4325-sma into lp:openobject-client-web/6.0
Sananaz (Open ERP) has proposed merging lp:~openerp-dev/openobject-client-web/6.0-opw-4325-sma into lp:openobject-client-web/6.0.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-4325-sma/+merge/57815
Hello,
> Go to Sales > Opportunities > Create new opportunity
> Click on `Create` Button, then open popup with 2 options
1> Create partner
2> Link to an existing partner
- Select `Link to an existing partner` and select any customer, it open selected customer and also fill Customer and Contact fields of opportunity form. (Which is not happen in web)
- Same problem with `Create partner` not reflected opportunity form view with new partner.
Thanks
--
https://code.launchpad.net/~openerp-dev/openobject-client-web/6.0-opw-4325-sma/+merge/57815
Your team OpenERP R&D Team is subscribed to branch lp:~openerp-dev/openobject-client-web/6.0-opw-4325-sma.
=== modified file 'addons/openerp/controllers/actions.py'
--- addons/openerp/controllers/actions.py 2011-03-25 07:20:33 +0000
+++ addons/openerp/controllers/actions.py 2011-04-15 07:14:30 +0000
@@ -341,6 +341,13 @@
# then used back as a URL
action.pop('search_view', None)
+ # when perform any button action on unsaved-record which returns 'ir.action.act_window'
+ # which pop-up new window but 'appcontent' is not reloaded
+ # for that passing active_id in headers, to get it in openAction
+ if getattr(cherrypy.request, 'params', []):
+ if getattr(cherrypy.request.params, 'context', {}):
+ cherrypy.response.headers['active_id'] = cherrypy.request.params.context.get('active_id')
+
# Add 'opened' mark to indicate we're now within the popup and can
# continue on during the second round of execution
payload = str({
=== modified file 'addons/openerp/static/javascript/openerp/openerp.base.js'
--- addons/openerp/static/javascript/openerp/openerp.base.js 2011-02-18 12:55:05 +0000
+++ addons/openerp/static/javascript/openerp/openerp.base.js 2011-04-15 07:14:30 +0000
@@ -91,8 +91,10 @@
}
return function (data, status, xhr) {
var target;
+ var active_id;
if(xhr.getResponseHeader)
target = xhr.getResponseHeader('X-Target');
+ active_id = xhr.getResponseHeader('active_id')
if(target) {
var _openAction;
if (window.top.openAction) {
@@ -100,7 +102,7 @@
} else {
_openAction = openAction;
}
- _openAction(xhr.getResponseHeader('Location'), target);
+ _openAction(xhr.getResponseHeader('Location'), target, active_id);
return;
}
if(url) {
@@ -154,7 +156,7 @@
* @param action_url the URL of the action to open
* @param target the target, if any, defaults to 'current'
*/
-function openAction(action_url, target) {
+function openAction(action_url, target, terp_id) {
var $dialogs = jQuery('.action-dialog');
switch(target) {
case 'new':
@@ -173,6 +175,9 @@
break;
case 'popup':
window.open(action_url);
+ if (terp_id) {
+ window.top.editRecord(terp_id);
+ }
break;
case 'current':
default:
Follow ups