diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml index 3bc6e4d6322..287329b8129 100644 --- a/bin/addons/base/base_data.xml +++ b/bin/addons/base/base_data.xml @@ -1021,6 +1021,7 @@ EUR EUR + € 0.01 4 @@ -1031,7 +1032,7 @@ - + OpenERP S.A. @@ -1041,7 +1042,7 @@ IBAN: BE74 1262 0132 6907 - SWIFT: CPHBBE75 - VAT: BE0477.472.701 - + OpenERP S.A. @@ -1082,7 +1083,7 @@ - + Bs VEB @@ -1095,7 +1096,7 @@ - + CAD CAD @@ -1108,8 +1109,8 @@ - - + + CHF CHF @@ -1122,7 +1123,7 @@ - + BRL BRL @@ -1135,7 +1136,7 @@ - + CNY CNY @@ -1148,8 +1149,8 @@ - - + + COP COP @@ -1157,7 +1158,7 @@ 4 - + Kč CZK @@ -1165,7 +1166,7 @@ 4 - + kr DKK @@ -1178,8 +1179,8 @@ - - + + Ft HUF @@ -1187,7 +1188,7 @@ 4 - + Rs IDR @@ -1195,7 +1196,7 @@ 4 - + Ls LVL @@ -1208,8 +1209,8 @@ - - + + kr NOK @@ -1222,8 +1223,8 @@ - - + + PAB PAB @@ -1236,8 +1237,8 @@ - - + + zł PLN @@ -1245,7 +1246,7 @@ 4 - + kr SEK @@ -1253,7 +1254,7 @@ 4 - + GBP GBP @@ -1266,7 +1267,7 @@ - + ARS ARS @@ -1274,13 +1275,13 @@ 4 - + 5.6 - - + + INR Rs @@ -1317,7 +1318,7 @@ - + UAH UAH diff --git a/bin/addons/base/report/custom_new.xsl b/bin/addons/base/report/custom_new.xsl index 5a385f3e7eb..6680314ca40 100644 --- a/bin/addons/base/report/custom_new.xsl +++ b/bin/addons/base/report/custom_new.xsl @@ -14,8 +14,8 @@ - - + + @@ -114,7 +114,7 @@ - + @@ -131,7 +131,7 @@ - + diff --git a/bin/addons/base/res/res_currency.py b/bin/addons/base/res/res_currency.py index 0d03c067223..2cd7682be5b 100644 --- a/bin/addons/base/res/res_currency.py +++ b/bin/addons/base/res/res_currency.py @@ -47,6 +47,7 @@ class res_currency(osv.osv): _columns = { 'name': fields.char('Currency', size=32, required=True), 'code': fields.char('Code', size=3), + 'symbol': fields.char('Symbol', size=3), 'rate': fields.function(_current_rate, method=True, string='Current Rate', digits=(12,6), help='The rate of the currency to the currency of rate 1'), 'rate_ids': fields.one2many('res.currency.rate', 'currency_id', 'Rates'), diff --git a/bin/addons/base/res/res_currency_view.xml b/bin/addons/base/res/res_currency_view.xml index e469e520353..9571633f9ea 100644 --- a/bin/addons/base/res/res_currency_view.xml +++ b/bin/addons/base/res/res_currency_view.xml @@ -31,6 +31,7 @@ + diff --git a/bin/report/printscreen/ps_form.py b/bin/report/printscreen/ps_form.py index 2ee22ebcaf9..227e3084bbf 100644 --- a/bin/report/printscreen/ps_form.py +++ b/bin/report/printscreen/ps_form.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ############################################################################## -# +# # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). # @@ -15,7 +15,7 @@ # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . +# along with this program. If not, see . # ############################################################################## @@ -54,17 +54,11 @@ class report_printscreen_list(report_int): if not context: context={} datas['ids'] = ids - pool = pooler.get_pool(cr.dbname) - model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)]) - if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id, context).name - self.title = model_desc - else: - model_desc = model._description - self.title = model_desc - model = pool.get(datas['model']) - result = model.fields_view_get(cr, uid, view_type='tree', context=context) + pool = pooler.get_pool(cr.dbname) + # title come from description of model which are specified in py file. + self.title = model._description + result = model.fields_view_get(cr, uid, view_type='form', context=context) fields_order = self._parse_string(result['arch']) rows = model.read(cr, uid, datas['ids'], result['fields'].keys() ) diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index de54ef83c57..a350f52aa8c 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -65,13 +65,9 @@ class report_printscreen_list(report_int): self.groupby_no_leaf = context.get('group_by_no_leaf',False) pool = pooler.get_pool(cr.dbname) model = pool.get(datas['model']) - model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)]) - if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).name - self.title = model_desc - else: - model_desc = model._description - self.title = model_desc + # Title come from description of model which are specified in py file. + model_desc = model._description + self.title = model_desc datas['ids'] = ids model = pooler.get_pool(cr.dbname).get(datas['model']) result = model.fields_view_get(cr, uid, view_type='tree', context=context) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index 6e7c6b95696..aeb04ed21b6 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -110,7 +110,7 @@ class _date_format(str, _format): if self.val: if getattr(self,'name', None): date = datetime.strptime(self.name, DT_FORMAT) - return date.strftime(str(self.lang_obj.date_format)) + return date.strftime(str(self.lang_obj.date_format)) return self.val class _dttime_format(str, _format): @@ -253,20 +253,11 @@ class rml_parse(object): date_format = self.lang_dict['date_format'] parse_format = DT_FORMAT if date_time: + value=value.split('.')[0] date_format = date_format + " " + self.lang_dict['time_format'] parse_format = DHM_FORMAT - - # filtering time.strftime('%Y-%m-%d') -# if type(value) == type(''): -# parse_format = DHM_FORMAT -# if (not date_time): -# return str(value) - if not isinstance(value, time.struct_time): - try: - date = datetime.datetime(str(value), parse_format) - except:# sometimes it takes converted values into value, so we dont need conversion. - return str(value) + return time.strftime(date_format, time.strptime(value, parse_format)) else: date = datetime(*value.timetuple()[:6]) return date.strftime(date_format) diff --git a/bin/tools/safe_eval.py b/bin/tools/safe_eval.py index c69577b85f5..67d2a98e973 100644 --- a/bin/tools/safe_eval.py +++ b/bin/tools/safe_eval.py @@ -262,6 +262,8 @@ def safe_eval(expr, globals_dict=None, locals_dict=None, mode="eval", nocopy=Fal 'map': map, 'abs': abs, 'reduce': reduce, + 'filter': filter, + 'round': round, } ) return eval(test_expr(expr,_SAFE_OPCODES, mode=mode), globals_dict, locals_dict)