From b495cec9d12666240ff4d8a31dc3ec0b97dcbcaf Mon Sep 17 00:00:00 2001 From: Husen Daudi Date: Wed, 28 May 2008 03:03:38 +0000 Subject: [PATCH 001/294] Module for password encryption. bzr revid: hda@tinyerp.com-20080528030338-7izwvtmmmizg9sp5 --- addons/base_crypt/__init__.py | 31 ++++++ addons/base_crypt/__terp__.py | 16 +++ addons/base_crypt/base_update.xml | 29 +++++ addons/base_crypt/crypt.py | 173 ++++++++++++++++++++++++++++++ 4 files changed, 249 insertions(+) create mode 100644 addons/base_crypt/__init__.py create mode 100644 addons/base_crypt/__terp__.py create mode 100644 addons/base_crypt/base_update.xml create mode 100644 addons/base_crypt/crypt.py diff --git a/addons/base_crypt/__init__.py b/addons/base_crypt/__init__.py new file mode 100644 index 00000000000..88854384b0e --- /dev/null +++ b/addons/base_crypt/__init__.py @@ -0,0 +1,31 @@ +############################################################################## +# +# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved. +# Fabien Pinckaers +# +# WARNING: This program as such is intended to be used by professional +# programmers who take the whole responsability of assessing all potential +# consequences resulting from its eventual inadequacies and bugs +# End users who are looking for a ready-to-use solution with commercial +# garantees and support are strongly adviced to contract a Free Software +# Service Company +# +# This program is Free Software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +############################################################################## + +from service import security +import crypt + diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py new file mode 100644 index 00000000000..b6780541289 --- /dev/null +++ b/addons/base_crypt/__terp__.py @@ -0,0 +1,16 @@ +{ + "name" : "Base", + "version" : "1.0", + "author" : "Tiny", + "website" : "http://tinyerp.com", + "category" : "Generic Modules/Base", + "description": "Module for password encryption.", + "depends" : ["base"], + "init_xml" : [], + "demo_xml" : [], + "update_xml" : [ + "base_update.xml", + ], + "active": False, + "installable": True, +} diff --git a/addons/base_crypt/base_update.xml b/addons/base_crypt/base_update.xml new file mode 100644 index 00000000000..06de41b4850 --- /dev/null +++ b/addons/base_crypt/base_update.xml @@ -0,0 +1,29 @@ + + + + + + res.users.form.modif.inherit + res.users + form + + + + + + + + + + res.users.form.inherit1 + res.users + form + + + + + + + + + diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py new file mode 100644 index 00000000000..1d461463a27 --- /dev/null +++ b/addons/base_crypt/crypt.py @@ -0,0 +1,173 @@ +from random import seed, sample +from string import letters, digits +from osv import fields,osv +import pooler +import tools +from service import security + +magic_md5 = '$1$' + +def gen_salt( length=8, symbols=letters + digits ): + seed() + return ''.join( sample( symbols, length ) ) + +import md5 + +def encrypt_md5( raw_pw, salt, magic=magic_md5 ): + hash = md5.new( raw_pw + magic + salt ) + stretch = md5.new( raw_pw + salt + raw_pw).digest() + + for i in range( 0, len( raw_pw ) ): + hash.update( stretch[i % 16] ) + + i = len( raw_pw ) + + while i: + if i & 1: + hash.update('\x00') + else: + hash.update( raw_pw[0] ) + i >>= 1 + + saltedmd5 = hash.digest() + + for i in range( 1000 ): + hash = md5.new() + + if i & 1: + hash.update( raw_pw ) + else: + hash.update( saltedmd5 ) + + if i % 3: + hash.update( salt ) + if i % 7: + hash.update( raw_pw ) + if i & 1: + hash.update( saltedmd5 ) + else: + hash.update( raw_pw ) + + saltedmd5 = hash.digest() + + itoa64 = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' + + rearranged = '' + for a, b, c in ((0, 6, 12), (1, 7, 13), (2, 8, 14), (3, 9, 15), (4, 10, 5)): + v = ord( saltedmd5[a] ) << 16 | ord( saltedmd5[b] ) << 8 | ord( saltedmd5[c] ) + + for i in range(4): + rearranged += itoa64[v & 0x3f] + v >>= 6 + + v = ord( saltedmd5[11] ) + + for i in range( 2 ): + rearranged += itoa64[v & 0x3f] + v >>= 6 + + return magic + salt + '$' + rearranged + +_salt_cache = {} + +def login(db, login, password): + cr = pooler.get_db(db).cursor() + cr.execute( 'select password from res_users where login=%s', (login.encode( 'utf-8' ),) ) + stored_pw = cr.fetchone() + + if stored_pw: + stored_pw = stored_pw[0] + else: + # Return early if no one has a login name like that. + return False + + # Calculate a new password ('updated_pw') from 'stored_pw' if the + # latter isn't encrypted yet. Use that to update the database entry. + # Also update the 'stored_pw' to reflect the change. + + if stored_pw[0:3] != magic_md5: + updated_pw = encrypt_md5( stored_pw, gen_salt() ) + cr.execute( 'update res_users set password=%s where login=%s', (updated_pw.encode( 'utf-8' ), login.encode( 'utf-8' ),) ) + cr.commit() + + cr.execute( 'select password from res_users where login=%s', (login.encode( 'utf-8' ),) ) + stored_pw = cr.fetchone()[0] + + # Calculate an encrypted password from the user-provided + # password ('encrypted_pw'). + + salt = _salt_cache[password] = stored_pw[3:11] + encrypted_pw = encrypt_md5( password, salt ) + + # Retrieve a user id from the database, factoring in an encrypted + # password. + + cr.execute('select id from res_users where login=%s and password=%s and active', (login.encode('utf-8'), encrypted_pw.encode('utf-8'))) + res = cr.fetchone() + cr.close() + + if res: + return res[0] + else: + return False + +#def check_super(passwd): +# salt = _salt_cache[passwd] +# if encrypt_md5( passwd, salt ) == tools.config['admin_passwd']: +# return True +# else: +# raise Exception('AccessDenied') + +def check(db, uid, passwd): + if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): + return True + cr = pooler.get_db(db).cursor() + salt = _salt_cache[passwd] + cr.execute(' select count(*) from res_users where id=%d and password=%s', (int(uid), encrypt_md5( passwd, salt )) ) + res = cr.fetchone()[0] + cr.close() + if not bool(res): + raise Exception('AccessDenied') + if res: + security._uid_cache[uid] = passwd + return bool(res) + + +def access(db, uid, passwd, sec_level, ids): + cr = pooler.get_db(db).cursor() + salt = _salt_cache[passwd] + cr.execute('select id from res_users where id=%s and password=%s', (uid, encrypt_md5( passwd, salt )) ) + res = cr.fetchone() + cr.close() + if not res: + raise Exception('Bad username or password') + return res[0] + +# check if module is installed or not +security.login=login +#security.check_super=check_super +security.access=access +security.check=check + +class users(osv.osv): + _name="res.users" + _inherit="res.users" + # agi - 022108 + # Add handlers for 'input_pw' field. + + def set_pw( self, cr, uid, id, name, value, args, context ): + self.write( cr, uid, id, { 'password' : encrypt_md5( value, gen_salt() ) } ) + del value + + def get_pw( self, cr, uid, ids, name, args, context ): + res = {} + for id in ids: + res[id] = '' + return res + + # Continuing to original code. + + _columns = { + 'input_pw': fields.function( get_pw, fnct_inv=set_pw, type='char', method=True, size=20, string='Password', invisible=True), + } +users() \ No newline at end of file From e830358b25b74430c8bceb3e724f774d440a09d1 Mon Sep 17 00:00:00 2001 From: Husen Daudi Date: Thu, 29 May 2008 04:46:07 +0000 Subject: [PATCH 002/294] Add copyrights bzr revid: hda@tinyerp.com-20080529044607-09pqwt6ihm3j62go --- addons/base_crypt/crypt.py | 54 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index 1d461463a27..7d2ab0e8cf7 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -1,3 +1,41 @@ +# Notice: +# ------ +# +# Implements encrypting functions. +# +# Copyright (c) 2008, F S 3 Consulting Inc. +# +# Maintainer: +# Alec Joseph Rivera (agifs3.ph) +# +# +# Warning: +# ------- +# +# This program as such is intended to be used by professional programmers +# who take the whole responsibility of assessing all potential consequences +# resulting from its eventual inadequacies and bugs. End users who are +# looking for a ready-to-use solution with commercial guarantees and +# support are strongly adviced to contract a Free Software Service Company. +# +# This program is Free Software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 2 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program; if not, write to the: +# +# Free Software Foundation, Inc. +# 59 Temple Place - Suite 330 +# Boston, MA 02111-1307 +# USA. + from random import seed, sample from string import letters, digits from osv import fields,osv @@ -11,6 +49,22 @@ def gen_salt( length=8, symbols=letters + digits ): seed() return ''.join( sample( symbols, length ) ) +# The encrypt_md5 is based on Mark Johnson's md5crypt.py, which in turn is +# based on FreeBSD src/lib/libcrypt/crypt.c (1.2) by Poul-Henning Kamp. +# Mark's port can be found in ActiveState ASPN Python Cookbook. Kudos to +# Poul and Mark. -agi +# +# Original license: +# +# * "THE BEER-WARE LICENSE" (Revision 42): +# * +# * wrote this file. As long as you retain this +# * notice you can do whatever you want with this stuff. If we meet some +# * day, and you think this stuff is worth it, you can buy me a beer in +# * return. +# * +# * Poul-Henning Kamp + import md5 def encrypt_md5( raw_pw, salt, magic=magic_md5 ): From 601f6d412b0e7f4c654b086632f0df9d0f4ca889 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 29 May 2008 11:14:58 +0000 Subject: [PATCH 003/294] Changed author bzr revid: fp@tinyerp.com-20080529111458-x1rf2m3z134qs710 --- addons/base_crypt/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py index b6780541289..8c93f4e9e01 100644 --- a/addons/base_crypt/__terp__.py +++ b/addons/base_crypt/__terp__.py @@ -1,7 +1,7 @@ { "name" : "Base", "version" : "1.0", - "author" : "Tiny", + "author" : "FS3 , Review Tiny", "website" : "http://tinyerp.com", "category" : "Generic Modules/Base", "description": "Module for password encryption.", From f522b775740cca110ae434e7b687d83501e6465c Mon Sep 17 00:00:00 2001 From: Husen Daudi Date: Wed, 11 Jun 2008 07:03:22 +0000 Subject: [PATCH 004/294] Improve code to check cache (reference: HMO) bzr revid: hda@tinyerp.com-20080611070322-smrboaciwsho7env --- addons/base_crypt/crypt.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index 7d2ab0e8cf7..c3d7a71e5ef 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -176,6 +176,14 @@ def check(db, uid, passwd): if security._uid_cache.has_key( uid ) and (security._uid_cache[uid]==passwd): return True cr = pooler.get_db(db).cursor() + if passwd not in _salt_cache: + cr.execute( 'select login from res_users where id=%d', (uid,) ) + stored_login = cr.fetchone() + if stored_login: + stored_login = stored_login[0] + + if not login(db,stored_login,passwd): + return False salt = _salt_cache[passwd] cr.execute(' select count(*) from res_users where id=%d and password=%s', (int(uid), encrypt_md5( passwd, salt )) ) res = cr.fetchone()[0] From eebf1d9860aefdd6933f0a3dbf19d764d5b1d9aa Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Mon, 22 Sep 2008 10:10:56 +0200 Subject: [PATCH 005/294] merge bzr revid: vmt@openerp.com-20080922081056-td14d6etaevzjbzm --- addons/base_crypt/base_update.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_crypt/base_update.xml b/addons/base_crypt/base_update.xml index 06de41b4850..8a0a5443eb8 100644 --- a/addons/base_crypt/base_update.xml +++ b/addons/base_crypt/base_update.xml @@ -1,5 +1,5 @@ - + @@ -26,4 +26,4 @@ - + From 055921341c897b1e909a05ccc7e5e10c19fdf01f Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Tue, 4 Nov 2008 17:22:16 +0100 Subject: [PATCH 006/294] merge bzr revid: vmt@openerp.com-20081104162216-vrbjrkewfuejwj3r --- addons/base_crypt/__init__.py | 33 +++++++++++++-------------------- addons/base_crypt/__terp__.py | 21 +++++++++++++++++++++ 2 files changed, 34 insertions(+), 20 deletions(-) diff --git a/addons/base_crypt/__init__.py b/addons/base_crypt/__init__.py index 88854384b0e..db124dc453f 100644 --- a/addons/base_crypt/__init__.py +++ b/addons/base_crypt/__init__.py @@ -1,28 +1,21 @@ ############################################################################## # -# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved. -# Fabien Pinckaers +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ # -# WARNING: This program as such is intended to be used by professional -# programmers who take the whole responsability of assessing all potential -# consequences resulting from its eventual inadequacies and bugs -# End users who are looking for a ready-to-use solution with commercial -# garantees and support are strongly adviced to contract a Free Software -# Service Company +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# This program is Free Software; you can redistribute it and/or -# modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation; either version 2 -# of the License, or (at your option) any later version. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . # ############################################################################## diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py index 8c93f4e9e01..8779f7381ee 100644 --- a/addons/base_crypt/__terp__.py +++ b/addons/base_crypt/__terp__.py @@ -1,3 +1,24 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved +# $Id$ +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . +# +############################################################################## { "name" : "Base", "version" : "1.0", From 062c792152b62c4f7190bea58f221df500d49615 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 19 Feb 2009 19:51:09 +0100 Subject: [PATCH 007/294] merge bzr revid: vmt@openerp.com-20090219185109-qlyshbp6av7njujp --- addons/base_crypt/__terp__.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py index 8779f7381ee..6a3164f9aec 100644 --- a/addons/base_crypt/__terp__.py +++ b/addons/base_crypt/__terp__.py @@ -20,18 +20,18 @@ # ############################################################################## { - "name" : "Base", - "version" : "1.0", - "author" : "FS3 , Review Tiny", - "website" : "http://tinyerp.com", - "category" : "Generic Modules/Base", - "description": "Module for password encryption.", - "depends" : ["base"], - "init_xml" : [], - "demo_xml" : [], - "update_xml" : [ - "base_update.xml", - ], - "active": False, - "installable": True, + "name" : "Base", + "version" : "1.0", + "author" : "FS3 , Review Tiny", + "website" : "http://www.openerp.com", + "category" : "Generic Modules/Base", + "description": "Module for password encryption.", + "depends" : ["base"], + "init_xml" : [], + "demo_xml" : [], + "update_xml" : [ + "base_update.xml", + ], + "active": False, + "installable": True, } From ccfe97090b321a39f82a2d6b76f9ad10152d68f4 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Thu, 15 Oct 2009 19:27:18 +0530 Subject: [PATCH 008/294] [MERGE]:merging from the same branch bzr revid: vmt@openerp.com-20091015135718-cr715tqqm9ub6amz --- addons/base_crypt/__init__.py | 19 +++++++++---------- addons/base_crypt/__terp__.py | 19 +++++++++---------- 2 files changed, 18 insertions(+), 20 deletions(-) diff --git a/addons/base_crypt/__init__.py b/addons/base_crypt/__init__.py index db124dc453f..a8b9a6b0740 100644 --- a/addons/base_crypt/__init__.py +++ b/addons/base_crypt/__init__.py @@ -1,21 +1,20 @@ ############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved -# $Id$ +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py index 6a3164f9aec..c8454fff0cc 100644 --- a/addons/base_crypt/__terp__.py +++ b/addons/base_crypt/__terp__.py @@ -1,22 +1,21 @@ # -*- encoding: utf-8 -*- ############################################################################## -# -# OpenERP, Open Source Management Solution -# Copyright (C) 2004-2008 Tiny SPRL (). All Rights Reserved -# $Id$ +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2009 Tiny SPRL (). # # This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# GNU Affero General Public License for more details. # -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . # ############################################################################## { From 7e098c3fa9b88b8a22e945dc5b810a2758322fc4 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 25 Nov 2009 15:20:36 +0530 Subject: [PATCH 009/294] [MERGE]: merging from the same branch bzr revid: vmt@openerp.com-20091125095036-klz8sos8eey5urnp --- addons/base_crypt/__terp__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py index c8454fff0cc..400a277ca81 100644 --- a/addons/base_crypt/__terp__.py +++ b/addons/base_crypt/__terp__.py @@ -19,7 +19,7 @@ # ############################################################################## { - "name" : "Base", + "name" : "Base - Password Encryption", "version" : "1.0", "author" : "FS3 , Review Tiny", "website" : "http://www.openerp.com", From 0232413678ff45f8b3beee4e026204898920fae2 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Wed, 25 Nov 2009 19:44:35 +0530 Subject: [PATCH 010/294] [MERGE]: merging from same branch bzr revid: vmt@openerp.com-20091125141435-vsxil5iy8pa69jgj --- addons/base_crypt/crypt.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index c3d7a71e5ef..2d29704aeb0 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -41,6 +41,7 @@ from string import letters, digits from osv import fields,osv import pooler import tools +from tools.translate import _ from service import security magic_md5 = '$1$' @@ -218,6 +219,8 @@ class users(osv.osv): # Add handlers for 'input_pw' field. def set_pw( self, cr, uid, id, name, value, args, context ): + if not value: + raise osv.except_osv(_('Error'), _("Please specify the password !")) self.write( cr, uid, id, { 'password' : encrypt_md5( value, gen_salt() ) } ) del value From 0a3c2bf26d4f899aa1f18519e9f426f3f91d173c Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Tue, 1 Dec 2009 15:49:51 +0530 Subject: [PATCH 011/294] [MERGE]: merging from same branch bzr revid: vmt@openerp.com-20091201101951-0gqnmboirjoelwly --- addons/base_crypt/i18n/fr_BE.po | 37 +++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 addons/base_crypt/i18n/fr_BE.po diff --git a/addons/base_crypt/i18n/fr_BE.po b/addons/base_crypt/i18n/fr_BE.po new file mode 100644 index 00000000000..d62691cb699 --- /dev/null +++ b/addons/base_crypt/i18n/fr_BE.po @@ -0,0 +1,37 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_crypt +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-26 09:12:09+0000\n" +"PO-Revision-Date: 2009-11-26 09:12:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_crypt +#: model:ir.module.module,description:base_crypt.module_meta_information +msgid "Module for password encryption." +msgstr "" + +#. module: base_crypt +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_crypt +#: model:ir.module.module,shortdesc:base_crypt.module_meta_information +msgid "Base" +msgstr "" + +#. module: base_crypt +#: field:res.users,input_pw:0 +msgid "Password" +msgstr "" + From da1395bb41bdeeedee3cb26f06693d3beeb5fbc0 Mon Sep 17 00:00:00 2001 From: Mantavya Gajjar Date: Sun, 3 Jan 2010 00:41:50 +0530 Subject: [PATCH 012/294] [MERGE]: merging from same branch bzr revid: vmt@openerp.com-20100102191150-mnajl1zi8lxt776h --- addons/base_crypt/i18n/base_crypt.pot | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 addons/base_crypt/i18n/base_crypt.pot diff --git a/addons/base_crypt/i18n/base_crypt.pot b/addons/base_crypt/i18n/base_crypt.pot new file mode 100644 index 00000000000..d62691cb699 --- /dev/null +++ b/addons/base_crypt/i18n/base_crypt.pot @@ -0,0 +1,37 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * base_crypt +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.6\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2009-11-26 09:12:09+0000\n" +"PO-Revision-Date: 2009-11-26 09:12:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: base_crypt +#: model:ir.module.module,description:base_crypt.module_meta_information +msgid "Module for password encryption." +msgstr "" + +#. module: base_crypt +#: constraint:ir.ui.view:0 +msgid "Invalid XML for View Architecture!" +msgstr "" + +#. module: base_crypt +#: model:ir.module.module,shortdesc:base_crypt.module_meta_information +msgid "Base" +msgstr "" + +#. module: base_crypt +#: field:res.users,input_pw:0 +msgid "Password" +msgstr "" + From 6f5ead9b97fc2f82a43f6bf0ad3e75d4865c24ad Mon Sep 17 00:00:00 2001 From: "sma (Tiny)" Date: Wed, 3 Mar 2010 17:52:02 +0530 Subject: [PATCH 013/294] [FIX] base_crypt: make password field hidden by setting password=True. lp bug: https://launchpad.net/bugs/530743 fixed bzr revid: sma@tinyerp.com-20100303122202-v512lrl8mep2uf0b --- addons/base_crypt/base_update.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_crypt/base_update.xml b/addons/base_crypt/base_update.xml index 8a0a5443eb8..66e4eaeb8c7 100644 --- a/addons/base_crypt/base_update.xml +++ b/addons/base_crypt/base_update.xml @@ -10,7 +10,7 @@ - + @@ -21,7 +21,7 @@ - + From d66295f7b3d6b734040e0550db16224762df6fdc Mon Sep 17 00:00:00 2001 From: Christophe Chauvet Date: Wed, 24 Mar 2010 02:17:46 +0100 Subject: [PATCH 014/294] [IMP] Don't hide main company field with a group on customize form bzr revid: christophe.chauvet@syleam.fr-20100324011746-gdjx7hm6jf293fwc --- bin/addons/base/res/res_company_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/res/res_company_view.xml b/bin/addons/base/res/res_company_view.xml index 34e58b75b6c..40855eae86b 100644 --- a/bin/addons/base/res/res_company_view.xml +++ b/bin/addons/base/res/res_company_view.xml @@ -9,7 +9,7 @@ - + @@ -29,7 +29,7 @@ - + From 756ab060bb31d471da52ece6bbc6d21fd108d2ed Mon Sep 17 00:00:00 2001 From: "ksa (Open ERP)" Date: Tue, 6 Jul 2010 10:40:58 +0530 Subject: [PATCH 015/294] [IMP]:Remove print statement bzr revid: vmt@openerp.com-20100706051058-q29kpyy7s80i0e9h --- addons/base_crypt/__init__.py | 0 addons/base_crypt/__terp__.py | 0 addons/base_crypt/base_update.xml | 0 addons/base_crypt/crypt.py | 0 addons/base_crypt/i18n/base_crypt.pot | 0 addons/base_crypt/i18n/fr_BE.po | 0 6 files changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 addons/base_crypt/__init__.py mode change 100644 => 100755 addons/base_crypt/__terp__.py mode change 100644 => 100755 addons/base_crypt/base_update.xml mode change 100644 => 100755 addons/base_crypt/crypt.py mode change 100644 => 100755 addons/base_crypt/i18n/base_crypt.pot mode change 100644 => 100755 addons/base_crypt/i18n/fr_BE.po diff --git a/addons/base_crypt/__init__.py b/addons/base_crypt/__init__.py old mode 100644 new mode 100755 diff --git a/addons/base_crypt/__terp__.py b/addons/base_crypt/__terp__.py old mode 100644 new mode 100755 diff --git a/addons/base_crypt/base_update.xml b/addons/base_crypt/base_update.xml old mode 100644 new mode 100755 diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py old mode 100644 new mode 100755 diff --git a/addons/base_crypt/i18n/base_crypt.pot b/addons/base_crypt/i18n/base_crypt.pot old mode 100644 new mode 100755 diff --git a/addons/base_crypt/i18n/fr_BE.po b/addons/base_crypt/i18n/fr_BE.po old mode 100644 new mode 100755 From 4a587039027d163aed2aa93a404a5ceb86c95861 Mon Sep 17 00:00:00 2001 From: "g.shipilov" Date: Thu, 5 Aug 2010 08:32:28 +0600 Subject: [PATCH 016/294] Page rotation bzr revid: g.shipilov@it1-20100805023228-pbd2b3tkudu7uj1j --- bin/report/render/rml2pdf/trml2pdf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py index 771a59fa28f..1e628370a44 100644 --- a/bin/report/render/rml2pdf/trml2pdf.py +++ b/bin/report/render/rml2pdf/trml2pdf.py @@ -773,7 +773,7 @@ class _rml_template(object): ps = map(lambda x:x.strip(), node.get('pageSize').replace(')', '').replace('(', '').split(',')) pageSize = ( utils.unit_get(ps[0]),utils.unit_get(ps[1]) ) - self.doc_tmpl = TinyDocTemplate(out, pagesize=pageSize, **utils.attr_get(node, ['leftMargin','rightMargin','topMargin','bottomMargin'], {'allowSplitting':'int','showBoundary':'bool','title':'str','author':'str'})) + self.doc_tmpl = TinyDocTemplate(out, pagesize=pageSize, **utils.attr_get(node, ['leftMargin','rightMargin','topMargin','bottomMargin'], {'allowSplitting':'int','showBoundary':'bool','rotation':'int','title':'str','author':'str'})) self.page_templates = [] self.styles = doc.styles self.doc = doc From 018709b2728d41557ec5dd364a0c5acfefcd8600 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 11:51:31 +0200 Subject: [PATCH 020/294] [IMP] report_intrastat: 'invoice' report now uses decimal.precision (changed the sxw too and now pass 'dp' instead of calling get_digits) [related rev:4177] bzr revid: olt@tinyerp.com-20101005095131-lzsy0vodqsd7y3a4 --- addons/report_intrastat/report/invoice.rml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/report_intrastat/report/invoice.rml b/addons/report_intrastat/report/invoice.rml index 08a1ab14fe0..e931a6d735d 100644 --- a/addons/report_intrastat/report/invoice.rml +++ b/addons/report_intrastat/report/invoice.rml @@ -357,7 +357,7 @@ [[ l.discount and formatLang (l.discount) or '' ]] - [[ formatLang(l.price_subtotal) ]] + [[ formatLang(l.price_subtotal, dp='Account') ]] [[ o.currency_id.code ]] @@ -488,7 +488,7 @@ - [[ o.amount_tax and formatLang(o.amount_tax, digits=get_digits(dp='Account')) or removeParentNode('blockTable') ]] + [[ o.amount_tax and formatLang(o.amount_tax, dp='Account') or removeParentNode('blockTable') ]] @@ -516,10 +516,10 @@ [[ t.name ]] - [[ formatLang(t.base, digits=get_digits(dp='Account')) ]] + [[ formatLang(t.base, dp='Account') ]] - [[ formatLang(t.amount, digits=get_digits(dp='Account')) ]] + [[ formatLang(t.amount, dp='Account') ]] From d85b91ce11ec5df3fb15730c6bd5a06947916231 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 11:54:29 +0200 Subject: [PATCH 021/294] [IMP] account: 'invoice' report now uses decimal.precision (changed the sxw too and now pass 'dp' instead of calling get_digits) [related rev:4176] bzr revid: olt@tinyerp.com-20101005095429-csuj62lfymna1x4a --- addons/account/report/invoice.rml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/report/invoice.rml b/addons/account/report/invoice.rml index 173cbd1e6c4..5bfab4b7fa7 100644 --- a/addons/account/report/invoice.rml +++ b/addons/account/report/invoice.rml @@ -232,10 +232,10 @@ [[ formatLang(l.price_unit) ]][[ o.currency_id.symbol ]] - [[ formatLang(l.discount, digits=get_digits(dp='Account')) ]] + [[ formatLang(l.discount, dp='Account') ]] - [[ formatLang(l.price_subtotal, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(l.price_subtotal, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -294,7 +294,7 @@ Taxes: - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_tax, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -338,7 +338,7 @@ [[ t.name ]] - [[ formatLang(t.base, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(t.base, dp='Account') ]] [[ o.currency_id.symbol ]] [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount) ]] [[ o.currency_id.symbol ]] From c678ed27758529f0804ecabb2cec8b1b74d6cb8b Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 12:04:09 +0200 Subject: [PATCH 022/294] [IMP] purchase: 'purchase order' report now uses decimal.precision (changed the sxw too and now pass 'dp' instead of calling get_digits) [related rev:4169] bzr revid: olt@tinyerp.com-20101005100409-22208s68eqqtrt0y --- addons/purchase/report/order.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/report/order.rml b/addons/purchase/report/order.rml index 5fbc2cbdcc2..ffde9f2cd9f 100644 --- a/addons/purchase/report/order.rml +++ b/addons/purchase/report/order.rml @@ -333,7 +333,7 @@ Taxes : - [[ formatLang(o.amount_tax, digits=get_digits(dp='Purchase Price')) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_tax, dp='Purchase Price') ]] [[ o.pricelist_id.currency_id. symbol ]] From 02a49e3fbc166283c009f14f234b2b0b16701274 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 12:14:31 +0200 Subject: [PATCH 023/294] [IMP] sale: 'sale order' reports now uses decimal.precision (changed the sxw too and now pass 'dp' instead of calling get_digits) [related rev:4159] bzr revid: olt@tinyerp.com-20101005101431-ibpakl3991rrjmvd --- addons/sale/report/sale_order.rml | 6 +++--- addons/sale_layout/report/report_sale_layout.rml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml index a4eab5aa86d..0b3d811cf7c 100644 --- a/addons/sale/report/sale_order.rml +++ b/addons/sale/report/sale_order.rml @@ -312,7 +312,7 @@ Net Total : - [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_untaxed, dp='Sale Price') ]] [[ o.pricelist_id.currency_id. symbol ]] @@ -325,7 +325,7 @@ Taxes : - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_tax, dp='Sale Price') ]] [[ o.pricelist_id.currency_id. symbol ]] @@ -338,7 +338,7 @@ Total : - [[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_total, dp='Sale Price') ]] [[ o.pricelist_id.currency_id. symbol ]] diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml index b01affd5329..cdab0c4d7ff 100755 --- a/addons/sale_layout/report/report_sale_layout.rml +++ b/addons/sale_layout/report/report_sale_layout.rml @@ -318,13 +318,13 @@ [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ a['product_uom'] ]] - [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['price_unit'], digits=get_digits(dp='Sale Price')) ]] + [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]] [[ formatLang(a['price_unit'], dp='Sale Price') ]] - [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['discount'], digits=get_digits(dp='Sale Price')) ]] + [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['discount'], dp='Sale Price') ]] - [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['price_subtotal'], digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id.symbol ]] + [[ a['layout_type']=='subtotal' and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['price_subtotal'], dp='Sale Price') ]] [[ o.pricelist_id.currency_id.symbol ]] From 0f5f67d62815744af29649ab35531692dbbcbf67 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 12:16:41 +0200 Subject: [PATCH 024/294] [IMP] account_budget: 'crossovered_budget' report now uses decimal.precision (now pass 'dp' instead of calling get_digits) [related rev:4156] bzr revid: olt@tinyerp.com-20101005101641-bl50epg75822ic10 --- .../report/crossovered_budget_report.rml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml index e297c8b3ca2..a62e9f1d611 100644 --- a/addons/account_budget/report/crossovered_budget_report.rml +++ b/addons/account_budget/report/crossovered_budget_report.rml @@ -148,13 +148,13 @@ [['.....' *(a['status']-1) ]][[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ a['name'] ]] - [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], dp='Account') ]] [[ company.currency_id.symbol ]] - [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], dp='Account') ]] [[ company.currency_id.symbol ]] - [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], dp='Account') ]] [[ company.currency_id.symbol ]] [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['perc'], digits=2) ]]% @@ -168,13 +168,13 @@ [[ repeatIn(funct_total(data['form']),'b') ]]Total: - [[ formatLang(b['tot_theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ formatLang(b['tot_theo'], dp='Account') ]] [[ company.currency_id.symbol ]] - [[ formatLang(b['tot_pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ formatLang(b['tot_pln'], dp='Account') ]] [[ company.currency_id.symbol ]] - [[ formatLang(b['tot_prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ formatLang(b['tot_prac'], dp='Account') ]] [[ company.currency_id.symbol ]] [[ formatLang(b['tot_perc'], digits=2) ]]% From 83f3a3e27503214a05f5d56b681f836935dc6252 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 12:43:46 +0200 Subject: [PATCH 025/294] [IMP] rml reports: replaced call to get_digits by directly passing the 'dp' parameter bzr revid: olt@tinyerp.com-20101005104346-mdxiu47w4m46o2zm --- .../account_general_ledger_landscape.rml | 20 +++++++++---------- .../report/report_account_invoice_layout.rml | 10 +++++----- .../report/special_message_invoice.rml | 10 +++++----- addons/mrp_repair/report/order.rml | 6 +++--- .../report/account_statement.rml | 8 ++++---- .../sale_layout/report/report_sale_layout.rml | 2 +- addons/stock/report/lot_overview.rml | 8 ++++---- addons/stock/report/lot_overview_all.rml | 8 ++++---- 8 files changed, 36 insertions(+), 36 deletions(-) diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index 1321bdea750..b370b03a4ec 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -266,10 +266,10 @@ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] - [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] - [[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]] - [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] - [[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account')) + o.currency_id.code or '' ]] + [[ formatLang(sum_debit_account(o), dp='Account') ]] + [[ formatLang(sum_credit_account(o), dp='Account') ]] + [[ formatLang(sum_balance_account(o), dp='Account') ]] [[ company.currency_id.symbol ]] + [[ o.currency_id and formatLang(sum_currency_amount_account(o), dp='Account') + o.currency_id.code or '' ]] @@ -292,9 +292,9 @@ [[ line['move'] ]] [[ line['lname'] ]] [[ strip_name(line['line_corresp'].replace(', ',','),40) ]] - [[ formatLang(line['debit'], digits=get_digits(dp='Account')) ]] - [[ formatLang(line['credit'], digits=get_digits(dp='Account')) ]] - [[ formatLang(line['progress'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line['debit'], dp='Account') ]] + [[ formatLang(line['credit'], dp='Account') ]] + [[ formatLang(line['progress'], dp='Account') ]] [[ company.currency_id.symbol ]] [[ formatLang(line['amount_currency'] or '')]] [[ line['currency_code'] or '' ]] @@ -327,9 +327,9 @@ [[ '..'*(o.level-1) ]][[ o.code ]] [[ o.name ]] - [[ formatLang(sum_debit_account(o), digits=get_digits(dp='Account')) ]] - [[ formatLang(sum_credit_account(o), digits=get_digits(dp=Account)) ]] - [[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]] + [[ formatLang(sum_debit_account(o), dp='Account') ]] + [[ formatLang(sum_credit_account(o), dp='Account') ]] + [[ formatLang(sum_balance_account(o), 'Account') ]] [[ company.currency_id.symbol ]] diff --git a/addons/account_invoice_layout/report/report_account_invoice_layout.rml b/addons/account_invoice_layout/report/report_account_invoice_layout.rml index 3cd64a08b02..3373f6416a0 100644 --- a/addons/account_invoice_layout/report/report_account_invoice_layout.rml +++ b/addons/account_invoice_layout/report/report_account_invoice_layout.rml @@ -376,7 +376,7 @@ Net Total: - [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_untaxed, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -391,7 +391,7 @@ Taxes: - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_tax, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -406,7 +406,7 @@ Total: - [[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_total, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -445,10 +445,10 @@ [[ t.name ]] - [[ formatLang(t.base, digits=get_digits(dp='Account')) ]] + [[ formatLang(t.base, dp='Account') ]] - [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account')) ]] + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, dp='Account') ]] diff --git a/addons/account_invoice_layout/report/special_message_invoice.rml b/addons/account_invoice_layout/report/special_message_invoice.rml index 8bea44a67f7..40d9fa685a4 100644 --- a/addons/account_invoice_layout/report/special_message_invoice.rml +++ b/addons/account_invoice_layout/report/special_message_invoice.rml @@ -380,7 +380,7 @@ Net Total: - [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_untaxed, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -395,7 +395,7 @@ Taxes: - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_tax, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -410,7 +410,7 @@ Total: - [[ formatLang(o.amount_total, digits=get_digits(dp='Account')) ]] [[ o.currency_id.symbol ]] + [[ formatLang(o.amount_total, dp='Account') ]] [[ o.currency_id.symbol ]] @@ -449,10 +449,10 @@ [[ t.name ]] - [[ formatLang(t.base, digits=get_digits(dp='Account')) ]] + [[ formatLang(t.base, dp='Account') ]] - [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, digits=get_digits(dp='Account')) ]] + [[ (t.tax_code_id and t.tax_code_id.notprintable) and removeParentNode('blockTable') or '' ]] [[ formatLang(t.amount, dp='Account') ]] diff --git a/addons/mrp_repair/report/order.rml b/addons/mrp_repair/report/order.rml index 328b5e931ee..edb3d43c7b3 100644 --- a/addons/mrp_repair/report/order.rml +++ b/addons/mrp_repair/report/order.rml @@ -343,7 +343,7 @@ Net Total : - [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Sale Price'))]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_untaxed, dp='Sale Price')]] [[ o.pricelist_id.currency_id. symbol ]] @@ -357,7 +357,7 @@ Taxes: - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account'))]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(o.amount_tax, dp='Account')]] [[ o.pricelist_id.currency_id. symbol ]] @@ -370,7 +370,7 @@ Total : - [[ formatLang(total(o), digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id. symbol ]] + [[ formatLang(total(o), dp='Sale Price') ]] [[ o.pricelist_id.currency_id. symbol ]] diff --git a/addons/point_of_sale/report/account_statement.rml b/addons/point_of_sale/report/account_statement.rml index ed26143aa4e..024dd65f186 100644 --- a/addons/point_of_sale/report/account_statement.rml +++ b/addons/point_of_sale/report/account_statement.rml @@ -216,10 +216,10 @@ [[ formatLang(statement.closing_date,date=True) ]] - [[ formatLang(statement.balance_start, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]] + [[ formatLang(statement.balance_start, dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(statement.balance_end_real, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]] + [[ formatLang(statement.balance_end_real, dp='Account') ]][[ company.currency_id.symbol ]] @@ -254,7 +254,7 @@ [[ line_ids.partner_id.name ]] - [[ formatLang(line_ids.amount, digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]] + [[ formatLang(line_ids.amount, dp='Account') ]][[ company.currency_id.symbol ]] @@ -269,7 +269,7 @@ Total : - [[ formatLang(get_total(statement.line_ids), digits=get_digits(dp='Account')) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_total(statement.line_ids), dp='Account') ]][[ company.currency_id.symbol ]] diff --git a/addons/sale_layout/report/report_sale_layout.rml b/addons/sale_layout/report/report_sale_layout.rml index cdab0c4d7ff..0a499b01e3a 100755 --- a/addons/sale_layout/report/report_sale_layout.rml +++ b/addons/sale_layout/report/report_sale_layout.rml @@ -397,7 +397,7 @@ Taxes : - [[ formatLang(o.amount_tax, digits=get_digits(dp='Account') ) ]] [[ o.pricelist_id.currency_id.symbol ]] + [[ formatLang(o.amount_tax, dp='Account') ]] [[ o.pricelist_id.currency_id.symbol ]] diff --git a/addons/stock/report/lot_overview.rml b/addons/stock/report/lot_overview.rml index cebacedeb01..79749d270e4 100644 --- a/addons/stock/report/lot_overview.rml +++ b/addons/stock/report/lot_overview.rml @@ -167,10 +167,10 @@ [[formatLang( p['prod_qty']) ]] [[ p['uom'] ]] - [[ formatLang(p['price'], digits=get_digits(dp='Account')) ]] + [[ formatLang(p['price'], dp='Account') ]] - [[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]] + [[ formatLang(p['price_value'], dp='Account') ]] [[ o.company_id.currency_id.symbol]] @@ -184,7 +184,7 @@ Total: - [[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(price_total(), dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -201,7 +201,7 @@ - [[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(grand_total_price(), dp='Account') ]] [[ o.company_id.currency_id.symbol ]] diff --git a/addons/stock/report/lot_overview_all.rml b/addons/stock/report/lot_overview_all.rml index 4c4c71561a2..d4e60823e0d 100644 --- a/addons/stock/report/lot_overview_all.rml +++ b/addons/stock/report/lot_overview_all.rml @@ -167,10 +167,10 @@ [[formatLang( p['prod_qty']) ]] [[ p['uom'] ]] - [[ formatLang(p['price'], digits=get_digits(dp='Account')) ]] + [[ formatLang(p['price'], dp='Account') ]] - [[ formatLang(p['price_value'], digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol]] + [[ formatLang(p['price_value'], dp='Account') ]] [[ o.company_id.currency_id.symbol]] @@ -184,7 +184,7 @@ Total: - [[ formatLang(price_total(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(price_total(), dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -201,7 +201,7 @@ - [[ formatLang(grand_total_price(), digits=get_digits(dp='Account')) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(grand_total_price(), dp='Account') ]] [[ o.company_id.currency_id.symbol ]] From b2b6c4b3eaeb4241dde4e171eb4cc0d6754f72e4 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 09:10:57 +0200 Subject: [PATCH 026/294] [FIX] base_iban: no 'bank' field in res.partner.bank.type bzr revid: olt@tinyerp.com-20101005071057-1pzk0dhv60h3iy2n --- addons/base_iban/base_iban_data.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/base_iban/base_iban_data.xml b/addons/base_iban/base_iban_data.xml index 4269bb83ac6..dae3999505e 100644 --- a/addons/base_iban/base_iban_data.xml +++ b/addons/base_iban/base_iban_data.xml @@ -3,12 +3,11 @@ + Default bank account description + --> IBAN Account iban - iban From f233bd317ab0489302f75a5d38da270bb7740d6c Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:19:29 +0200 Subject: [PATCH 036/294] [IMP] hr_payroll: 'payslip' report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005111929-ij6mgz6a3fkechm6 --- addons/hr_payroll/hr_payroll.py | 7 +++--- addons/hr_payroll/report/payslip.rml | 26 +++++++++++----------- addons/hr_payroll/report/report_payslip.py | 13 ----------- 3 files changed, 17 insertions(+), 29 deletions(-) diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index d7de7efbcbc..7ce1faace82 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -27,6 +27,7 @@ import netsvc from osv import fields, osv from tools import config from tools.translate import _ +import decimal_precision as dp @@ -774,9 +775,9 @@ class hr_payslip(osv.osv): ('done','Paid Salary'), ('cancel','Reject'), ],'State', select=True, readonly=True), - 'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits=(16, 2)), - 'leaves': fields.float('Leave Deductions', readonly=True, digits=(16, 2)), - 'basic': fields.float('Net Basic', readonly=True, digits=(16, 2)), + 'basic_before_leaves': fields.float('Basic Salary', readonly=True, digits_compute=dp.get_precision('Account')), + 'leaves': fields.float('Leave Deductions', readonly=True, digits_compute=dp.get_precision('Account')), + 'basic': fields.float('Net Basic', readonly=True, digits_compute=dp.get_precision('Account')), 'grows': fields.function(_calculate, method=True, store=True, multi='dc', string='Gross Salary', type='float', digits=(16, 2)), 'net': fields.function(_calculate, method=True, store=True, multi='dc', string='Net Salary', digits=(16, 2)), 'allounce': fields.function(_calculate, method=True, store=True, multi='dc', string='Allowance', digits=(16, 2)), diff --git a/addons/hr_payroll/report/payslip.rml b/addons/hr_payroll/report/payslip.rml index 58b2fd81275..075023638f3 100755 --- a/addons/hr_payroll/report/payslip.rml +++ b/addons/hr_payroll/report/payslip.rml @@ -392,19 +392,19 @@ Basic Salary - [[ formatLang(o.basic_before_leaves) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.basic_before_leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] Leaved Deduction - [[ o.leaves or '' ]] + [[ formatLang(o.leaves, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] Basic Salary – Leaves - [[ formatLang(o.basic) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -433,7 +433,7 @@ [[ ld.code ]] - [[ formatLang(ld.total) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(ld.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -463,7 +463,7 @@ Basic Salary - [[ formatLang(o.basic) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -471,7 +471,7 @@ [[repeatIn(get_earnings(o.line_ids),'a') ]] [[ a.code or removeParentNode('tr') ]] - [[ formatLang(a.total) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(a.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -488,7 +488,7 @@ [[ b.code ]] - [[ formatLang(b.total) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(b.total, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -508,13 +508,13 @@ Total Earnings([[ o.company_id.currency_id.code ]]) - [[ formatLang(o.allounce + o.basic) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.allounce + o.basic, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] Total Deductions([[ o.company_id.currency_id.code ]]) - [[ formatLang(o.deduction) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.deduction, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -542,10 +542,10 @@ [[ ol.type in ['advance','loan','otherpay','otherdeduct','installment'] and ol.code or '' ]] - [[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]] + [[ ol.type in ['advance','loan','otherpay'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]] - [[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total) or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]] + [[ ol.type in ['otherdeduct','installment'] and formatLang(ol.total, dp='Account') or '' ]] [[ ol.type in ['advance','loan','otherpay'] and o.company_id.currency_id.symbol or '' ]] @@ -561,7 +561,7 @@ Net Amount([[ o.company_id.currency_id.code ]]) - [[ formatLang(o.net) ]] [[ o.company_id.currency_id.symbol ]] + [[ formatLang(o.net, dp='Account') ]] [[ o.company_id.currency_id.symbol ]] @@ -609,4 +609,4 @@ - \ No newline at end of file + diff --git a/addons/hr_payroll/report/report_payslip.py b/addons/hr_payroll/report/report_payslip.py index e818e0f3727..c0d3946d3ef 100755 --- a/addons/hr_payroll/report/report_payslip.py +++ b/addons/hr_payroll/report/report_payslip.py @@ -99,18 +99,5 @@ class payslip_report(report_sxw.rml_parse): report_sxw.report_sxw('report.payslip.pdf', 'hr.payslip', 'hr_payroll/report/payslip.rml', parser=payslip_report) - - - - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: - - - - - - - - From c4ef37b82a45fb12ff5076be8eda021411cd02cd Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:23:11 +0200 Subject: [PATCH 037/294] [IMP] hr_payroll: 'bank payment advice' report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005112311-3ofe7d0mgt04gnsj --- addons/hr_payroll/report/report_payroll_advice.rml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/hr_payroll/report/report_payroll_advice.rml b/addons/hr_payroll/report/report_payroll_advice.rml index ff793469284..5264b41f003 100644 --- a/addons/hr_payroll/report/report_payroll_advice.rml +++ b/addons/hr_payroll/report/report_payroll_advice.rml @@ -229,10 +229,10 @@ [[ line['name'] ]] - [[ formatLang(line['amount' ]) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line['amount'], dp='Account') ]] [[ company.currency_id.symbol ]] - [[ formatLang(line['bysal']) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line['bysal'], dp='Account') ]] [[ company.currency_id.symbol ]] [[ line['acc_no'] ]] @@ -260,10 +260,10 @@ Total([[ company.currency_id.code ]]): - [[ formatLang(get_total()) ]] [[ company.currency_id.symbol ]] + [[ formatLang(get_total(), dp='Account') ]] [[ company.currency_id.symbol ]] - [[ formatLang(get_bysal_total()) ]] [[ company.currency_id.symbol ]] + [[ formatLang(get_bysal_total(), dp='Account') ]] [[ company.currency_id.symbol ]] From 4e7dfb38434aa53a399895372ea49b393b782d86 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:26:15 +0200 Subject: [PATCH 038/294] [IMP] hr_payroll: 'salary payment register' report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005112615-kmorvnwp7cm9yavu --- addons/hr_payroll/report/payroll_register.rml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/addons/hr_payroll/report/payroll_register.rml b/addons/hr_payroll/report/payroll_register.rml index d7df0ada7cc..f5ec73cede4 100644 --- a/addons/hr_payroll/report/payroll_register.rml +++ b/addons/hr_payroll/report/payroll_register.rml @@ -179,22 +179,22 @@ [[ l.employee_id.name ]] - [[ formatLang(l.basic) ]] [[ company.currency_id.symbol]] + [[ formatLang(l.basic, dp='Account') ]] [[ company.currency_id.symbol]] - [[ formatLang(l.other_pay)]] [[ company.currency_id.symbol]] + [[ formatLang(l.other_pay, dp='Account')]] [[ company.currency_id.symbol]] - [[ formatLang(l.allounce)]] [[ company.currency_id.symbol]] + [[ formatLang(l.allounce, dp='Account')]] [[ company.currency_id.symbol]] - [[ formatLang(l.grows)]] [[ company.currency_id.symbol]] + [[ formatLang(l.grows, dp='Account')]] [[ company.currency_id.symbol]] - [[ formatLang(l.deduction)]] [[ company.currency_id.symbol]] + [[ formatLang(l.deduction, dp='Account')]] [[ company.currency_id.symbol]] - [[ formatLang(l.net)]] [[ company.currency_id.symbol]] + [[ formatLang(l.net, dp='Account')]] [[ company.currency_id.symbol]] @@ -213,22 +213,22 @@ Total SAL([[ company.currency_id.code]]) - [[formatLang(get_basic())]][[ company.currency_id.symbol]] + [[formatLang(get_basic(), dp='Account')]][[ company.currency_id.symbol]] - [[formatLang(get_other())]] [[ company.currency_id.symbol]] + [[formatLang(get_other(), dp='Account')]] [[ company.currency_id.symbol]] - [[formatLang(get_allow())]] [[ company.currency_id.symbol]] + [[formatLang(get_allow(), dp='Account')]] [[ company.currency_id.symbol]] - [[formatLang(get_grows())]] [[ company.currency_id.symbol]] + [[formatLang(get_grows(), dp='Account')]] [[ company.currency_id.symbol]] - [[formatLang(get_deduct())]] [[ company.currency_id.symbol]] + [[formatLang(get_deduct(), dp='Account')]] [[ company.currency_id.symbol]] - [[formatLang(get_net())]] [[ company.currency_id.symbol]] + [[formatLang(get_net(), dp='Account')]] [[ company.currency_id.symbol]] @@ -265,4 +265,4 @@ - \ No newline at end of file + From e4ecbb0a71e3101b8dd9633db312a98ec208b3b7 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:34:21 +0200 Subject: [PATCH 039/294] [IMP] hr: 'exepnse', 'recruitment' and 'timesheet' dynamic reports now uses decimal.precision bzr revid: olt@tinyerp.com-20101005113421-8svidbt2oflfkzsj --- addons/hr_expense/report/hr_expense_report.py | 5 +++-- addons/hr_recruitment/report/hr_recruitment_report.py | 9 +++++---- addons/hr_timesheet_sheet/report/hr_timesheet_report.py | 4 +++- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/addons/hr_expense/report/hr_expense_report.py b/addons/hr_expense/report/hr_expense_report.py index 1de708d2beb..304787b7563 100644 --- a/addons/hr_expense/report/hr_expense_report.py +++ b/addons/hr_expense/report/hr_expense_report.py @@ -21,6 +21,7 @@ import tools from osv import fields,osv +from decimal_precision import decimal_precision as dp class hr_expense_report(osv.osv): @@ -47,11 +48,11 @@ class hr_expense_report(osv.osv): 'company_id':fields.many2one('res.company', 'Company', readonly=True), 'user_id':fields.many2one('res.users', 'Validation User', readonly=True), 'currency_id': fields.many2one('res.currency', 'Currency', readonly=True), - 'price_total':fields.float('Total Price', readonly=True), + 'price_total':fields.float('Total Price', readonly=True, digits_compute=dp.get_precision('Account')), 'delay_valid':fields.float('Delay to Valid', readonly=True), 'delay_confirm':fields.float('Delay to Confirm', readonly=True), 'analytic_account': fields.many2one('account.analytic.account','Analytic account',readonly=True), - 'price_average':fields.float('Average Price', readonly=True), + 'price_average':fields.float('Average Price', readonly=True, digits_compute=dp.get_precision('Account')), 'nbr':fields.integer('# of Lines', readonly=True), 'no_of_products':fields.integer('# of Products', readonly=True), 'no_of_account':fields.integer('# of Accounts', readonly=True), diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py index 2a2ab8fce2b..67da3e35577 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report.py +++ b/addons/hr_recruitment/report/hr_recruitment_report.py @@ -21,6 +21,8 @@ import tools from osv import fields,osv from hr_recruitment import hr_recruitment +from decimal_precision import decimal_precision as dp + AVAILABLE_STATES = [ ('draft','New'), @@ -72,9 +74,9 @@ class hr_recruitment_report(osv.osv): 'type_id': fields.many2one('hr.recruitment.degree', 'Degree'), 'department_id':fields.many2one('hr.department','Department',readonly=True), 'priority': fields.selection(hr_recruitment.AVAILABLE_PRIORITIES, 'Appreciation'), - 'salary_prop' : fields.float("Salary Proposed"), - 'salary_prop_avg' : fields.float("Avg Salary Proposed", group_operator="avg"), - 'salary_exp' : fields.float("Salary Expected"), + 'salary_prop' : fields.float("Salary Proposed", digits_compute=dp.get_precision('Account')), + 'salary_prop_avg' : fields.float("Avg Salary Proposed", group_operator="avg", digits_compute=dp.get_precision('Account')), + 'salary_exp' : fields.float("Salary Expected", digits_compute=dp.get_precision('Account')), 'partner_id': fields.many2one('res.partner', 'Partner',readonly=True), 'partner_address_id': fields.many2one('res.partner.address', 'Partner Contact Name',readonly=True), 'available' : fields.float("Availability"), @@ -82,7 +84,6 @@ class hr_recruitment_report(osv.osv): help="Number of Days to close the project issue"), 'delay_close': fields.float('Avg. Delay to Close', digits=(16,2), readonly=True, group_operator="avg", help="Number of Days to close the project issue"), - } _order = 'date desc' def init(self, cr): diff --git a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py index 84ef868ab81..d20ad3a5f4c 100644 --- a/addons/hr_timesheet_sheet/report/hr_timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/hr_timesheet_report.py @@ -21,6 +21,8 @@ import tools from osv import fields,osv +from decimal_precision import decimal_precision as dp + class hr_timesheet_report(osv.osv): _name = "hr.timesheet.report" @@ -40,7 +42,7 @@ class hr_timesheet_report(osv.osv): 'user_id': fields.many2one('res.users', 'User',readonly=True), 'account_id': fields.many2one('account.analytic.account', 'Analytic Account',readonly=True), 'company_id': fields.many2one('res.company', 'Company',readonly=True), - 'cost': fields.float('Cost',readonly=True), + 'cost': fields.float('Cost',readonly=True, digits_compute=dp.get_precision('Account')), 'quantity': fields.float('Quantity',readonly=True), } From ae5b993dce95dcca373e91e88a4cefbbad2c2510 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:43:38 +0200 Subject: [PATCH 040/294] [FIX] report.timesheet.task.user: fixed an error in date string parsing bzr revid: olt@tinyerp.com-20101005114338-s541m8y3u1v81z9g --- addons/project_timesheet/report/task_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_timesheet/report/task_report.py b/addons/project_timesheet/report/task_report.py index 261f4e17c64..5ebaa1d1b69 100644 --- a/addons/project_timesheet/report/task_report.py +++ b/addons/project_timesheet/report/task_report.py @@ -32,7 +32,7 @@ class report_timesheet_task_user(osv.osv): def _get_task_hours(self, cr, uid, ids, name,args,context): result = {} for record in self.browse(cr, uid, ids,context): - last_date = datetime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 + last_date = datetime.strptime(record.name, '%Y-%m-%d') + relativedelta(months=1) - 1 task_obj=self.pool.get('project.task.work') task_ids = task_obj.search(cr, uid, [('user_id','=',record.user_id.id),('date','>=',record.name),('date','<=',last_date.strftime('%Y-%m-%d'))]) tsk_hrs = task_obj.read(cr, uid, task_ids, ['hours','date','user_id']) From 73b83e84c59870cd2812a69541951741b559e411 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:44:09 +0200 Subject: [PATCH 041/294] [IMP] hr_timesheet_sheet: timesheet report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005114409-kc22r86oduvc2qs6 --- addons/hr_timesheet_sheet/report/timesheet_report.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/hr_timesheet_sheet/report/timesheet_report.py b/addons/hr_timesheet_sheet/report/timesheet_report.py index a8c0440a053..2148f370560 100644 --- a/addons/hr_timesheet_sheet/report/timesheet_report.py +++ b/addons/hr_timesheet_sheet/report/timesheet_report.py @@ -21,6 +21,8 @@ import tools from osv import fields,osv +from decimal_precision import decimal_precision as dp + class timesheet_report(osv.osv): _name = "timesheet.report" @@ -53,7 +55,7 @@ class timesheet_report(osv.osv): ('confirm','Confirmed'), ('done','Done')], 'State', readonly=True), 'quantity': fields.float('#Quantity',readonly=True), - 'cost': fields.float('#Cost',readonly=True), + 'cost': fields.float('#Cost',readonly=True, digits_compute=dp.get_precision('Account')), } def init(self, cr): From e9bed69abe04daded640d59b738dd62490abc71a Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:53:38 +0200 Subject: [PATCH 042/294] [IMP] hr_payroll: employee salary detail report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005115338-kec4ru1drsyjaor3 --- .../report/report_employees_detail.rml | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/hr_payroll/report/report_employees_detail.rml b/addons/hr_payroll/report/report_employees_detail.rml index 1988d932ce2..fcb98ef2b6d 100644 --- a/addons/hr_payroll/report/report_employees_detail.rml +++ b/addons/hr_payroll/report/report_employees_detail.rml @@ -572,46 +572,46 @@ - [[ get_monthly_total()[0] ]] + [[ get_monthly_total()[0]+'xxx' ]] - [[ formatLang(get_monthly_total()[1]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[1], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[2]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[2], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[3]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[3], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[4]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[4], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[5]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[5], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[6]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[6], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[7]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[7], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[8]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[8], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[9]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[9], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[10]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[10], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[11]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[11], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_monthly_total()[12]) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_monthly_total()[12], dp='Account') ]][[ company.currency_id.symbol ]] - [[ formatLang(get_total()) ]][[ company.currency_id.symbol ]] + [[ formatLang(get_total(), dp='Account') ]][[ company.currency_id.symbol ]] From bd438c2c65bf40f3811693313b8a1bdcc25d800a Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 13:56:31 +0200 Subject: [PATCH 043/294] [IMP] hr_payroll: yearly salary detail report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005115631-ytlplyukezcqi717 --- .../report/report_employees_detail.rml | 2 +- .../hr_payroll/report/report_year_report.rml | 52 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/addons/hr_payroll/report/report_employees_detail.rml b/addons/hr_payroll/report/report_employees_detail.rml index fcb98ef2b6d..c1b91ce5910 100644 --- a/addons/hr_payroll/report/report_employees_detail.rml +++ b/addons/hr_payroll/report/report_employees_detail.rml @@ -572,7 +572,7 @@ - [[ get_monthly_total()[0]+'xxx' ]] + [[ get_monthly_total()[0] ]] [[ formatLang(get_monthly_total()[1], dp='Account') ]][[ company.currency_id.symbol ]] diff --git a/addons/hr_payroll/report/report_year_report.rml b/addons/hr_payroll/report/report_year_report.rml index 4c32436955a..77762c6cfcc 100755 --- a/addons/hr_payroll/report/report_year_report.rml +++ b/addons/hr_payroll/report/report_year_report.rml @@ -191,43 +191,43 @@ [[ e[0] ]] - [[ formatLang(e[1]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[1], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[2]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[2], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[3]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[3], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[4]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[4], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[5]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[5], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[6]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[6], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[7]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[7], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[8]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[8], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[9]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[9], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[10]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[10], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[11]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[11], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[12]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[12], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(e[13]) ]] [[company.currency_id.symbol]] + [[ formatLang(e[13], dp='Account') ]] [[company.currency_id.symbol]] @@ -250,43 +250,43 @@ Total([[company.currency_id.code]]) - [[ formatLang(t[1]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[1], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[2]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[2], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[3]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[3], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[4]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[4], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[5]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[5], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[6]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[6], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[7]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[7], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[8]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[8], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[9]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[9], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[10]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[10], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[11]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[11], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(t[12]) ]] [[company.currency_id.symbol]] + [[ formatLang(t[12], dp='Account') ]] [[company.currency_id.symbol]] - [[ formatLang(get_total()) ]] [[company.currency_id.symbol]] + [[ formatLang(get_total(), dp='Account') ]] [[company.currency_id.symbol]] From b7232380928c341b49723f183fb73d5008005dbe Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 14:09:06 +0200 Subject: [PATCH 044/294] [IMP] point_of_sale: detail of sales report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005120906-3f167keib40njq54 --- addons/point_of_sale/report/pos_details.rml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/addons/point_of_sale/report/pos_details.rml b/addons/point_of_sale/report/pos_details.rml index f3bebade402..9bb241387b5 100644 --- a/addons/point_of_sale/report/pos_details.rml +++ b/addons/point_of_sale/report/pos_details.rml @@ -229,13 +229,13 @@ [[ line_ids['name'] ]] - [[ formatLang(line_ids['price_unit']) ]][[ company.currency_id.symbol ]] + [[ formatLang(line_ids['price_unit'], dp='Sale Price') ]][[ company.currency_id.symbol ]] [[ formatLang(line_ids['qty']) ]] - [[ formatLang(line_ids['discount']) ]][[ company.currency_id.symbol ]] + [[ formatLang(line_ids['discount'], dp='Sale Price') ]][[ company.currency_id.symbol ]] [[ getinvoice(line_ids['invoice_id'],user) or removeParentNode('font') ]] @@ -281,7 +281,7 @@ [[ repeatIn(getpayments(data['form'],user), 'p') ]] [[ p['name'] or removeParentNode('tr') ]] - [[ formatLang(p['sum']) or removeParentNode('tr') ]] [[ company.currency_id.symbol ]] + [[ formatLang(p['sum'], dp='Account') or removeParentNode('tr') ]] [[ company.currency_id.symbol ]] @@ -290,7 +290,7 @@ - + s @@ -312,7 +312,7 @@ Sales total - [[ formatLang(getsalestotal2(data['form'],user)) ]][[ company.currency_id.symbol ]] + [[ formatLang(getsalestotal2(data['form'],user), dp='Sale Price') ]][[ company.currency_id.symbol ]] @@ -328,7 +328,7 @@ Total invoiced - [[ formatLang(getsuminvoice2(data['form'],user)) ]][[ company.currency_id.symbol ]] + [[ formatLang(getsuminvoice2(data['form'],user), dp='Sale Price') ]][[ company.currency_id.symbol ]] @@ -336,7 +336,7 @@ Total discount - [[ formatLang(getsumdisc(objects)) ]][[ company.currency_id.symbol ]] + [[ formatLang(getsumdisc(objects), dp='Sale Price') ]][[ company.currency_id.symbol ]] @@ -344,7 +344,7 @@ Total paid - [[ formatLang(getpaidtotal2(data['form'],user)) ]][[ company.currency_id.symbol ]] + [[ formatLang(getpaidtotal2(data['form'],user), dp='Sale Price') ]][[ company.currency_id.symbol ]] @@ -352,7 +352,7 @@ Total of the day - [[ formatLang(gettotalofthaday(data['form'])) ]][[ company.currency_id.symbol ]] + [[ formatLang(gettotalofthaday(data['form']), dp='Sale Price') ]][[ company.currency_id.symbol ]] @@ -360,4 +360,4 @@ - \ No newline at end of file + From 3703b886bff2e1af1f44674bed8eff923d2dfd06 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 14:16:51 +0200 Subject: [PATCH 045/294] [IMP] point_of_sale: 'Sales Lines' report now uses decimal.precision bzr revid: olt@tinyerp.com-20101005121651-vbn7jl71aa2w74la --- .../point_of_sale/report/pos_payment_report_date.rml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/point_of_sale/report/pos_payment_report_date.rml b/addons/point_of_sale/report/pos_payment_report_date.rml index 846eaf1f861..9d132fbfbf0 100644 --- a/addons/point_of_sale/report/pos_payment_report_date.rml +++ b/addons/point_of_sale/report/pos_payment_report_date.rml @@ -158,13 +158,13 @@ [[ formatLang(line_ids['qty']) ]] - [[ formatLang(line_ids['discount']) ]] + [[ formatLang(line_ids['discount'], dp='Sale Price') ]] - [[ formatLang(line_ids['price_unit']) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line_ids['price_unit'], dp='Sale Price') ]] [[ company.currency_id.symbol ]] - [[ formatLang(line_ids['total']) ]] [[ company.currency_id.symbol ]] + [[ formatLang(line_ids['total'], dp='Sale Price') ]] [[ company.currency_id.symbol ]] @@ -190,7 +190,7 @@ Total - [[ formatLang(pos_payment_date_total(data['form'])) or removeParentNode('blockTable')]] [[ company.currency_id.symbol ]] + [[ formatLang(pos_payment_date_total(data['form']), dp='Sale Price') or removeParentNode('blockTable')]] [[ company.currency_id.symbol ]] @@ -198,4 +198,4 @@ - \ No newline at end of file + From aaa9f12702dfa0afd96806d4716b69a17e77738d Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Tue, 5 Oct 2010 14:29:35 +0200 Subject: [PATCH 046/294] [IMP] marketing: now uses decimal.precision bzr revid: olt@tinyerp.com-20101005122935-qe6yghvx37itxwzw --- addons/marketing_campaign/marketing_campaign.py | 7 ++++--- addons/marketing_campaign/report/campaign_analysis.py | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index bdfe825781c..c62b5306c57 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -28,6 +28,7 @@ from traceback import format_exception from sys import exc_info from tools.safe_eval import safe_eval as eval import re +from decimal_precision import decimal_precision as dp from osv import fields, osv import netsvc @@ -108,7 +109,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor 'State',), 'activity_ids': fields.one2many('marketing.campaign.activity', 'campaign_id', 'Activities'), - 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting."), + 'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for running this campaign. You may also specify variable cost and revenue on each campaign activity. Cost and Revenue statistics are included in Campaign Reporting.", digits_compute=dp.get_precision('Purchase Price')), } _defaults = { @@ -399,8 +400,8 @@ class marketing_campaign_activity(osv.osv): 'from_ids': fields.one2many('marketing.campaign.transition', 'activity_to_id', 'Previous Activities'), - 'variable_cost': fields.float('Variable Cost', help="Set a variable cost if you consider that every campaign item that has reached this point has entailed a certain cost. You can get cost statistics in the Reporting section"), - 'revenue': fields.float('Revenue', help="Set an expected revenue if you consider that every campaign item that has reached this point has generated a certain revenue. You can get revenue statistics in the Reporting section"), + 'variable_cost': fields.float('Variable Cost', help="Set a variable cost if you consider that every campaign item that has reached this point has entailed a certain cost. You can get cost statistics in the Reporting section", digits_compute=dp.get_precision('Purchase Price')), + 'revenue': fields.float('Revenue', help="Set an expected revenue if you consider that every campaign item that has reached this point has generated a certain revenue. You can get revenue statistics in the Reporting section", digits_compute=dp.get_precision('Sale Price')), 'signal': fields.char('Signal', size=128, help='An activity with a signal can be called programmatically. Be careful, the workitem is always created when a signal is sent'), 'keep_if_condition_not_met': fields.boolean("Don't delete workitems", diff --git a/addons/marketing_campaign/report/campaign_analysis.py b/addons/marketing_campaign/report/campaign_analysis.py index 066423c546c..08f0599fb24 100644 --- a/addons/marketing_campaign/report/campaign_analysis.py +++ b/addons/marketing_campaign/report/campaign_analysis.py @@ -20,6 +20,8 @@ ############################################################################## import tools from osv import fields, osv +from decimal_precision import decimal_precision as dp + class campaign_analysis(osv.osv): _name = "campaign.analysis" @@ -61,8 +63,8 @@ class campaign_analysis(osv.osv): 'country_id': fields.related('partner_id','address', 'country_id', type='many2one', relation='res.country',string='Country'), 'total_cost' : fields.function(_total_cost, string='Cost', method=True, - type="float" ), - 'revenue': fields.float('Revenue',digits=(16,2),readonly=True), + type="float", digits_compute=dp.get_precision('Purchase Price')), + 'revenue': fields.float('Revenue', readonly=True, digits_compute=dp.get_precision('Sale Price')), 'count' : fields.integer('# of Actions', readonly=True), 'state': fields.selection([('todo', 'To Do'), ('exception', 'Exception'), ('done', 'Done'), From 4750ff6cb843fc6b4a88f140afbca2b9f7c7e944 Mon Sep 17 00:00:00 2001 From: "olt@tinyerp.com" <> Date: Wed, 6 Oct 2010 09:31:04 +0200 Subject: [PATCH 047/294] [FIX] account: account_general_ledger_landscape report: wrong argument passing to formatLang bzr revid: olt@tinyerp.com-20101006073104-forhzegtyvelzgtg --- addons/account/report/account_general_ledger_landscape.rml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/report/account_general_ledger_landscape.rml b/addons/account/report/account_general_ledger_landscape.rml index b370b03a4ec..40f8ad4a85e 100644 --- a/addons/account/report/account_general_ledger_landscape.rml +++ b/addons/account/report/account_general_ledger_landscape.rml @@ -329,7 +329,7 @@ [[ formatLang(sum_debit_account(o), dp='Account') ]] [[ formatLang(sum_credit_account(o), dp='Account') ]] - [[ formatLang(sum_balance_account(o), 'Account') ]] [[ company.currency_id.symbol ]] + [[ formatLang(sum_balance_account(o), dp='Account') ]] [[ company.currency_id.symbol ]] From 1e1830cd00a62908128a9d09005d86c0cffd54ec Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Fri, 8 Oct 2010 16:15:53 +0200 Subject: [PATCH 048/294] [FIX] generate_order_by now supports 'id' order_field. Sorting on 'id desc' is used in email_template/email_template.py . bzr revid: jth@openerp.com-20101008141553-tzf94l6lq2qeer96 --- bin/osv/orm.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index c4195dc00fa..817ca1469b6 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -4001,7 +4001,9 @@ class orm(orm_template): order_split = order_part.strip().split(' ') order_field = order_split[0].strip() order_direction = order_split[1].strip() if len(order_split) == 2 else '' - if order_field in self._columns: + if order_field == 'id': + order_by_clause = '"%s"."%s"' % (self._table, order_field) + elif order_field in self._columns: order_column = self._columns[order_field] if order_column._classic_read: order_by_clause = '"%s"."%s"' % (self._table, order_field) From 2272c189d9279eb368a030def29e0e7a42a91ce0 Mon Sep 17 00:00:00 2001 From: Julien Thewys Date: Wed, 20 Oct 2010 16:42:48 +0200 Subject: [PATCH 049/294] [IMP] Added cli args to load one or more languages translation terms automatically. Mainly used to automate languages installation at DB initialization. bzr revid: jth@openerp.com-20101020144248-q20vnt72ovx3md96 --- bin/addons/base/module/module.py | 16 +++++++++------- bin/openerp-server.py | 10 +++++++++- bin/tools/config.py | 4 ++++ bin/tools/translate.py | 13 +++++++++++++ 4 files changed, 35 insertions(+), 8 deletions(-) diff --git a/bin/addons/base/module/module.py b/bin/addons/base/module/module.py index b2c2da96d13..3aa42af3954 100644 --- a/bin/addons/base/module/module.py +++ b/bin/addons/base/module/module.py @@ -436,7 +436,7 @@ class module(osv.osv): self.write(cr, uid, [id], {'category_id': p_id}) def update_translations(self, cr, uid, ids, filter_lang=None, context={}): - logger = netsvc.Logger() + logger = logging.getLogger('i18n') if not filter_lang: pool = pooler.get_pool(cr.dbname) lang_obj = pool.get('res.lang') @@ -456,13 +456,15 @@ class module(osv.osv): if len(lang) > 5: raise osv.except_osv(_('Error'), _('You Can Not Load Translation For language Due To Invalid Language/Country Code')) iso_lang = tools.get_iso_codes(lang) - f = os.path.join(modpath, 'i18n', iso_lang + '.po') - if not os.path.exists(f) and iso_lang.find('_') != -1: - f = os.path.join(modpath, 'i18n', iso_lang.split('_')[0] + '.po') + fn = os.path.join(modpath, 'i18n', iso_lang + '.po') + if not os.path.exists(fn) and iso_lang.find('_') != -1: iso_lang = iso_lang.split('_')[0] - if os.path.exists(f): - logger.notifyChannel("i18n", netsvc.LOG_INFO, 'module %s: loading translation file for language %s' % (mod.name, iso_lang)) - tools.trans_load(cr.dbname, f, lang, verbose=False, context=context) + fn = os.path.join(modpath, 'i18n', iso_lang + '.po') + if os.path.exists(fn): + logger.info('module %s: loading translation file for language %s' % (mod.name, iso_lang)) + tools.trans_load(cr.dbname, fn, lang, verbose=False, context=context) + else: + logger.warn('module %s: translation file not found %s' % (mod.name, fn)) def check(self, cr, uid, ids, context=None): logger = logging.getLogger('init') diff --git a/bin/openerp-server.py b/bin/openerp-server.py index 8d210fc2906..18a2238daea 100755 --- a/bin/openerp-server.py +++ b/bin/openerp-server.py @@ -119,13 +119,21 @@ if not ( tools.config["stop_after_init"] or \ if tools.config['db_name']: for dbname in tools.config['db_name'].split(','): db,pool = pooler.get_db_and_pool(dbname, update_module=tools.config['init'] or tools.config['update'], pooljobs=False) + cr = db.cursor() + if tools.config["test_file"]: logger.info('loading test file %s', tools.config["test_file"]) - cr = db.cursor() tools.convert_yaml_import(cr, 'base', file(tools.config["test_file"]), {}, 'test', True) cr.rollback() + + if tools.config['load_language']: + for lang in tools.config['load_language'].split(','): + tools.load_language(cr, lang) + pool.get('ir.cron')._poolJobs(db.dbname) + cr.close() + #---------------------------------------------------------- # translation stuff #---------------------------------------------------------- diff --git a/bin/tools/config.py b/bin/tools/config.py index 2964870d427..c0600d0a881 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -58,6 +58,7 @@ class configmanager(object): 'xmlrpcs': True, 'translate_in': None, 'translate_out': None, + 'load_language': None, 'language': None, 'pg_path': None, 'admin_passwd': 'admin', @@ -206,6 +207,8 @@ class configmanager(object): "Option '-l' is mandatory in case of importation" ) + group.add_option('--load-language', dest="load_language", + help="specifies the languages for the translations you want to be loaded") group.add_option('-l', "--language", dest="language", help="specify the language of the translation file. Use it with --i18n-export or --i18n-import") group.add_option("--i18n-export", dest="translate_out", @@ -283,6 +286,7 @@ class configmanager(object): keys = [ 'language', 'translate_out', 'translate_in', 'debug_mode', 'smtp_ssl', + 'load_language', 'stop_after_init', 'logrotate', 'without_demo', 'netrpc', 'xmlrpc', 'syslog', 'list_db', 'xmlrpcs', 'test_file', 'test_disable', 'test_commit', 'test_report_directory' diff --git a/bin/tools/translate.py b/bin/tools/translate.py index f978ecbfd4b..ad4d6ba3b14 100644 --- a/bin/tools/translate.py +++ b/bin/tools/translate.py @@ -898,5 +898,18 @@ def resetlocale(): except locale.Error: continue +def load_language(cr, lang): + """Loads a translation terms for a language. + Used mainly to automate language loading at db initialization. + + :param lang: language ISO code with optional _underscore_ and l10n flavor (ex: 'fr', 'fr_BE', but not 'fr-BE') + :type lang: str + """ + pool = pooler.get_pool(cr.dbname) + language_installer = pool.get('base.language.install') + uid = 1 + oid = language_installer.create(cr, uid, {'lang': lang}) + language_installer.lang_install(cr, uid, [oid], context=None) + # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: From 925180946e2afc8744a71afb813c9a9ea851eccf Mon Sep 17 00:00:00 2001 From: "AMP (OpenERP)" Date: Mon, 25 Oct 2010 18:16:01 +0530 Subject: [PATCH 050/294] [MOD/IMP]: Improvement in Usebility Icon bzr revid: amp@tinyerp.com-20101025124601-mspsq4g5h4gwtj5l --- bin/addons/base/res/partner/wizard/partner_sms_send_view.xml | 2 +- bin/addons/base/res/partner/wizard/partner_wizard_spam_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml b/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml index 97c418d9f81..7d84d6d405a 100644 --- a/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml +++ b/bin/addons/base/res/partner/wizard/partner_sms_send_view.xml @@ -20,7 +20,7 @@