[IMP] : base : improved Warnings
bzr revid: jas@tinyerp.com-20101011093709-4tfz25fmwcfs4vft
This commit is contained in:
parent
795e755b42
commit
484524995a
|
@ -473,7 +473,7 @@ class actions_server(osv.osv):
|
|||
for field in fields:
|
||||
try:
|
||||
obj = getattr(obj, field)
|
||||
except Exception,e :
|
||||
except Exception:
|
||||
logger.notifyChannel('Workflow', netsvc.LOG_ERROR, 'Failed to parse : %s' % (field))
|
||||
|
||||
return obj
|
||||
|
@ -494,7 +494,7 @@ class actions_server(osv.osv):
|
|||
for field in fields:
|
||||
try:
|
||||
obj = getattr(obj, field)
|
||||
except Exception,e :
|
||||
except Exception:
|
||||
logger.notifyChannel('Workflow', netsvc.LOG_ERROR, 'Failed to parse : %s' % (field))
|
||||
|
||||
return obj
|
||||
|
@ -502,7 +502,6 @@ class actions_server(osv.osv):
|
|||
def merge_message(self, cr, uid, keystr, action, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
logger = netsvc.Logger()
|
||||
def merge(match):
|
||||
obj_pool = self.pool.get(action.model_id.model)
|
||||
id = context.get('active_id')
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
from osv import osv,fields
|
||||
from osv.orm import except_orm
|
||||
import pickle
|
||||
from tools.translate import _
|
||||
|
||||
class ir_values(osv.osv):
|
||||
_name = 'ir.values'
|
||||
|
@ -205,7 +204,7 @@ class ir_values(osv.osv):
|
|||
pos+=1
|
||||
try:
|
||||
datas = self.pool.get(model).read(cr, uid, [id], fields, context)
|
||||
except except_orm, e:
|
||||
except except_orm:
|
||||
return False
|
||||
datas= datas and datas[0] or None
|
||||
if not datas:
|
||||
|
|
|
@ -23,7 +23,6 @@ import math
|
|||
|
||||
from osv import fields,osv
|
||||
import tools
|
||||
import ir
|
||||
import pooler
|
||||
from tools.translate import _
|
||||
|
||||
|
|
|
@ -1283,7 +1283,6 @@ class orm_template(object):
|
|||
'fields': xfields
|
||||
}
|
||||
attrs = {'views': views}
|
||||
view = False
|
||||
fields = views.get('field', False) and views['field'].get('fields', False)
|
||||
if node.get('name'):
|
||||
attrs = {}
|
||||
|
@ -2218,7 +2217,6 @@ class orm(orm_template):
|
|||
|
||||
fget = self.fields_get(cr, uid, fields)
|
||||
float_int_fields = filter(lambda x: fget[x]['type'] in ('float', 'integer'), fields)
|
||||
sum = {}
|
||||
flist = ''
|
||||
group_by = groupby
|
||||
if groupby:
|
||||
|
@ -3922,7 +3920,7 @@ class orm(orm_template):
|
|||
return True
|
||||
|
||||
def _apply_ir_rules(self, cr, uid, query, mode='read', context=None):
|
||||
"""Add what's missing in ``query`` to implement all appropriate ir.rules
|
||||
"""Add what's missing in ``query`` to implement all appropriate ir.rules
|
||||
(using the ``model_name``'s rules or the current model's rules if ``model_name`` is None)
|
||||
|
||||
:param query: the current query object
|
||||
|
@ -3978,7 +3976,7 @@ class orm(orm_template):
|
|||
# extract the first field name, to be able to qualify it and add desc/asc
|
||||
m2o_order = m2o_order.split(",",1)[0].strip().split(" ",1)[0]
|
||||
|
||||
# Join the dest m2o table if it's not joined yet. We use [LEFT] OUTER join here
|
||||
# Join the dest m2o table if it's not joined yet. We use [LEFT] OUTER join here
|
||||
# as we don't want to exclude results that have NULL values for the m2o
|
||||
src_table, src_field = qualified_field.replace('"','').split('.', 1)
|
||||
query.join((src_table, dest_model._table, src_field, 'id'), outer=True)
|
||||
|
|
|
@ -139,7 +139,6 @@ class report_printscreen_list(report_int):
|
|||
_append_node('header-date', str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")))
|
||||
l = []
|
||||
t = 0
|
||||
rowcount = 0;
|
||||
strmax = (pageSize[0]-40) * 2.8346
|
||||
temp = []
|
||||
tsum = []
|
||||
|
|
|
@ -19,24 +19,18 @@
|
|||
#
|
||||
##############################################################################
|
||||
from lxml import etree
|
||||
import traceback, sys
|
||||
import StringIO
|
||||
import cStringIO
|
||||
import base64
|
||||
import copy
|
||||
import locale
|
||||
from datetime import datetime
|
||||
import os
|
||||
import re
|
||||
import time
|
||||
from interface import report_rml
|
||||
import preprocess
|
||||
import ir
|
||||
import netsvc
|
||||
import osv
|
||||
import pooler
|
||||
import tools
|
||||
import warnings
|
||||
import zipfile
|
||||
import common
|
||||
from osv.fields import float as float_class, function as function_class
|
||||
|
@ -210,13 +204,10 @@ class rml_parse(object):
|
|||
return res['datas']
|
||||
else :
|
||||
return ''
|
||||
except Exception,e:
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
def setLang(self, lang):
|
||||
if not lang or self.default_lang.has_key(lang):
|
||||
if not lang:
|
||||
key = 'en_US'
|
||||
self.localcontext['lang'] = lang
|
||||
self.lang_dict_called = False
|
||||
for obj in self.objects:
|
||||
|
@ -437,8 +428,6 @@ class report_sxw(report_rml, preprocess.report):
|
|||
)
|
||||
cr.commit()
|
||||
except Exception,e:
|
||||
import traceback, sys
|
||||
tb_s = reduce(lambda x, y: x+y, traceback.format_exception(sys.exc_type, sys.exc_value, sys.exc_traceback))
|
||||
netsvc.Logger().notifyChannel('report', netsvc.LOG_ERROR,str(e))
|
||||
results.append(result)
|
||||
if results:
|
||||
|
@ -512,7 +501,6 @@ class report_sxw(report_rml, preprocess.report):
|
|||
xml_declaration=True)
|
||||
|
||||
rml_dom = etree.XML(rml)
|
||||
body = rml_dom[-1]
|
||||
elements = []
|
||||
key1 = rml_parser.localcontext['name_space']["text"]+"p"
|
||||
key2 = rml_parser.localcontext['name_space']["text"]+"drop-down"
|
||||
|
|
Loading…
Reference in New Issue