diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py index fd8d5e35c09..1316e20eaae 100644 --- a/bin/report/report_sxw.py +++ b/bin/report/report_sxw.py @@ -139,7 +139,11 @@ class _format(object): self._field = field self.name = name lang = self.object._context.get('lang', 'en_US') or 'en_US' - self.lang_obj = pool_lang.browse(cr, uid,pool_lang.search(cr, uid,[('code','=',lang)])[0]) + lids = pool_lang.search(cr, uid,[('code','=',lang)]) + if lids: + self.lang_obj = pool_lang.browse(cr, uid,lids[0]) + else: + self.lang_obj = False class _float_format(float, _format): @@ -151,7 +155,10 @@ class _float_format(float, _format): digits = 2 if hasattr(self,'_field') and hasattr(self._field, 'digits') and self._field.digits: digits = self._field.digits[1] - return self.lang_obj.format('%.' + str(digits) + 'f', self.name, True) + if self.lang_obj: + return self.lang_obj.format('%.' + str(digits) + 'f', self.name, True) + else: + return str(self.name) return self.val class _int_format(int, _format): @@ -161,7 +168,10 @@ class _int_format(int, _format): def __str__(self): if hasattr(self,'lang_obj'): - return self.lang_obj.format('%.d', self.name, True) + if self.lang_obj: + return self.lang_obj.format('%.d', self.name, True) + else: + return str(self.name) return self.val @@ -174,7 +184,10 @@ class _date_format(str, _format): if self.val: if hasattr(self,'name') and (self.name): date = mx.DateTime.strptime(self.name,DT_FORMAT) - return date.strftime(self.lang_obj.date_format) + if self.lang_obj: + return date.strftime(self.lang_obj.date_format) + else: + return date.strftime('%m/%d/%Y') return self.val class _dttime_format(str, _format): @@ -186,7 +199,10 @@ class _dttime_format(str, _format): if self.val: if hasattr(self,'name') and self.name: datetime = mx.DateTime.strptime(self.name,DHM_FORMAT) - return datetime.strftime(self.lang_obj.date_format+ " " + self.lang_obj.time_format) + if self.lang_obj: + return datetime.strftime(self.lang_obj.date_format+ " " + self.lang_obj.time_format) + else: + return datetime.strftime('%m/%d/%Y %H:%M:%S') return self.val @@ -338,7 +354,9 @@ class rml_parse(object): return '' pool_lang = self.pool.get('res.lang') lang = self.localcontext.get('lang', 'en_US') or 'en_US' - lang_obj = pool_lang.browse(self.cr,self.uid,pool_lang.search(self.cr,self.uid,[('code','=',lang)])[0]) + lids = pool_lang.search(self.cr,self.uid,[('code','=',lang)]) + if not lids: return str(value) + lang_obj = pool_lang.browse(self.cr,self.uid,lids[0]) if date or date_time: if not str(value): return '' diff --git a/man/openerp-server.1 b/man/openerp-server.1 index f5d336ba494..6048817e574 100644 --- a/man/openerp-server.1 +++ b/man/openerp-server.1 @@ -1,10 +1,10 @@ -.TH openerp_server 1 - +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. +.TH OPENERP "1" "March 2009" "OpenERP Server 5.0.0" "User Commands" .SH NAME -openerp_server \- Server for OpenERP - +OpenERP \- manual page for OpenERP Server 5.0.0 .SH SYNOPSIS -.B openerp_server.py [options] +.B openerp-server.py +[\fIoptions\fR] .SH DESCRIPTION OpenERP is an Enterprise Resource Planning and Customer Relationship @@ -17,70 +17,166 @@ server, flexible workflows, an object database, a dynamic GUI, customizable reports, and a NET-RPC and XML-RPC interface. .SH OPTIONS +.TP +\fB\-\-version\fR +show program's version number and exit +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-c\fR CONFIG, \fB\-\-config\fR=\fICONFIG\fR +specify alternate config file +.TP +\fB\-s\fR, \fB\-\-save\fR +save configuration to ~/.openerp_serverrc +.TP +\fB\-\-pidfile\fR=\fIPIDFILE\fR +file where the server pid will be stored +.TP +\fB\-n\fR INTERFACE, \fB\-\-interface\fR=\fIINTERFACE\fR +specify the TCP IP address +.TP +\fB\-p\fR PORT, \fB\-\-port\fR=\fIPORT\fR +specify the TCP port +.TP +\fB\-\-net_interface\fR=\fINETINTERFACE\fR +specify the TCP IP address for netrpc +.TP +\fB\-\-net_port\fR=\fINETPORT\fR +specify the TCP port for netrpc +.TP +\fB\-\-no\-netrpc\fR +disable netrpc +.TP +\fB\-\-no\-xmlrpc\fR +disable xmlrpc +.TP +\fB\-i\fR INIT, \fB\-\-init\fR=\fIINIT\fR +init a module (use "all" for all modules) +.TP +\fB\-\-without\-demo\fR=\fIWITHOUT_DEMO\fR +load demo data for a module (use "all" for all +modules) +.TP +\fB\-u\fR UPDATE, \fB\-\-update\fR=\fIUPDATE\fR +update a module (use "all" for all modules) +.TP +\fB\-\-cache\-timeout\fR=\fICACHE_TIMEOUT\fR +set the timeout for the cache system +.TP +\fB\-\-stop\-after\-init\fR +stop the server after it initializes +.TP +\fB\-\-debug\fR +enable debug mode +.TP +\fB\-\-assert\-exit\-level\fR=\fIASSERT_EXIT_LEVEL\fR +specify the level at which a failed assertion will +stop the server. Accepted values: ['info', +\&'debug_rpc', 'warn', 'critical', 'error', 'debug', +\&'notset'] + +.SH SSL CONFIGURATION +.TP +\fB\-S\fR, \fB\-\-secure\fR +launch server over https instead of http +.TP +\fB\-\-cert\-file\fR=\fISECURE_CERT_FILE\fR +specify the certificate file for the SSL connection +.TP +\fB\-\-pkey\-file\fR=\fISECURE_PKEY_FILE\fR +specify the private key file for the SSL connection + +.SH LOGGING CONFIGURATION +.TP +\fB\-\-logfile\fR=\fILOGFILE\fR +file where the server log will be stored +.TP +\fB\-\-syslog\fR +Send the log to the syslog server +.TP +\fB\-\-log\-level\fR=\fILOG_LEVEL\fR +specify the level of the logging. Accepted values: +['info', 'debug_rpc', 'warn', 'critical', 'error', +\&'debug', 'notset'] + +.SH SMTP CONFIGURATION +.TP +\fB\-\-email\-from\fR=\fIEMAIL_FROM\fR +specify the SMTP email address for sending email +.TP +\fB\-\-smtp\fR=\fISMTP_SERVER\fR +specify the SMTP server for sending email +.TP +\fB\-\-smtp\-port\fR=\fISMTP_PORT\fR +specify the SMTP port +.TP +\fB\-\-smtp\-ssl\fR=\fISMTP_SSL\fR +specify the SMTP server support SSL or not +.TP +\fB\-\-smtp\-user\fR=\fISMTP_USER\fR +specify the SMTP username for sending email +.TP +\fB\-\-smtp\-password\fR=\fISMTP_PASSWORD\fR +specify the SMTP password for sending email +.TP +\fB\-\-price_accuracy\fR=\fIPRICE_ACCURACY\fR +specify the price accuracy + +.SH DATABASE RELATED OPTIONS .TP -.B \-h, \-\-help -Print this help message and exit. - +\fB\-d\fR DB_NAME, \fB\-\-database\fR=\fIDB_NAME\fR +specify the database name .TP -.B \-\-version -Print the program's version number and exit. - +\fB\-r\fR DB_USER, \fB\-\-db_user\fR=\fIDB_USER\fR +specify the database user name .TP -.B \-c \fIFILE\fB, \-\-config=\fIFILE\fB -Specify an alternate config file. By default, openerp server uses ~/.openerp_serverrc - +\fB\-w\fR DB_PASSWORD, \fB\-\-db_password\fR=\fIDB_PASSWORD\fR +specify the database password .TP -.B \-s, \-\-save -Save the configuration to ~/.openerp_serverrc. By default, the options given on the command line are not saved. - +\fB\-\-pg_path\fR=\fIPG_PATH\fR +specify the pg executable path .TP -.B \-p \fIPORT\fB, \-\-port=\fIPORT\fB -Specify the TCP port the server should use. By default, the server uses the port 8069. - +\fB\-\-db_host\fR=\fIDB_HOST\fR +specify the database host .TP -.B \-\-interface=\fIINTERFACE\fB -Specify the network interface the server should be bound to. You probably want to set it to the IP address of the computer. -By default, the server is bound to 'localhost' and thus can only accept connections from clients on the same computer. - +\fB\-\-db_port\fR=\fIDB_PORT\fR +specify the database port .TP -.B \-d \fIDATABASE\fB, --database=\fIDATABASE\fB -Specify the database name (default terp). - +\fB\-\-db_maxconn\fR=\fIDB_MAXCONN\fR +specify the the maximum number of physical connections +to posgresql .TP -.B \-i \fIMODULE\fB, \-\-init=\fIMODULE\fB -Initialize a module (use "all" for all modules). -\fBWarning:\fR this will erase the data concerning that module! - -.TP -.B \-u \fIMODULE\fB, \-\-update=\fIMODULE\fB -Update a module (use "all" for all modules). - -.TP -.B \-\-price_accuracy=\fIPRICE_ACCURACY\fB -Specify the price accuracy. - -.TP -.B \-v, \-\-verbose -Enable verbose mode. +\fB\-P\fR IMPORT_PARTIAL, \fB\-\-import\-partial\fR=\fIIMPORT_PARTIAL\fR +Use this for big data importation, if it crashes you +will be able to continue at the current state. Provide +a filename to store intermediate importation states. .SH INTERNATIONALISATION OPTIONS -Use these options to translate OpenERP in another language. See the i18n -section of the user manual. Option '-l' is mandatory. - -.TP -.B \-l \fILANGUAGE\fB, --language=\fILANGUAGE\fB -Specify the language of the translation file. Use this option in -combination with --i18n-export or --i18n-import. - +Use these options to translate OpenERP to another language.See i18n +section of the user manual. Option '\-d' is mandatory.Option '\-l' is +mandatory in case of importation .TP -.B \-\-i18n-export=\fIFILEPATH\fB -Export all sentences to be translated to \fIFILEPATH\fR. - +\fB\-l\fR LANGUAGE, \fB\-\-language\fR=\fILANGUAGE\fR +specify the language of the translation file. Use it +with \fB\-\-i18n\-export\fR or \fB\-\-i18n\-import\fR .TP -.B \-\-i18n-import=\fIFILEPATH\fB -Import the CSV file at \fIFILEPATH\fR. It should contain the translations for the language specified with the \fI-l\fR option. +\fB\-\-i18n\-export\fR=\fITRANSLATE_OUT\fR +export all sentences to be translated to a CSV file, a +PO file or a TGZ archive and exit +.TP +\fB\-\-i18n\-import\fR=\fITRANSLATE_IN\fR +import a CSV or a PO file with translations and exit. +The '\-l' option is required. +.TP +\fB\-\-modules\fR=\fITRANSLATE_MODULES\fR +specify modules to export. Use in combination with +\fB\-\-i18n\-export\fR +.TP +\fB\-\-addons\-path\fR=\fIADDONS_PATH\fR +specify an alternative addons path. .SH FILES ~/.openerp_serverrc @@ -93,6 +189,6 @@ OpenERP is a product of \fBTiny.be\fR (\fIhttp://www.tiny.be\fR) openerp_serverrc(5) openerp(1) .br -\fIhttp://www.openerp.com\fR : OpenERP functional description - - +\fIhttp://www.openerp.com\fR : Open ERP official website +.br +\fIhttp://doc.openerp.com\fR : Open ERP documentation