From 4708ea448ea5cd0ae4a5690c3b534f78becffb87 Mon Sep 17 00:00:00 2001 From: "AMP (OpenERP)" Date: Mon, 6 Sep 2010 17:09:53 +0530 Subject: [PATCH 1/8] [MOD]hr_evaluation : usability improvement bzr revid: amp@tinyerp.com-20100906113953-wsa583t5cqculash --- addons/hr_attendance/hr_attendance_view.xml | 4 ++-- addons/hr_evaluation/hr_evaluation.py | 6 +++--- addons/hr_evaluation/hr_evaluation_view.xml | 9 +++++---- addons/hr_recruitment/hr_recruitment_view.xml | 6 ------ 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/addons/hr_attendance/hr_attendance_view.xml b/addons/hr_attendance/hr_attendance_view.xml index 8a0e9d79ebc..9768d19c860 100644 --- a/addons/hr_attendance/hr_attendance_view.xml +++ b/addons/hr_attendance/hr_attendance_view.xml @@ -113,8 +113,8 @@ - - + + hr.employee.form1 diff --git a/addons/hr_evaluation/hr_evaluation.py b/addons/hr_evaluation/hr_evaluation.py index c6657eff688..7d07e676a24 100644 --- a/addons/hr_evaluation/hr_evaluation.py +++ b/addons/hr_evaluation/hr_evaluation.py @@ -34,7 +34,7 @@ class hr_evaluation_plan(osv.osv): 'company_id': fields.many2one('res.company', 'Company', required=True), 'phase_ids': fields.one2many('hr_evaluation.plan.phase', 'plan_id', 'Evaluation Phases'), 'month_first': fields.integer('First Evaluation After'), - 'month_next': fields.integer('Next Evaluation After'), + 'month_next': fields.integer('After the Date of Start'), 'active': fields.boolean('Active') } _defaults = { @@ -67,10 +67,10 @@ class hr_evaluation_plan_phase(osv.osv): 'send_anonymous_employee': fields.boolean('Anonymous Summary', help="Send an anonymous summary to the employee"), 'wait': fields.boolean('Wait Previous Phases', - help="Check this box if you want to wait that all preceeding phases " + + help="Check this box if you want to wait that all preceding phases " + "are finished before launching this phase."), 'mail_feature': fields.boolean('Send mail for this phase', help="Check this box if you want to send mail to employees"+ - "coming under this phase"), + " coming under this phase"), 'mail_body': fields.text('Email'), 'email_subject':fields.text('char') } diff --git a/addons/hr_evaluation/hr_evaluation_view.xml b/addons/hr_evaluation/hr_evaluation_view.xml index e10a1ae239b..9dad15ca0df 100644 --- a/addons/hr_evaluation/hr_evaluation_view.xml +++ b/addons/hr_evaluation/hr_evaluation_view.xml @@ -26,13 +26,14 @@ form
- + - @@ -72,7 +73,7 @@ hr_evaluation.plan.phase form - + @@ -125,7 +126,7 @@ hr_evaluation.plan.phase tree - + diff --git a/addons/hr_recruitment/hr_recruitment_view.xml b/addons/hr_recruitment/hr_recruitment_view.xml index 8e6b68ec401..8aaf6f9cbd7 100644 --- a/addons/hr_recruitment/hr_recruitment_view.xml +++ b/addons/hr_recruitment/hr_recruitment_view.xml @@ -6,11 +6,6 @@ name="Recruitment" parent="hr.menu_hr_configuration" sequence="2"/> - # ------------------------------------------------------ # Job Categories @@ -35,7 +30,6 @@ {} - # ------------------------------------------------------ # Jobs From 34e7e5b3b5a1afce83fe4aab470f7317121f782c Mon Sep 17 00:00:00 2001 From: "AMP (OpenERP)" Date: Mon, 6 Sep 2010 18:01:10 +0530 Subject: [PATCH 2/8] [MOD]hr_recruitment : usability improvement bzr revid: amp@tinyerp.com-20100906123110-n74zz1opzcuqtso7 --- addons/hr_recruitment/report/hr_recruitment_report.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py index 7bce80d538d..77682ffd897 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report.py +++ b/addons/hr_recruitment/report/hr_recruitment_report.py @@ -23,10 +23,10 @@ from osv import fields,osv from hr_recruitment import hr_recruitment AVAILABLE_STATES = [ - ('draft','Draft'), + ('draft','New'), ('open','Open'), - ('cancel', 'Cancelled'), - ('done', 'Closed'), + ('cancel', 'Refused'), + ('done', 'Hired'), ('pending','Pending') ] From 4154355f2fea9e8c4857387b1c475acb8e8b7c11 Mon Sep 17 00:00:00 2001 From: "Vir (Open ERP)" Date: Mon, 6 Sep 2010 18:04:40 +0530 Subject: [PATCH 3/8] [ADD/MOD] subscription : tooltip added and menu name changed bzr revid: vir@tinyerp.com-20100906123440-knm5kys9dzvwd2zt --- addons/subscription/subscription.py | 6 +++--- addons/subscription/subscription_view.xml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/subscription/subscription.py b/addons/subscription/subscription.py index 934f1a42707..8fa330b1fb5 100644 --- a/addons/subscription/subscription.py +++ b/addons/subscription/subscription.py @@ -53,7 +53,7 @@ class subscription_document_fields(osv.osv): _rec_name = 'field' _columns = { 'field': fields.many2one('ir.model.fields', 'Field', domain="[('model_id', '=', parent.model)]", required=True), - 'value': fields.selection([('false','False'),('date','Current Date')], 'Default Value', size=40), + 'value': fields.selection([('false','False'),('date','Current Date')], 'Default Value', size=40, help="User can set new values for the field when new document is generated"), 'document_id': fields.many2one('subscription.document', 'Subscription Document', ondelete='cascade'), } _defaults = {} @@ -77,9 +77,9 @@ class subscription_subscription(osv.osv): 'exec_init': fields.integer('Number of documents'), 'date_init': fields.datetime('First Date'), 'state': fields.selection([('draft','Draft'),('running','Running'),('done','Done')], 'State'), - 'doc_source': fields.reference('Source Document', required=True, selection=_get_document_types, size=128), + 'doc_source': fields.reference('Source Document', required=True, selection=_get_document_types, size=128, help="User can choose the source document on which he wants to create documents"), 'doc_lines': fields.one2many('subscription.subscription.history', 'subscription_id', 'Documents created', readonly=True), - 'cron_id': fields.many2one('ir.cron', 'Cron Job'), + 'cron_id': fields.many2one('ir.cron', 'Cron Job', help="Scheduler which run on subscription"), 'note': fields.text('Notes', help="Description or Summary of Subscription"), } _defaults = { diff --git a/addons/subscription/subscription_view.xml b/addons/subscription/subscription_view.xml index 0c416c86a20..abe58ced56d 100644 --- a/addons/subscription/subscription_view.xml +++ b/addons/subscription/subscription_view.xml @@ -101,7 +101,7 @@ - All Subscriptions + Subscriptions ir.actions.act_window subscription.subscription form From ab830b6ba32048a318635165efb3fdcfef97902d Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Mon, 6 Sep 2010 19:03:50 +0530 Subject: [PATCH 4/8] [FIX] Base : Currency rates assigned to Currencies lp bug: https://launchpad.net/bugs/628193 fixed bzr revid: jvo@tinyerp.com-20100906133350-hj4tlow46mtp10cj --- bin/addons/base/base_data.xml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml index 9284f4eefeb..f3322a14353 100644 --- a/bin/addons/base/base_data.xml +++ b/bin/addons/base/base_data.xml @@ -1067,7 +1067,7 @@ - + < @@ -1167,7 +1167,7 @@ - 2332.91 + 2933.8378 @@ -1181,7 +1181,7 @@ - 24.6682 + 26.5634 @@ -1210,10 +1210,24 @@ - 284.1004 + 271.5621 + + + Rs + IDR + Rs + 0.01 + 4 + + + + 13495.2056 + + + Ls @@ -1268,12 +1282,11 @@ - 3.9416 + 4.1005 - kr SEK @@ -1283,7 +1296,7 @@ - 9.2981 + 10.3004 From 56d507a7e16007e0a5c6eed1b5a1a98317d3c031 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 6 Sep 2010 15:47:47 +0200 Subject: [PATCH 5/8] [FIX] Remove a character bzr revid: stephane@openerp.com-20100906134747-hwl81jx35xk2oh83 --- bin/addons/base/base_data.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/addons/base/base_data.xml b/bin/addons/base/base_data.xml index f3322a14353..c35382b028f 100644 --- a/bin/addons/base/base_data.xml +++ b/bin/addons/base/base_data.xml @@ -1067,7 +1067,7 @@ - < + From 6b2e5f98962958b8480f629d0b336a3d88bf0066 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Mon, 6 Sep 2010 16:06:45 +0200 Subject: [PATCH 6/8] [FIX] Use the currentThread function instead of current_thread bzr revid: stephane@openerp.com-20100906140645-zxt6los8sl54qzj0 --- bin/netsvc.py | 2 +- bin/sql_db.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/netsvc.py b/bin/netsvc.py index 11f7ca5b695..52825c48f82 100644 --- a/bin/netsvc.py +++ b/bin/netsvc.py @@ -167,7 +167,7 @@ LEVEL_COLOR_MAPPING = { class DBFormatter(logging.Formatter): def format(self, record): - record.dbname = getattr(threading.current_thread(), 'dbname', '?') + record.dbname = getattr(threading.currentThread(), 'dbname', '?') return logging.Formatter.format(self, record) class ColoredFormatter(DBFormatter): diff --git a/bin/sql_db.py b/bin/sql_db.py index 438d513b0e4..193a709dd8d 100644 --- a/bin/sql_db.py +++ b/bin/sql_db.py @@ -21,7 +21,7 @@ __all__ = ['db_connect', 'close_db'] -from threading import current_thread +from threading import currentThread import logging from psycopg2.extensions import ISOLATION_LEVEL_AUTOCOMMIT, ISOLATION_LEVEL_READ_COMMITTED, ISOLATION_LEVEL_SERIALIZABLE from psycopg2.psycopg1 import cursor as psycopg1cursor @@ -365,13 +365,13 @@ def dsn_are_equals(first, second): _Pool = ConnectionPool(int(tools.config['db_maxconn'])) def db_connect(db_name): - current_thread().dbname = db_name + currentThread().dbname = db_name return Connection(_Pool, db_name) def close_db(db_name): _Pool.close_all(dsn(db_name)) tools.cache.clean_caches_for_db(db_name) - ct = current_thread() + ct = currentThread() if hasattr(ct, 'dbname'): delattr(ct, 'dbname') From d429b331e067d9e8f81a8499812ca60052ec75d5 Mon Sep 17 00:00:00 2001 From: "Jay (OpenERP)" Date: Mon, 6 Sep 2010 20:15:33 +0530 Subject: [PATCH 7/8] [FIX] Custom field may not be found on the first go bzr revid: jvo@tinyerp.com-20100906144533-eal9zioe9ea2na73 --- bin/osv/orm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 6f73f821f8e..3421190fc5f 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -443,7 +443,7 @@ class orm_template(object): if context.get('field_name', '') == k: vals['select_level'] = context.get('select', '0') #setting value to let the problem NOT occur next time - else: + elif k in cols: vals['select_level'] = cols[k]['select_level'] if k not in cols: From 0f8e08d61718742e5be73e9b14e88b3bee208b05 Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Mon, 6 Sep 2010 17:29:27 +0200 Subject: [PATCH 8/8] [FIX] cron: avoid multiple cron bzr revid: chs@openerp.com-20100906152927-7xhtr8q4vqjqc26h --- bin/addons/base/ir/ir_cron.py | 34 ++++++++++++++++++---------------- bin/pooler.py | 11 +++++------ 2 files changed, 23 insertions(+), 22 deletions(-) diff --git a/bin/addons/base/ir/ir_cron.py b/bin/addons/base/ir/ir_cron.py index 905b2dc1778..33962c557c4 100644 --- a/bin/addons/base/ir/ir_cron.py +++ b/bin/addons/base/ir/ir_cron.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ############################################################################## # -# OpenERP, Open Source Management Solution +# OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (). All Rights Reserved # $Id$ # @@ -50,7 +50,7 @@ class ir_cron(osv.osv, netsvc.Agent): 'interval_number': fields.integer('Interval Number'), 'interval_type': fields.selection( [('minutes', 'Minutes'), ('hours', 'Hours'), ('work_days','Work Days'), ('days', 'Days'),('weeks', 'Weeks'), ('months', 'Months')], 'Interval Unit'), - 'numbercall': fields.integer('Number of Calls', help='Number of time the function is called,\na negative number indicates that the function will always be called'), + 'numbercall': fields.integer('Number of Calls', help='Number of time the function is called,\na negative number indicates that the function will always be called'), 'doall' : fields.boolean('Repeat Missed'), 'nextcall' : fields.datetime('Next Call Date', required=True), 'model': fields.char('Object', size=64), @@ -77,7 +77,7 @@ class ir_cron(osv.osv, netsvc.Agent): except: return False return True - + _constraints = [ (_check_args, 'Invalid arguments', ['args']), ] @@ -98,7 +98,7 @@ class ir_cron(osv.osv, netsvc.Agent): try: db, pool = pooler.get_db_and_pool(db_name) except: - return False + return False cr = db.cursor() try: if not pool._init: @@ -107,7 +107,7 @@ class ir_cron(osv.osv, netsvc.Agent): for job in cr.dictfetchall(): nextcall = datetime.strptime(job['nextcall'], '%Y-%m-%d %H:%M:%S') numbercall = job['numbercall'] - + ok = False while nextcall < now and numbercall: if numbercall > 0: @@ -125,12 +125,12 @@ class ir_cron(osv.osv, netsvc.Agent): cr.execute('select min(nextcall) as min_next_call from ir_cron where numbercall<>0 and active and nextcall>=now()') - next_call = cr.dictfetchone()['min_next_call'] + next_call = cr.dictfetchone()['min_next_call'] if next_call: next_call = time.mktime(time.strptime(next_call, '%Y-%m-%d %H:%M:%S')) else: next_call = int(time.time()) + 3600 # if do not find active cron job from database, it will run again after 1 day - + if not check: self.setAlarm(self._poolJobs, next_call, db_name, db_name) @@ -138,29 +138,31 @@ class ir_cron(osv.osv, netsvc.Agent): logger = netsvc.Logger() logger.notifyChannel('cron', netsvc.LOG_WARNING, 'Exception in cron:'+str(ex)) - + finally: cr.commit() cr.close() - + def restart(self, dbname): + self.cancel(dbname) + self._poolJobs(dbname) + def create(self, cr, uid, vals, context=None): - res = super(ir_cron, self).create(cr, uid, vals, context=context) + res = super(ir_cron, self).create(cr, uid, vals, context=context) cr.commit() - self.cancel(cr.dbname) - self._poolJobs(cr.dbname) + self.restart(cr.dbname) return res + def write(self, cr, user, ids, vals, context=None): res = super(ir_cron, self).write(cr, user, ids, vals, context=context) cr.commit() - self.cancel(cr.dbname) - self._poolJobs(cr.dbname) + self.restart(cr.dbname) return res + def unlink(self, cr, uid, ids, context=None): res = super(ir_cron, self).unlink(cr, uid, ids, context=context) cr.commit() - self.cancel(cr.dbname) - self._poolJobs(cr.dbname) + self.restart(cr.dbname) return res ir_cron() diff --git a/bin/pooler.py b/bin/pooler.py index d0f38836504..7a572e71e0d 100644 --- a/bin/pooler.py +++ b/bin/pooler.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 . # ############################################################################## @@ -34,10 +34,10 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, import osv.osv pool = osv.osv.osv_pool() pool_dic[db_name] = pool - + try: addons.load_modules(db, force_demo, status, update_module) - except Exception, e: + except Exception: del pool_dic[db_name] raise @@ -51,13 +51,12 @@ def get_db_and_pool(db_name, force_demo=False, status=None, update_module=False, import report report.interface.register_all(db) if pooljobs: - pool.get('ir.cron')._poolJobs(db.dbname) + pool.get('ir.cron').restart(db.dbname) return db, pool def restart_pool(db_name, force_demo=False, status=None, update_module=False): if db_name in pool_dic: - pool_dic[db_name].get('ir.cron').cancel(db_name) del pool_dic[db_name] return get_db_and_pool(db_name, force_demo, status, update_module=update_module)