Merge commit 'origin/master' into xrg (5.0.3 official)
authorP. Christeas <p_christ@hol.gr>
Sun, 23 Aug 2009 10:02:10 +0000 (13:02 +0300)
committerP. Christeas <p_christ@hol.gr>
Sun, 23 Aug 2009 10:02:10 +0000 (13:02 +0300)
Conflicts:
bin/netsvc.py
bin/tools/config.py
bin/workflow/instance.py

bzr revid: p_christ@hol.gr-20090823100210-2py390qp3hym8jlp

1  2 
bin/netsvc.py
bin/osv/expression.py
bin/osv/orm.py
bin/report/render/rml2pdf/trml2pdf.py
bin/report/report_sxw.py
bin/tools/misc.py
bin/tools/translate.py
bin/workflow/instance.py

diff --cc bin/netsvc.py
@@@ -179,32 -170,17 +179,33 @@@ class Logger(object)
          if isinstance(msg, Exception):
              msg = tools.exception_to_unicode(msg)
  
 -        msg = tools.ustr(msg).strip()
 -        
 -        if level in (LOG_ERROR,LOG_CRITICAL):
 -            msg = common().get_server_environment() + msg
 -
 -        result = msg.split('\n')
 -        if len(result)>1:
 -            for idx, s in enumerate(result):
 -                level_method('[%02d]: %s' % (idx+1, s,))
 -        elif result:
 -            level_method(result[0])
 +      try:
++          msg = tools.ustr(msg).strip()
 +            if level in (LOG_ERROR,LOG_CRITICAL) and tools.config.get_misc('debug','env_info',True):
 +                msg = common().get_server_environment() + msg
 +
-             result = tools.ustr(msg).strip().split('\n')
++            result = msg.split('\n')
 +      except UnicodeDecodeError:
 +              result = msg.strip().split('\n')
 +      try:
 +            if len(result)>1:
 +                for idx, s in enumerate(result):
 +                    level_method('[%02d]: %s' % (idx+1, s,))
 +            elif result:
 +                level_method(result[0])
 +      except IOError,e:
 +              # TODO: perhaps reset the logger streams?
 +              #if logrotate closes our files, we end up here..
 +              pass
 +      except:
 +              # better ignore the exception and carry on..
 +              pass
 +
 +    def set_loglevel(self, level):
 +        log = logging.getLogger()
 +        log.setLevel(logging.INFO) # make sure next msg is printed
 +        log.info("Log level changed to %s" % logging.getLevelName(level))
 +        log.setLevel(level)
  
      def shutdown(self):
          logging.shutdown()
Simple merge
diff --cc bin/osv/orm.py
@@@ -171,10 -171,10 +171,10 @@@ class browse_record(object)
              else:
                  logger = netsvc.Logger()
                  logger.notifyChannel('orm', netsvc.LOG_ERROR, "Programming error: field '%s' does not exist in object '%s' !" % (name, self._table._name))
 -                return False
 +                return None
  
              # if the field is a classic one or a many2one, we'll fetch all classic and many2one fields
-             if col._classic_write:
+             if col._prefetch:
                  # gen the list of "local" (ie not inherited) fields which are classic or many2one
                  ffields = filter(lambda x: x[1]._classic_write, self._table._columns.items())
                  # gen the list of inherited fields
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge