From b9f86b3de246c123422a416ce4a55b01d1bfadf1 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Sun, 4 Jul 2010 14:57:27 +0200 Subject: [PATCH] [IMP] removed price_accuracy options bzr revid: fp@tinyerp.com-20100704125727-nywaqszkgyft233z --- bin/osv/orm.py | 2 ++ bin/report/printscreen/ps_list.py | 2 +- bin/tools/config.py | 4 +--- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/osv/orm.py b/bin/osv/orm.py index 0f5fe446418..be23f5c4e7f 100644 --- a/bin/osv/orm.py +++ b/bin/osv/orm.py @@ -2382,6 +2382,8 @@ class orm(orm_template): break i+=1 logger.notifyChannel('orm', netsvc.LOG_WARNING, "column '%s' in table '%s' has changed type (DB=%s, def=%s), data moved to table %s !" % (k, self._table, f_pg_type, f._type, newname)) + if f_pg_notnull: + cr.execute('ALTER TABLE "%s" ALTER COLUMN "%s" DROP NOT NULL' % (self._table, k)) cr.execute('ALTER TABLE "%s" RENAME COLUMN "%s" TO "%s"' % (self._table, k, newname)) cr.execute('ALTER TABLE "%s" ADD COLUMN "%s" %s' % (self._table, k, get_pg_type(f)[1])) cr.execute("COMMENT ON COLUMN %s.%s IS '%s'" % (self._table, k, f.string.replace("'","''"))) diff --git a/bin/report/printscreen/ps_list.py b/bin/report/printscreen/ps_list.py index 733264ea07d..79d4813270f 100644 --- a/bin/report/printscreen/ps_list.py +++ b/bin/report/printscreen/ps_list.py @@ -232,7 +232,7 @@ class report_printscreen_list(report_int): col.set('tree','float') if tsum[f] != None: if tsum[f] >= 0.01 : - prec = '%.' + str(tools.config['price_accuracy']) + 'f' + prec = '%.2f' total = prec%(tsum[f]) txt = str(total or '') else: diff --git a/bin/tools/config.py b/bin/tools/config.py index 1a0886d00ff..cbabb3d0cab 100644 --- a/bin/tools/config.py +++ b/bin/tools/config.py @@ -75,7 +75,6 @@ class configmanager(object): 'smtp_ssl':False, 'smtp_password': False, 'stop_after_init': False, # this will stop the server after initialization - 'price_accuracy': 2, 'syslog' : False, 'log_level': logging.INFO, 'assert_exit_level': logging.ERROR, # level above which a failed assert will be raised @@ -141,7 +140,6 @@ class configmanager(object): parser.add_option('--debug', dest='debug_mode', action='store_true', default=False, help='enable debug mode') parser.add_option("--assert-exit-level", dest='assert_exit_level', type="choice", choices=self._LOGLEVELS.keys(), help="specify the level at which a failed assertion will stop the server. Accepted values: %s" % (self._LOGLEVELS.keys(),)) - parser.add_option('--price_accuracy', dest='price_accuracy', default='2', help='deprecated since v6.0, replaced by module decimal_precision') # Testing Group group = optparse.OptionGroup(parser, "Testing Configuration") @@ -257,7 +255,7 @@ class configmanager(object): keys = ['xmlrpc_interface', 'xmlrpc_port', 'db_name', 'db_user', 'db_password', 'db_host', 'db_port', 'list_db', 'logfile', 'pidfile', 'smtp_port', 'cache_timeout','smtp_ssl', - 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', 'price_accuracy', + 'email_from', 'smtp_server', 'smtp_user', 'smtp_password', 'netrpc_interface', 'netrpc_port', 'db_maxconn', 'import_partial', 'addons_path', 'netrpc', 'xmlrpc', 'syslog', 'without_demo', 'timezone', 'xmlrpcs_interface', 'xmlrpcs_port', 'xmlrpcs',