[MERGE] forward port of branch 7.0 up to 95cff0b
authorChristophe Simonis <chs@odoo.com>
Fri, 27 Jun 2014 14:00:28 +0000 (16:00 +0200)
committerChristophe Simonis <chs@odoo.com>
Fri, 27 Jun 2014 14:00:28 +0000 (16:00 +0200)
1  2 
addons/base_action_rule/base_action_rule.py
addons/web/static/src/js/view_list.js
addons/web/static/src/js/views.js
openerp/modules/loading.py
openerp/report/report_sxw.py

@@@ -156,16 -135,16 +156,16 @@@ class base_action_rule(osv.osv)
          """ Return a wrapper around `old_create` calling both `old_create` and
              `_process`, in that order.
          """
-         def create(cr, uid, vals, context=None):
 -        def wrapper(cr, uid, vals, context=None, **kwargs):
++        def create(cr, uid, vals, context=None, **kwargs):
              # avoid loops or cascading actions
              if context and context.get('action'):
                  return old_create(cr, uid, vals, context=context)
  
              context = dict(context or {}, action=True)
-             new_id = old_create(cr, uid, vals, context=context)
+             new_id = old_create(cr, uid, vals, context=context, **kwargs)
  
 -            # as it is a new record, we do not consider the actions that have a prefilter
 -            action_dom = [('model', '=', model), ('trg_date_id', '=', False), ('filter_pre_id', '=', False)]
 +            # retrieve the action rules to run on creation
 +            action_dom = [('model', '=', model), ('kind', 'in', ['on_create', 'on_create_or_write'])]
              action_ids = self.search(cr, uid, action_dom, context=context)
  
              # check postconditions, and execute actions on the records that satisfy them
          """ Return a wrapper around `old_write` calling both `old_write` and
              `_process`, in that order.
          """
-         def write(cr, uid, ids, vals, context=None):
 -        def wrapper(cr, uid, ids, vals, context=None, **kwargs):
++        def write(cr, uid, ids, vals, context=None, **kwargs):
              # avoid loops or cascading actions
              if context and context.get('action'):
-                 return old_write(cr, uid, ids, vals, context=context)
+                 return old_write(cr, uid, ids, vals, context=context, **kwargs)
  
              context = dict(context or {}, action=True)
              ids = [ids] if isinstance(ids, (int, long, str)) else ids
@@@ -1602,9 -1570,10 +1602,10 @@@ instance.web.ListView.Groups = instance
  
          this.datagroup.list(
              _(this.view.visible_columns).chain()
 -                .filter(function (column) { return column.tag === 'field' })
 +                .filter(function (column) { return column.tag === 'field';})
                  .pluck('name').value(),
              function (groups) {
+                 self.view.$pager.hide();
                  $el[0].appendChild(
                      self.render_groups(groups));
                  if (post_render) { post_render(); }
Simple merge
Simple merge
@@@ -239,10 -237,12 +239,12 @@@ class rml_parse(object)
              obj._context['lang'] = lang
  
      def _get_lang_dict(self):
 -        pool_lang = self.pool.get('res.lang')
 +        pool_lang = self.pool['res.lang']
          lang = self.localcontext.get('lang', 'en_US') or 'en_US'
-         lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])[0]
-         lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids)
+         lang_ids = pool_lang.search(self.cr,self.uid,[('code','=',lang)])
+         if not lang_ids:
+             lang_ids = pool_lang.search(self.cr,self.uid,[('code','=','en_US')])
+         lang_obj = pool_lang.browse(self.cr,self.uid,lang_ids[0])
          self.lang_dict.update({'lang_obj':lang_obj,'date_format':lang_obj.date_format,'time_format':lang_obj.time_format})
          self.default_lang[lang] = self.lang_dict.copy()
          return True