Merge pull request #288 from odoo-dev/saas-4-mass_mailing_fixes-tde
authorThibault Delavallée <tde@openerp.com>
Tue, 3 Jun 2014 10:03:42 +0000 (12:03 +0200)
committerThibault Delavallée <tde@openerp.com>
Tue, 3 Jun 2014 10:03:42 +0000 (12:03 +0200)
[FIX] mass_mailing: fixes
- backport (+ cleaning) of eb22d202e48068a82ddcfa3878dbe0cbb845cc9c (saas-5): mail_thread: routing: instead of exclusive routing heuristics, use each case as a fallback of the previous.
- better fix for dd36a0e5093df90bd92667d26f529a3a79fe0397 (saas-5): mail_thread: routing: fixed replies always choosen even when replying to emails with a specified reply_to (using ref_match in the algorithm)
- backport of d6a2ae642b1a48ce6cb227c3cde2deca847a0a33 (saas-5): avoid evaluating a False /  None domain
- fixed keeping the original message for routing, only when choosing to reply in the original thread (notification=True)
- mail_thread: routing: fixed replies always chosen even when replying to emails with a specified reply_to (using ref_match in the algorithm)

addons/edi/static/src/js/edi.js
addons/gamification/models/goal.py
addons/web_kanban/static/src/js/kanban.js
openerp/osv/orm.py

index 91d2b84..69f0635 100644 (file)
@@ -39,16 +39,15 @@ instance.edi.EdiImport = instance.web.Widget.extend({
             });
         }
         else {
-            $('<div>').dialog({
-                modal: true,
-                title: 'Import Successful!',
-                buttons: {
-                    Ok: function() {
-                        $(this).dialog("close");
-                        window.location = "/";
+            new instance.web.Dialog(this,{
+                    title: 'Import Successful!',
+                    buttons: {
+                        Ok: function() {
+                            this.parents('.modal').modal('hide');
+                            window.location = "/";
+                        }
                     }
-                }
-            }).html(_t('The document has been successfully imported!'));
+                },$('<div>').html(_t('The document has been successfully imported!'))).open();
         }
     },
     on_imported_error: function(response){
@@ -58,13 +57,12 @@ instance.edi.EdiImport = instance.web.Widget.extend({
             msg += "\n " + _t("Reason:") + response.data.message;
         }
         var params = {error: response, message: msg};
-        $(instance.web.qweb.render("CrashManager.warning", params)).dialog({
-            title: _t("Document Import Notification"),
-            modal: true,
-            buttons: {
-                Ok: function() { $(this).dialog("close"); }
-            }
-        });
+        new instance.web.Dialog(this,{
+                title: _t("Document Import Notification"),
+                buttons: {
+                    Ok: function() { this.parents('.modal').modal('hide');}
+                }
+            },$(instance.web.qweb.render("CrashManager.warning", params))).open();
     }
 });
 
index 904e6fa..266e25a 100644 (file)
@@ -333,7 +333,8 @@ class gamification_goal(osv.Model):
 
                         if definition.computation_mode == 'sum':
                             field_name = definition.field_id.name
-                            res = obj.read_group(cr, uid, domain, [field_name], [field_name], context=context)
+                            # TODO for master: group on user field in batch mode
+                            res = obj.read_group(cr, uid, domain, [field_name], [], context=context)
                             new_value = res and res[0][field_name] or 0.0
 
                         else:  # computation mode = count
index db40561..5e5d392 100644 (file)
@@ -779,9 +779,9 @@ instance.web_kanban.KanbanGroup = instance.web.Widget.extend({
         });
         var am = instance.webclient.action_manager;
         var form = am.dialog_widget.views.form.controller;
-        form.on("on_button_cancel", am.dialog, am.dialog.close);
+        form.on("on_button_cancel", am.dialog, function() { return am.dialog.$dialog_box.modal('hide'); });
         form.on('record_saved', self, function() {
-            am.dialog.close();
+            am.dialog.$dialog_box.modal('hide');
             self.view.do_reload();
         });
     },
index cb033ed..fdd39d4 100644 (file)
@@ -2459,7 +2459,7 @@ class BaseModel(object):
         fetched_data = cr.dictfetchall()
 
         if not groupby_fields:
-            return {r.pop('id'): r for r in fetched_data}
+            return fetched_data
 
         many2onefields = [gb['field'] for gb in annotated_groupbys if gb['type'] == 'many2one']
         if many2onefields: