[IMP] removed price_accuracy options

bzr revid: fp@tinyerp.com-20100704125727-nywaqszkgyft233z
This commit is contained in:
Fabien Pinckaers 2010-07-04 14:57:27 +02:00
parent 1057fbf3c7
commit b9f86b3de2
3 changed files with 4 additions and 4 deletions

View File

@ -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("'","''")))

View File

@ -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:

View File

@ -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',