From c2d3bf17441a88ff6111864c62a123bf3224613a Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 25 Aug 2010 17:19:54 +0530 Subject: [PATCH 1/7] [FIX]:date format is not change according lang. bzr revid: apa@tinyerp.com-20100825114954-1154iy1l7lxadsy9 --- bin/report/report_sxw.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index 6e7c6b95696..07a4be6db19 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): @@ -263,10 +263,11 @@ class rml_parse(object): # 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)) +# try: +# date = datetime.datetime(str(value), parse_format) +# except:# sometimes it takes converted values into value, so we dont need conversion. +# return str(value) else: date = datetime(*value.timetuple()[:6]) return date.strftime(date_format) From 0d1871526b877abe2dd8bb2242db1f5221da1222 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 25 Aug 2010 18:41:51 +0530 Subject: [PATCH 2/7] [FIX]:date format is not change according lang. bzr revid: apa@tinyerp.com-20100825131151-aptf93zove4eb08k --- bin/report/report_sxw.py | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index 07a4be6db19..74cce73686d 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -253,6 +253,7 @@ 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 From 49f107c62855dc2419a1d3f82029ff02f3354438 Mon Sep 17 00:00:00 2001 From: "saz(openerp)" <> Date: Tue, 31 Aug 2010 16:30:46 +0530 Subject: [PATCH 3/7] [iMP]:base:print screen report bzr revid: apa@tinyerp.com-20100831110046-h0z46hjccqh4x35a --- bin/report/printscreen/ps_form.py | 4 ++-- bin/report/printscreen/ps_list.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/report/printscreen/ps_form.py b/bin/report/printscreen/ps_form.py index 2ee22ebcaf9..312d5480a93 100644 --- a/bin/report/printscreen/ps_form.py +++ b/bin/report/printscreen/ps_form.py @@ -55,9 +55,9 @@ class report_printscreen_list(report_int): context={} datas['ids'] = ids pool = pooler.get_pool(cr.dbname) - model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._name)]) + model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._description)]) if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id, context).name + model_desc = pool.get('ir.model').browse(cr, uid, model_id, context).description self.title = model_desc else: model_desc = model._description diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index de54ef83c57..9525e0dd19d 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -65,9 +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)]) + model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._description)]) if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).name + model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).description self.title = model_desc else: model_desc = model._description From b453709b83947a366344acce8dc5f12794cb5450 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Tue, 31 Aug 2010 18:02:00 +0530 Subject: [PATCH 4/7] [iMP]:Added filter and round function in global dict. bzr revid: apa@tinyerp.com-20100831123200-d2y2ced1mnd0fv3g --- bin/tools/safe_eval.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/tools/safe_eval.py b/bin/tools/safe_eval.py index c69577b85f5..5105bee1f7f 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) From a8f81c77a07b8fe94ab16a97582c59dccb46c653 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 1 Sep 2010 17:23:10 +0530 Subject: [PATCH 5/7] [IMP]:improvd print screen bzr revid: apa@tinyerp.com-20100901115310-u5xug0l144vqrit0 --- bin/report/printscreen/ps_form.py | 25 +++++++++++++------------ bin/report/printscreen/ps_list.py | 14 +++++++------- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/bin/report/printscreen/ps_form.py b/bin/report/printscreen/ps_form.py index 312d5480a93..80df82d21bb 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,18 @@ 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._description)]) - if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id, context).description - 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) +# model_id = pool.get('ir.model').search(cr, uid, [('model','=',model._description)]) +# if model_id: +# model_desc = pool.get('ir.model').browse(cr, uid, model_id, context).description +# self.title = model_desc +# else: +# model_desc = model._description + 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 9525e0dd19d..695407d64d1 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -65,13 +65,13 @@ 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._description)]) - if model_id: - model_desc = pool.get('ir.model').browse(cr, uid, model_id[0], context).description - self.title = model_desc - else: - model_desc = model._description - self.title = model_desc +# 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).description +# self.title = model_desc +# else: + model_desc = model._description + self.title = model._description datas['ids'] = ids model = pooler.get_pool(cr.dbname).get(datas['model']) result = model.fields_view_get(cr, uid, view_type='tree', context=context) From ed2a867de7b0bf4673d1938422a3aecc4eb93085 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Wed, 1 Sep 2010 17:43:18 +0530 Subject: [PATCH 6/7] [ADD]:add symbol field in res.currency bzr revid: apa@tinyerp.com-20100901121318-t428utljddz2cszm --- bin/addons/base/base_data.xml | 59 ++++++++++++----------- bin/addons/base/res/res_currency.py | 1 + bin/addons/base/res/res_currency_view.xml | 5 +- 3 files changed, 34 insertions(+), 31 deletions(-) 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/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 a26d22346ce..10b804a1be0 100644 --- a/bin/addons/base/res/res_currency_view.xml +++ b/bin/addons/base/res/res_currency_view.xml @@ -31,8 +31,9 @@ + - + @@ -44,7 +45,7 @@ - +
From c0e28370f4c6a3b2e106815be5f40f33f4b44fa4 Mon Sep 17 00:00:00 2001 From: apa-tiny Date: Mon, 6 Sep 2010 11:31:03 +0530 Subject: [PATCH 7/7] [IMP]:improved print screen bzr revid: apa@tinyerp.com-20100906060103-lp6gsx9jtkr9jh9r --- bin/addons/base/report/custom_new.xsl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 @@ - +