From 182b9a7182400fe43ec966f74563a5acfceda49f Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 24 Jan 2012 16:34:19 +0100 Subject: [PATCH 001/154] [IMP] document_webdav.webdav_server: remove the so called `uniform log handling` of the HttpLogHandler class. bzr revid: vmt@openerp.com-20120124153419-w6oed6z1ui8mouo7 --- addons/document_webdav/webdav_server.py | 37 +++++++++++-------------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/addons/document_webdav/webdav_server.py b/addons/document_webdav/webdav_server.py index 81435a72137..ac7f87933ef 100644 --- a/addons/document_webdav/webdav_server.py +++ b/addons/document_webdav/webdav_server.py @@ -55,6 +55,8 @@ from DAV.propfind import PROPFIND from xml.dom import minidom from redirect import RedirectHTTPHandler +_logger = logging.getLogger(__name__) + khtml_re = re.compile(r' KHTML/([0-9\.]+) ') def OpenDAVConfig(**kw): @@ -73,7 +75,6 @@ def OpenDAVConfig(**kw): class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): verbose = False - _logger = logging.getLogger('webdav') protocol_version = 'HTTP/1.1' _HTTP_OPTIONS= { 'DAV' : ['1', '2'], 'Allow' : [ 'GET', 'HEAD', 'COPY', 'MOVE', 'POST', 'PUT', @@ -85,7 +86,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): return False def _log(self, message): - self._logger.debug(message) + _logger.debug(message) def handle(self): self._init_buffer() @@ -106,7 +107,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): if hasattr(self.request, 'getsockname'): addr, port = self.request.getsockname() except Exception, e: - self.log_error("Cannot calculate own address: %s" , e) + _logger.warning("Cannot calculate own address: %s", e) # Too early here to use self.headers self.baseuri = "%s://%s:%d/"% (server_proto, addr, port) self.IFACE_CLASS = openerp_dav_handler(self, self.verbose) @@ -126,12 +127,6 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): def get_davpath(self): return self.davpath - def log_message(self, format, *args): - self._logger.log(netsvc.logging.DEBUG_RPC,format % args) - - def log_error(self, format, *args): - self._logger.warning(format % args) - def _prep_OPTIONS(self, opts): ret = opts dc=self.IFACE_CLASS @@ -142,7 +137,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): except DAV_Error, (ec,dd): pass except Exception,e: - self.log_error("Error at options: %s", str(e)) + _logger.warning("Error at options: %s", str(e)) raise return ret @@ -245,7 +240,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): try: location = dc.put(uri, body, ct) except DAV_Error, (ec,dd): - self.log_error("Cannot PUT to %s: %s", uri, dd) + _logger.warning("Cannot PUT to %s: %s", uri, dd) return self.send_status(ec) headers = {} @@ -284,7 +279,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): """ Unlocks given resource """ dc = self.IFACE_CLASS - self.log_message('UNLOCKing resource %s' % self.headers) + _logger.log(netsvc.logging.DEBUG_RPC, 'UNLOCKing resource %s' % self.headers) uri = urlparse.urljoin(self.get_baseuri(dc), self.path) uri = urllib.unquote(uri) @@ -318,7 +313,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): dc = self.IFACE_CLASS lock_data = {} - self.log_message('LOCKing resource %s' % self.headers) + _logger.log(netsvc.logging.DEBUG_RPC, 'LOCKing resource %s' % self.headers) body = None if self.headers.has_key('Content-Length'): @@ -329,7 +324,7 @@ class DAVHandler(HttpOptions, FixSendError, DAVRequestHandler): uri = urlparse.urljoin(self.get_baseuri(dc), self.path) uri = urllib.unquote(uri) - self.log_message('do_LOCK: uri = %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'do_LOCK: uri = %s' % uri) ifheader = self.headers.get('If') @@ -477,7 +472,7 @@ class dummy_dav_interface(object): uri2 = uri.split('/') if len(uri2) < 3: return True - logging.getLogger('webdav').debug("Requested uri: %s", uri) + _logger.debug("Requested uri: %s", uri) return None # no def is_collection(self, uri): @@ -532,7 +527,7 @@ class DAVStaticHandler(http_server.StaticHTTPHandler): except DAV_Error, (ec,dd): return self.send_error(ec,dd) except Exception: - self.log_exception("Cannot PROPFIND") + _logger.exception("Cannot PROPFIND") raise # work around MSIE DAV bug for creation and modified date @@ -573,7 +568,7 @@ try: conf = OpenDAVConfig(**_dc) handler._config = conf reg_http_service(directory, DAVHandler, DAVAuthProvider) - logging.getLogger('webdav').info("WebDAV service registered at path: %s/ "% directory) + _logger.info("WebDAV service registered at path: %s/ ", directory) if not (config.get_misc('webdav', 'no_root_hack', False)): # Now, replace the static http handler with the dav-enabled one. @@ -595,7 +590,7 @@ try: reg_http_service('/', DAVStaticHandler) except Exception, e: - logging.getLogger('webdav').error('Cannot launch webdav: %s' % e) + _logger.error('Cannot launch webdav: %s', e) def init_well_known(): @@ -639,9 +634,9 @@ def init_principals_redirect(): if dbname: PrincipalsRedirect.redirect_paths[''] = '/webdav/%s/principals' % dbname reg_http_service('/principals', PrincipalsRedirect) - logging.getLogger("web-services").info( - "Registered HTTP redirect handler for /principals to the %s db.", - dbname) + _logger.info( + "Registered HTTP redirect handler for /principals to the %s db.", + dbname) init_principals_redirect() From 85f0ad1ea87f017a375d187d6d92cbdfffba61c7 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 24 Jan 2012 16:57:59 +0100 Subject: [PATCH 002/154] [IMP] document_webdav.webdav_server: remove the so called `uniform log handling` of the HttpLogHandler class. bzr revid: vmt@openerp.com-20120124155759-6g40dmhz6ywk9xe9 --- addons/document_webdav/dav_fs.py | 57 +++++++++++++++--------------- addons/document_webdav/redirect.py | 10 +++--- 2 files changed, 34 insertions(+), 33 deletions(-) diff --git a/addons/document_webdav/dav_fs.py b/addons/document_webdav/dav_fs.py index 772b7600f20..a292019eeab 100644 --- a/addons/document_webdav/dav_fs.py +++ b/addons/document_webdav/dav_fs.py @@ -175,7 +175,7 @@ class openerp_dav_handler(dav_interface): def get_propnames(self, uri): props = self.PROPS - self.parent.log_message('get propnames: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get propnames: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not dbname: if cr: cr.close() @@ -203,21 +203,21 @@ class openerp_dav_handler(dav_interface): except NotImplementedError, e: if cr: cr.close() import traceback - self.parent.log_error("Cannot %s: %s", opname, str(e)) - self.parent.log_message("Exc: %s",traceback.format_exc()) + _logger.warning("Cannot %s: %s", opname, str(e)) + _logger.log(netsvc.logging.DEBUG_RPC, "Exc: %s" % traceback.format_exc()) # see par 9.3.1 of rfc raise DAV_Error(403, str(e) or 'Not supported at this path') except EnvironmentError, err: if cr: cr.close() import traceback - self.parent.log_error("Cannot %s: %s", opname, err.strerror) - self.parent.log_message("Exc: %s",traceback.format_exc()) + _logger.warning("Cannot %s: %s", opname, err.strerror) + _logger.log(netsvc.logging.DEBUG_RPC, "Exc: %s" % traceback.format_exc()) raise default_exc(err.strerror) except Exception, e: import traceback if cr: cr.close() - self.parent.log_error("Cannot %s: %s", opname, str(e)) - self.parent.log_message("Exc: %s",traceback.format_exc()) + _logger.warning("Cannot %s: %s", opname, str(e)) + _logger.log(netsvc.logging.DEBUG_RPC, "Exc: %s" % traceback.format_exc()) raise default_exc("Operation failed") def _get_dav_lockdiscovery(self, uri): @@ -245,7 +245,7 @@ class openerp_dav_handler(dav_interface): def prep_http_options(self, uri, opts): """see HttpOptions._prep_OPTIONS """ - self.parent.log_message('get options: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get options: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) if not dbname: @@ -268,7 +268,7 @@ class openerp_dav_handler(dav_interface): ret[key] = [] ret[key].extend(val) - self.parent.log_message('options: %s' % ret) + _logger.log(netsvc.logging.DEBUG_RPC, 'options: %s' % ret) else: ret = opts cr.close() @@ -369,7 +369,7 @@ class openerp_dav_handler(dav_interface): if res and len(res): self.db_name_list.append(db_name) except Exception, e: - self.parent.log_error("Exception in db list: %s" % e) + _logger.warning("Exception in db list: %s", e) finally: if cr: cr.close() @@ -377,7 +377,7 @@ class openerp_dav_handler(dav_interface): def get_childs(self,uri, filters=None): """ return the child objects as self.baseuris for the given URI """ - self.parent.log_message('get children: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get children: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri, allow_last=True) if not dbname: @@ -394,7 +394,7 @@ class openerp_dav_handler(dav_interface): fp = node.full_path() if fp and len(fp): fp = '/'.join(fp) - self.parent.log_message('children for: %s' % fp) + _logger.log(netsvc.logging.DEBUG_RPC, 'children for: %s' % fp) else: fp = None domain = None @@ -420,13 +420,13 @@ class openerp_dav_handler(dav_interface): if turi.startswith(ul): result.append( turi[len(self.parent.davpath):]) else: - self.parent.log_error("ignore href %s because it is not under request path %s", turi, ul) + _logger.warning("ignore href %s because it is not under request path %s", turi, ul) return result # We don't want to continue with the children found below # Note the exceptions and that 'finally' will close the # cursor for d in node.children(cr, domain): - self.parent.log_message('child: %s' % d.path) + _logger.log(netsvc.logging.DEBUG_RPC, 'child: %s' % d.path) if fp: result.append( self.urijoin(dbname,fp,d.path) ) else: @@ -434,7 +434,7 @@ class openerp_dav_handler(dav_interface): except DAV_Error: raise except Exception, e: - self.parent.log_error("cannot get_children: "+ str(e)) + _logger.warning("cannot get_children: "+ str(e)) raise finally: if cr: cr.close() @@ -479,7 +479,7 @@ class openerp_dav_handler(dav_interface): return pool.get('document.directory').get_object(cr, uid, uri, context=context) def get_data(self,uri, rrange=None): - self.parent.log_message('GET: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'GET: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) try: if not dbname: @@ -499,7 +499,7 @@ class openerp_dav_handler(dav_interface): start = 0 assert start >= 0 if end and end < start: - self.parent.log_error("Invalid range for data: %s-%s" %(start, end)) + _logger.warning("Invalid range for data: %s-%s" %(start, end)) raise DAV_Error(416, "Invalid range for data") if end: if end >= res.size(): @@ -514,12 +514,12 @@ class openerp_dav_handler(dav_interface): # says we'd better just return 200 OK with empty data return '' except IndexError,e : - self.parent.log_error("GET IndexError: %s", str(e)) + _logger.warning("GET IndexError: %s", str(e)) raise DAV_NotFound2(uri2) except Exception,e: import traceback - self.parent.log_error("GET exception: %s",str(e)) - self.parent.log_message("Exc: %s", traceback.format_exc()) + _logger.warning("GET exception: %s",str(e)) + _logger.log(netsvc.logging.DEBUG_RPC, "Exc: %s" % traceback.format_exc()) raise DAV_Error, 409 return res finally: @@ -528,7 +528,7 @@ class openerp_dav_handler(dav_interface): @memoize(CACHE_SIZE) def _get_dav_resourcetype(self, uri): """ return type of object """ - self.parent.log_message('get RT: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get RT: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) try: if not dbname: @@ -546,7 +546,7 @@ class openerp_dav_handler(dav_interface): if cr: cr.close() def _get_dav_displayname(self,uri): - self.parent.log_message('get DN: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get DN: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not dbname: if cr: cr.close() @@ -565,7 +565,7 @@ class openerp_dav_handler(dav_interface): @memoize(CACHE_SIZE) def _get_dav_getcontentlength(self, uri): """ return the content length of an object """ - self.parent.log_message('get length: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get length: %s' % uri) result = 0 cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not dbname: @@ -582,7 +582,7 @@ class openerp_dav_handler(dav_interface): @memoize(CACHE_SIZE) def _get_dav_getetag(self,uri): """ return the ETag of an object """ - self.parent.log_message('get etag: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get etag: %s' % uri) result = 0 cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not dbname: @@ -638,7 +638,7 @@ class openerp_dav_handler(dav_interface): @memoize(CACHE_SIZE) def _get_dav_getcontenttype(self,uri): - self.parent.log_message('get contenttype: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'get contenttype: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not dbname: if cr: cr.close() @@ -657,7 +657,7 @@ class openerp_dav_handler(dav_interface): """ create a new collection see par. 9.3 of rfc4918 """ - self.parent.log_message('MKCOL: %s' % uri) + _logger.log(netsvc.logging.DEBUG_RPC, 'MKCOL: %s' % uri) cr, uid, pool, dbname, uri2 = self.get_cr(uri) if not uri2[-1]: if cr: cr.close() @@ -681,7 +681,8 @@ class openerp_dav_handler(dav_interface): def put(self, uri, data, content_type=None): """ put the object into the filesystem """ - self.parent.log_message('Putting %s (%d), %s'%( misc.ustr(uri), data and len(data) or 0, content_type)) + _logger.log(netsvc.logging.DEBUG_RPC, 'Putting %s (%d), %s' % \ + (misc.ustr(uri), data and len(data) or 0, content_type)) cr, uid, pool,dbname, uri2 = self.get_cr(uri) if not dbname: if cr: cr.close() @@ -723,7 +724,7 @@ class openerp_dav_handler(dav_interface): try: etag = str(newchild.get_etag(cr)) except Exception, e: - self.parent.log_error("Cannot get etag for node: %s" % e) + _logger.warning("Cannot get etag for node: %s", e) ret = (str(hurl), etag) else: self._try_function(node.set_data, (cr, data), "save %s" % objname, cr=cr) diff --git a/addons/document_webdav/redirect.py b/addons/document_webdav/redirect.py index 7bc0883f9e8..7d04ffb51f5 100644 --- a/addons/document_webdav/redirect.py +++ b/addons/document_webdav/redirect.py @@ -23,10 +23,10 @@ import logging import urlparse from service.websrv_lib import FixSendError, HTTPHandler, HttpOptions -from service.http_server import HttpLogHandler -class RedirectHTTPHandler(HttpLogHandler, FixSendError, HttpOptions, HTTPHandler): - _logger = logging.getLogger('httpd.well-known') +_logger = logging.getLogger(__name__) + +class RedirectHTTPHandler(FixSendError, HttpOptions, HTTPHandler): _HTTP_OPTIONS = { 'Allow': ['OPTIONS', 'GET', 'HEAD', 'PROPFIND'] } redirect_paths = {} @@ -62,7 +62,7 @@ class RedirectHTTPHandler(HttpLogHandler, FixSendError, HttpOptions, HTTPHandler try: addr, port = self.request.getsockname() except Exception, e: - self.log_error("Cannot calculate own address:" , e) + _logger.error("Cannot calculate own address:", e) if self.headers.has_key('Host'): uparts = list(urlparse.urlparse("%s://%s:%d"% (server_proto, addr,port))) @@ -80,7 +80,7 @@ class RedirectHTTPHandler(HttpLogHandler, FixSendError, HttpOptions, HTTPHandler self.send_header("Content-Length", 0) self.end_headers() # Do we need a Cache-content: header here? - self._logger.debug("redirecting %s to %s", self.path, redir_path) + _logger.debug("redirecting %s to %s", self.path, redir_path) return None def do_PROPFIND(self): From 7c4e08eb46a20e37ac490e6c2d4b916d56b8f63b Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Tue, 24 Jan 2012 17:28:50 +0100 Subject: [PATCH 003/154] [IMP] account,document: changed from class __logger to module _logger. bzr revid: vmt@openerp.com-20120124162850-qr1or3piq9f91c7u --- addons/account/installer.py | 5 +++-- addons/document/content_index.py | 16 ++++++++-------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/addons/account/installer.py b/addons/account/installer.py index d1b19ef4319..a9122adf488 100644 --- a/addons/account/installer.py +++ b/addons/account/installer.py @@ -31,10 +31,11 @@ from osv import fields, osv import netsvc import tools +_logger = logging.getLogger(__name__) + class account_installer(osv.osv_memory): _name = 'account.installer' _inherit = 'res.config.installer' - __logger = logging.getLogger(_name) def _get_charts(self, cr, uid, context=None): modules = self.pool.get('ir.module.module') @@ -142,7 +143,7 @@ class account_installer(osv.osv_memory): cr, uid, ids, context=context) chart = self.read(cr, uid, ids, ['charts'], context=context)[0]['charts'] - self.__logger.debug('Installing chart of accounts %s', chart) + _logger.debug('Installing chart of accounts %s', chart) return modules | set([chart]) account_installer() diff --git a/addons/document/content_index.py b/addons/document/content_index.py index 64b480ee736..3cb408428c9 100644 --- a/addons/document/content_index.py +++ b/addons/document/content_index.py @@ -23,10 +23,11 @@ import os import tempfile from subprocess import Popen, PIPE +_logger = logging.getLogger(__name__) + class NhException(Exception): pass - class indexer(object): """ An indexer knows how to parse the content of some file. @@ -116,7 +117,6 @@ def mime_match(mime, mdict): return (None, None) class contentIndex(object): - __logger = logging.getLogger('addons.document.content_index') def __init__(self): self.mimes = {} self.exts = {} @@ -132,7 +132,7 @@ class contentIndex(object): f = True if f: - self.__logger.debug('Register content indexer: %r', obj) + _logger.debug('Register content indexer: %r', obj) if not f: raise Exception("Your indexer should at least suport a mimetype or extension") @@ -169,22 +169,22 @@ class contentIndex(object): (result, _) = pop.communicate() mime2 = result.split(';')[0] - self.__logger.debug('File gave us: %s', mime2) + _logger.debug('File gave us: %s', mime2) # Note that the temporary file still exists now. mime,fobj = mime_match(mime2, self.mimes) if not mime: mime = mime2 except Exception: - self.__logger.exception('Cannot determine mime type') + _logger.exception('Cannot determine mime type') try: if fobj: res = (mime, fobj.indexContent(content,filename,fname or realfname) ) else: - self.__logger.debug("Have no object, return (%s, None)", mime) + _logger.debug("Have no object, return (%s, None)", mime) res = (mime, None ) except Exception: - self.__logger.exception("Could not index file %s (%s)", + _logger.exception("Could not index file %s (%s)", filename, fname or realfname) res = None @@ -193,7 +193,7 @@ class contentIndex(object): try: os.unlink(fname) except Exception: - self.__logger.exception("Could not unlink %s", fname) + _logger.exception("Could not unlink %s", fname) return res From 57b41aae43f0f2626f08e3e212aad4bab0394d42 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 25 Jan 2012 10:44:51 +0100 Subject: [PATCH 004/154] [IMP] logging: use logging instead of netsvc, use module __name__ instead of something else. bzr revid: vmt@openerp.com-20120125094451-a6mejmnaxa2vp1bu --- addons/account/account.py | 20 +- .../report/bank_statement_balance_report.py | 4 - addons/account_coda/account_coda.py | 5 +- .../wizard/account_coda_import.py | 26 +- addons/account_payment/account_payment.py | 7 +- .../wizard/wizard_tech_guide_rst.py | 25 +- .../base_module_quality.py | 21 +- addons/document/document.py | 6 +- addons/document/document_directory.py | 7 +- addons/document/document_storage.py | 63 ++- addons/document/nodes.py | 24 +- addons/document/std_index.py | 7 +- addons/document_ftp/ftpserver/__init__.py | 10 +- addons/edi/__init__.py | 2 +- addons/edi/edi_service.py | 2 +- addons/edi/models/edi.py | 6 +- addons/edi/models/res_partner.py | 6 +- addons/fetchmail/fetchmail.py | 14 +- addons/import_base/import_framework.py | 15 +- addons/l10n_be_invoice_bba/invoice.py | 433 +++++++++--------- addons/l10n_be_invoice_bba/partner.py | 5 +- addons/l10n_multilang/l10n_multilang.py | 13 +- addons/mail/mail_message.py | 2 +- addons/mail/mail_thread.py | 3 - addons/project_messages/project_messages.py | 2 - addons/report_webkit/webkit_report.py | 11 +- addons/stock/stock.py | 6 +- 27 files changed, 369 insertions(+), 376 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 432a90a653e..2b1834002e7 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -19,17 +19,19 @@ # ############################################################################## -import time from datetime import datetime from dateutil.relativedelta import relativedelta +import logging from operator import itemgetter +import time -import netsvc -import pooler -from osv import fields, osv import decimal_precision as dp +from osv import fields, osv +import pooler from tools.translate import _ +_logger = logging.getLogger(__name__) + def check_cycle(self, cr, uid, ids, context=None): """ climbs the ``self._table.parent_id`` chains for 100 levels or until it can't find any more parent(s) @@ -212,7 +214,6 @@ class account_account(osv.osv): _name = "account.account" _description = "Account" _parent_store = True - logger = netsvc.Logger() def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False): @@ -295,8 +296,7 @@ class account_account(osv.osv): if aml_query.strip(): wheres.append(aml_query.strip()) filters = " AND ".join(wheres) - self.logger.notifyChannel('addons.'+self._name, netsvc.LOG_DEBUG, - 'Filters: %s'%filters) + _logger.debug('Filters: %s', filters) # IN might not work ideally in case there are too many # children_and_consolidated, in that case join on a # values() e.g.: @@ -312,8 +312,7 @@ class account_account(osv.osv): " GROUP BY l.account_id") params = (tuple(children_and_consolidated),) + query_params cr.execute(request, params) - self.logger.notifyChannel('addons.'+self._name, netsvc.LOG_DEBUG, - 'Status: %s'%cr.statusmessage) + _logger.debug('Status: %s', cr.statusmessage) for res in cr.dictfetchall(): accounts[res['id']] = res @@ -2083,8 +2082,7 @@ class account_tax(osv.osv): } def compute(self, cr, uid, taxes, price_unit, quantity, address_id=None, product=None, partner=None): - logger = netsvc.Logger() - logger.notifyChannel("warning", netsvc.LOG_WARNING, + _logger.warning( "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included") return self._compute(cr, uid, taxes, price_unit, quantity, address_id, product, partner) diff --git a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py index 8e1e4b09e47..50b5bcd8d36 100644 --- a/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py +++ b/addons/account_bank_statement_extensions/report/bank_statement_balance_report.py @@ -22,14 +22,10 @@ import time from report import report_sxw -import pooler -import netsvc -logger=netsvc.Logger() class bank_statement_balance_report(report_sxw.rml_parse): def set_context(self, objects, data, ids, report_type=None): - #logger.notifyChannel('addons.'+__name__, netsvc.LOG_WARNING, 'set_context, objects = %s, data = %s, ids = %s' % (objects, data, ids)) cr = self.cr uid = self.uid context = self.context diff --git a/addons/account_coda/account_coda.py b/addons/account_coda/account_coda.py index f967669b98e..b4723794578 100644 --- a/addons/account_coda/account_coda.py +++ b/addons/account_coda/account_coda.py @@ -21,11 +21,10 @@ ############################################################################## import time -from osv import osv, fields + import decimal_precision as dp -import netsvc +from osv import osv, fields from tools.translate import _ -logger=netsvc.Logger() class coda_bank_account(osv.osv): _name= 'coda.bank.account' diff --git a/addons/account_coda/wizard/account_coda_import.py b/addons/account_coda/wizard/account_coda_import.py index 02e72bc3562..ac9a623e2fc 100644 --- a/addons/account_coda/wizard/account_coda_import.py +++ b/addons/account_coda/wizard/account_coda_import.py @@ -20,15 +20,16 @@ # ############################################################################## -import time import base64 +import re +from sys import exc_info +import time +from traceback import format_exception + from osv import fields,osv from tools.translate import _ -import netsvc -import re -from traceback import format_exception -from sys import exc_info -logger=netsvc.Logger() + +_logger = logging.getLogger(__name__) class account_coda_import(osv.osv_memory): _name = 'account.coda.import' @@ -816,7 +817,6 @@ class account_coda_import(osv.osv_memory): ttype = line['type'] == 'supplier' and 'payment' or 'receipt', date = line['val_date'], context = context) - #logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, 'voucher_dict = %s' % voucher_dict) voucher_line_vals = False if voucher_dict['value']['line_ids']: for line_dict in voucher_dict['value']['line_ids']: @@ -889,22 +889,22 @@ class account_coda_import(osv.osv_memory): nb_err += 1 err_string += _('\nError ! ') + str(e) tb = ''.join(format_exception(*exc_info())) - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'Application Error while processing Statement %s\n%s' % (statement.get('name', '/'),tb)) + _logger.error('Application Error while processing Statement %s\n%s', + statement.get('name', '/'), tb) except Exception, e: cr.rollback() nb_err += 1 err_string += _('\nSystem Error : ') + str(e) tb = ''.join(format_exception(*exc_info())) - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'System Error while processing Statement %s\n%s' % (statement.get('name', '/'),tb)) + _logger.error('System Error while processing Statement %s\n%s', + statement.get('name', '/'), tb) except : cr.rollback() nb_err += 1 err_string = _('\nUnknown Error : ') + str(e) tb = ''.join(format_exception(*exc_info())) - logger.notifyChannel('addons.'+self._name, netsvc.LOG_ERROR, - 'Unknown Error while processing Statement %s\n%s' % (statement.get('name', '/'),tb)) + _logger.error('Unknown Error while processing Statement %s\n%s', + statement.get('name', '/'), tb) # end 'for statement in coda_statements' diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 1de715dc777..11d4f98af8f 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -19,11 +19,14 @@ # ############################################################################## +import logging import time from osv import osv, fields import netsvc +_logger = logging.getLogger(__name__) + class payment_mode(osv.osv): _name= 'payment.mode' _description= 'Payment Mode' @@ -70,9 +73,7 @@ class payment_order(osv.osv): #dead code def get_wizard(self, type): - logger = netsvc.Logger() - logger.notifyChannel("warning", netsvc.LOG_WARNING, - "No wizard found for the payment type '%s'." % type) + _logger.warning("No wizard found for the payment type '%s'.", type) return None def _total(self, cursor, user, ids, name, args, context=None): diff --git a/addons/base_module_doc_rst/wizard/wizard_tech_guide_rst.py b/addons/base_module_doc_rst/wizard/wizard_tech_guide_rst.py index 39933c39a3e..9f4c75918b9 100644 --- a/addons/base_module_doc_rst/wizard/wizard_tech_guide_rst.py +++ b/addons/base_module_doc_rst/wizard/wizard_tech_guide_rst.py @@ -18,17 +18,18 @@ # along with this program. If not, see . # ############################################################################## -from os.path import join import base64 -import tempfile -import tarfile import httplib +import logging +import os +from os.path import join +import tarfile +import tempfile -import netsvc import wizard import pooler -import os -import tools + +_logger = logging.getLogger(__name__) choose_file_form = '''
@@ -99,9 +100,8 @@ class RstDoc(object): if res.status in (200, ): status_good = True except (Exception, ), e: - logger = netsvc.Logger() msg = "error connecting to server '%s' with link '%s'. Error message: %s" % (server, link, str(e)) - logger.notifyChannel("base_module_doc_rst", netsvc.LOG_ERROR, msg) + _logger.error(msg) status_good = False return status_good @@ -241,9 +241,8 @@ class RstDoc(object): def _write_objects(self): def write_field(field_def): if not isinstance(field_def, tuple): - logger = netsvc.Logger() msg = "Error on Object %s: field_def: %s [type: %s]" % (obj_name.encode('utf8'), field_def.encode('utf8'), type(field_def)) - logger.notifyChannel("base_module_doc_rst", netsvc.LOG_ERROR, msg) + _logger.error(msg) return "" field_name = field_def[0] @@ -392,9 +391,8 @@ class wizard_tech_guide_rst(wizard.interface): try: os.unlink(tgz_tmp_filename) except Exception, e: - logger = netsvc.Logger() msg = "Temporary file %s could not be deleted. (%s)" % (tgz_tmp_filename, e) - logger.notifyChannel("warning", netsvc.LOG_WARNING, msg) + _logger.warning(msg) return { 'rst_file': base64.encodestring(out), @@ -483,9 +481,8 @@ class wizard_tech_guide_rst(wizard.interface): res = modobj.fields_get(cr, uid).items() return res else: - logger = netsvc.Logger() msg = "Object %s not found" % (obj) - logger.notifyChannel("base_module_doc_rst", netsvc.LOG_ERROR, msg) + _logger.error(msg) return "" states = { diff --git a/addons/base_module_quality/base_module_quality.py b/addons/base_module_quality/base_module_quality.py index bbe20bc0b4f..76a9214c10d 100644 --- a/addons/base_module_quality/base_module_quality.py +++ b/addons/base_module_quality/base_module_quality.py @@ -25,6 +25,9 @@ from tools.translate import _ from osv import osv, fields import logging import addons + +_logger = logging.getLogger(__name__) + class abstract_quality_check(object): ''' This Class is abstract class for all test @@ -78,7 +81,6 @@ class abstract_quality_check(object): #This variable used to give message if test result is good or not self.message = '' - self.log = logging.getLogger('module.quality') #The tests have to subscribe itselfs in this list, that contains #all the test that have to be performed. @@ -108,11 +110,11 @@ class abstract_quality_check(object): model_data = pool.get('ir.model.data').browse(cr, uid, ids2) for model in model_data: model_list.append(model.res_id) - self.log.debug('get_objects() model_list: %s', ','.join(map(str, model_list))) + _logger.debug('get_objects() model_list: %s', ','.join(map(str, model_list))) obj_list = [] for mod in pool.get('ir.model').browse(cr, uid, model_list): obj_list.append(str(mod.model)) - self.log.debug('get_objects() obj_list: %s', ','.join(obj_list)) + _logger.debug('get_objects() obj_list: %s', ','.join(obj_list)) return obj_list def get_model_ids(self, cr, uid, models=[]): @@ -120,7 +122,7 @@ class abstract_quality_check(object): if not models: return [] pool = pooler.get_pool(cr.dbname) - self.log.debug('get_model_ids([%s])', ', '.join(models)) + _logger.debug('get_model_ids([%s])', ', '.join(models)) return pool.get('ir.model').search(cr, uid, [('model', 'in', models)]) def get_ids(self, cr, uid, object_list): @@ -211,7 +213,6 @@ class module_quality_check(osv.osv): So here the detail result is in html format and summary will be in text_wiki format. ''' pool = pooler.get_pool(cr.dbname) - log = logging.getLogger('module.quality') obj_module = pool.get('ir.module.module') if not module_state: module_id = obj_module.search(cr, uid, [('name', '=', module_name)]) @@ -223,14 +224,14 @@ class module_quality_check(osv.osv): ponderation_sum = 0.0 create_ids = [] module_path = addons.get_module_path(module_name) - log.info('Performing quality tests for %s', module_name) + _logger.info('Performing quality tests for %s', module_name) for test in abstract_obj.tests: val = test.quality_test() if not val.active: - log.info('Skipping inactive step %s for %s', val.name, module_name) + _logger.info('Skipping inactive step %s for %s', val.name, module_name) continue - log.info('Performing step %s for %s', val.name, module_name) + _logger.info('Performing step %s for %s', val.name, module_name) # Get a separate cursor per test, so that an SQL error in one # will not block the others. cr2 = pooler.get_db(cr.dbname).cursor() @@ -269,9 +270,9 @@ class module_quality_check(osv.osv): 'summary': _("The module has to be installed before running this test.") } create_ids.append((0, 0, data)) - log.info('Finished quality test step') + _logger.info('Finished quality test step') except Exception, e: - log.exception("Could not finish test step %s due to %s", val.name, e) + _logger.exception("Could not finish test step %s due to %s", val.name, e) finally: cr2.rollback() cr2.close() diff --git a/addons/document/document.py b/addons/document/document.py index 9ea7f97a321..e6fe4cde13d 100644 --- a/addons/document/document.py +++ b/addons/document/document.py @@ -30,6 +30,8 @@ from tools.translate import _ import nodes import logging +_logger = logging.getLogger(__name__) + DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config['root_path'], 'filestore')) class document_file(osv.osv): @@ -54,7 +56,7 @@ class document_file(osv.osv): parent_id = self.pool.get('document.directory')._get_root_directory(cr,uid) if not parent_id: - logging.getLogger('document').warning("at _attach_parent_id(), still not able to set the parent!") + _logger.warning("at _attach_parent_id(), still not able to set the parent!") return False if ids is not None: @@ -339,7 +341,7 @@ class document_file(osv.osv): if r: unres.append(r) else: - logging.getLogger('document').warning("Unlinking attachment #%s %s that has no storage", + _logger.warning("Unlinking attachment #%s %s that has no storage", f.id, f.name) res = super(document_file, self).unlink(cr, uid, ids, context) stor.do_unlink(cr, uid, unres) diff --git a/addons/document/document_directory.py b/addons/document/document_directory.py index d09d2cc86d5..787888cd4ee 100644 --- a/addons/document/document_directory.py +++ b/addons/document/document_directory.py @@ -19,6 +19,7 @@ # ############################################################################## +import logging from osv import osv, fields from osv.orm import except_orm @@ -26,6 +27,8 @@ from osv.orm import except_orm import nodes from tools.translate import _ +_logger = logging.getLogger(__name__) + class document_directory(osv.osv): _name = 'document.directory' _description = 'Directory' @@ -78,9 +81,7 @@ class document_directory(osv.osv): root_id = objid.read(cr, uid, mid, ['res_id'])['res_id'] return root_id except Exception, e: - import netsvc - logger = netsvc.Logger() - logger.notifyChannel("document", netsvc.LOG_WARNING, 'Cannot set directory root:'+ str(e)) + _logger.warning('Cannot set directory root:' + str(e)) return False return objid.browse(cr, uid, mid, context=context).res_id diff --git a/addons/document/document_storage.py b/addons/document/document_storage.py index fe757e7876d..577ea84f112 100644 --- a/addons/document/document_storage.py +++ b/addons/document/document_storage.py @@ -41,6 +41,8 @@ import pooler import nodes from content_index import cntIndex +_logger = logging.getLogger(__name__) + DMS_ROOT_PATH = tools.config.get('document_path', os.path.join(tools.config.get('root_path'), 'filestore')) @@ -130,7 +132,7 @@ class nodefd_file(nodes.node_descriptor): mime, icont = cntIndex.doIndex(None, filename=filename, content_type=None, realfname=fname) except Exception: - logging.getLogger('document.storage').debug('Cannot index file:', exc_info=True) + _logger.debug('Cannot index file:', exc_info=True) pass try: @@ -150,7 +152,7 @@ class nodefd_file(nodes.node_descriptor): cr.commit() cr.close() except Exception: - logging.getLogger('document.storage').warning('Cannot save file indexed content:', exc_info=True) + _logger.warning('Cannot save file indexed content:', exc_info=True) elif self.mode in ('a', 'a+' ): try: @@ -164,7 +166,7 @@ class nodefd_file(nodes.node_descriptor): cr.commit() cr.close() except Exception: - logging.getLogger('document.storage').warning('Cannot save file appended content:', exc_info=True) + _logger.warning('Cannot save file appended content:', exc_info=True) @@ -191,7 +193,7 @@ class nodefd_db(StringIO, nodes.node_descriptor): elif mode == 'a': StringIO.__init__(self, None) else: - logging.getLogger('document.storage').error("Incorrect mode %s specified", mode) + _logger.error("Incorrect mode %s specified", mode) raise IOError(errno.EINVAL, "Invalid file mode") self.mode = mode @@ -217,7 +219,7 @@ class nodefd_db(StringIO, nodes.node_descriptor): mime, icont = cntIndex.doIndex(data, filename=filename, content_type=None, realfname=None) except Exception: - logging.getLogger('document.storage').debug('Cannot index file:', exc_info=True) + _logger.debug('Cannot index file:', exc_info=True) pass try: @@ -241,7 +243,7 @@ class nodefd_db(StringIO, nodes.node_descriptor): (out, len(data), par.file_id)) cr.commit() except Exception: - logging.getLogger('document.storage').exception('Cannot update db file #%d for close:', par.file_id) + _logger.exception('Cannot update db file #%d for close:', par.file_id) raise finally: cr.close() @@ -271,7 +273,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor): elif mode == 'a': StringIO.__init__(self, None) else: - logging.getLogger('document.storage').error("Incorrect mode %s specified", mode) + _logger.error("Incorrect mode %s specified", mode) raise IOError(errno.EINVAL, "Invalid file mode") self.mode = mode @@ -297,7 +299,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor): mime, icont = cntIndex.doIndex(data, filename=filename, content_type=None, realfname=None) except Exception: - logging.getLogger('document.storage').debug('Cannot index file:', exc_info=True) + _logger.debug('Cannot index file:', exc_info=True) pass try: @@ -320,7 +322,7 @@ class nodefd_db64(StringIO, nodes.node_descriptor): (base64.encodestring(data), len(data), par.file_id)) cr.commit() except Exception: - logging.getLogger('document.storage').exception('Cannot update db file #%d for close:', par.file_id) + _logger.exception('Cannot update db file #%d for close:', par.file_id) raise finally: cr.close() @@ -339,7 +341,6 @@ class document_storage(osv.osv): """ _name = 'document.storage' _description = 'Storage Media' - _doclog = logging.getLogger('document') _columns = { 'name': fields.char('Name', size=64, required=True, select=1), @@ -401,8 +402,6 @@ class document_storage(osv.osv): # npath may contain empty elements, for root directory etc. npath = filter(lambda x: x is not None, npath) - # if self._debug: - # self._doclog.debug('Npath: %s', npath) for n in npath: if n == '..': raise ValueError("Invalid '..' element in path") @@ -413,7 +412,7 @@ class document_storage(osv.osv): dpath += npath[:-1] path = os.path.join(*dpath) if not os.path.isdir(path): - self._doclog.debug("Create dirs: %s", path) + _logger.debug("Create dirs: %s", path) os.makedirs(path) return path, npath @@ -451,7 +450,7 @@ class document_storage(osv.osv): # try to fix their directory. if mode in ('r','r+'): if ira.file_size: - self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) + _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) raise IOError(errno.ENOENT, 'No file can be located') else: store_fname = self.__get_random_fname(boo.path) @@ -493,7 +492,7 @@ class document_storage(osv.osv): # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: - self._doclog.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) + _logger.warning( "ir.attachment #%d does not have a filename, but is at filestore, fix it!" % ira.id) return None fpath = os.path.join(boo.path, ira.store_fname) return file(fpath, 'rb').read() @@ -517,7 +516,7 @@ class document_storage(osv.osv): # On a migrated db, some files may have the wrong storage type # try to fix their directory. if ira.file_size: - self._doclog.warning("ir.attachment #%d does not have a filename, trying the name." %ira.id) + _logger.warning("ir.attachment #%d does not have a filename, trying the name." %ira.id) # sfname = ira.name fpath = os.path.join(boo.path,ira.store_fname or ira.name) if os.path.exists(fpath): @@ -550,7 +549,7 @@ class document_storage(osv.osv): if boo.readonly: raise IOError(errno.EPERM, "Readonly medium") - self._doclog.debug( "Store data for ir.attachment #%d" % ira.id) + _logger.debug( "Store data for ir.attachment #%d" % ira.id) store_fname = None fname = None if boo.type == 'filestore': @@ -563,13 +562,13 @@ class document_storage(osv.osv): fp.write(data) finally: fp.close() - self._doclog.debug( "Saved data to %s" % fname) + _logger.debug( "Saved data to %s" % fname) filesize = len(data) # os.stat(fname).st_size # TODO Here, an old file would be left hanging. except Exception, e: - self._doclog.warning( "Couldn't save data to %s", path, exc_info=True) + _logger.warning( "Couldn't save data to %s", path, exc_info=True) raise except_orm(_('Error!'), str(e)) elif boo.type == 'db': filesize = len(data) @@ -592,12 +591,12 @@ class document_storage(osv.osv): fp.write(data) finally: fp.close() - self._doclog.debug("Saved data to %s", fname) + _logger.debug("Saved data to %s", fname) filesize = len(data) # os.stat(fname).st_size store_fname = os.path.join(*npath) # TODO Here, an old file would be left hanging. except Exception,e : - self._doclog.warning("Couldn't save data:", exc_info=True) + _logger.warning("Couldn't save data:", exc_info=True) raise except_orm(_('Error!'), str(e)) elif boo.type == 'virtual': @@ -616,7 +615,7 @@ class document_storage(osv.osv): mime, icont = cntIndex.doIndex(data, ira.datas_fname, ira.file_type or None, fname) except Exception: - self._doclog.debug('Cannot index file:', exc_info=True) + _logger.debug('Cannot index file:', exc_info=True) pass try: @@ -633,7 +632,7 @@ class document_storage(osv.osv): file_node.content_type = mime return True except Exception, e : - self._doclog.warning("Couldn't save data:", exc_info=True) + _logger.warning("Couldn't save data:", exc_info=True) # should we really rollback once we have written the actual data? # at the db case (only), that rollback would be safe raise except_orm(_('Error at doc write!'), str(e)) @@ -671,9 +670,9 @@ class document_storage(osv.osv): try: os.unlink(fname) except Exception: - self._doclog.warning("Could not remove file %s, please remove manually.", fname, exc_info=True) + _logger.warning("Could not remove file %s, please remove manually.", fname, exc_info=True) else: - self._doclog.warning("Unknown unlink key %s" % ktype) + _logger.warning("Unknown unlink key %s" % ktype) return True @@ -703,9 +702,9 @@ class document_storage(osv.osv): fname = ira.store_fname if not fname: - self._doclog.warning("Trying to rename a non-stored file") + _logger.warning("Trying to rename a non-stored file") if fname != os.path.join(*npath): - self._doclog.warning("inconsistency in realstore: %s != %s" , fname, repr(npath)) + _logger.warning("inconsistency in realstore: %s != %s" , fname, repr(npath)) oldpath = os.path.join(path, npath[-1]) newpath = os.path.join(path, new_name) @@ -743,7 +742,7 @@ class document_storage(osv.osv): break par = par.parent_id if file_node.storage_id != psto: - self._doclog.debug('Cannot move file %r from %r to %r', file_node, file_node.parent, ndir_bro.name) + _logger.debug('Cannot move file %r from %r to %r', file_node, file_node.parent, ndir_bro.name) raise NotImplementedError('Cannot move files between storage media') if sbro.type in ('filestore', 'db', 'db64'): @@ -756,9 +755,9 @@ class document_storage(osv.osv): fname = ira.store_fname if not fname: - self._doclog.warning("Trying to rename a non-stored file") + _logger.warning("Trying to rename a non-stored file") if fname != os.path.join(*opath): - self._doclog.warning("inconsistency in realstore: %s != %s" , fname, repr(opath)) + _logger.warning("inconsistency in realstore: %s != %s" , fname, repr(opath)) oldpath = os.path.join(path, opath[-1]) @@ -766,12 +765,12 @@ class document_storage(osv.osv): npath = filter(lambda x: x is not None, npath) newdir = os.path.join(*npath) if not os.path.isdir(newdir): - self._doclog.debug("Must create dir %s", newdir) + _logger.debug("Must create dir %s", newdir) os.makedirs(newdir) npath.append(opath[-1]) newpath = os.path.join(*npath) - self._doclog.debug("Going to move %s from %s to %s", opath[-1], oldpath, newpath) + _logger.debug("Going to move %s from %s to %s", opath[-1], oldpath, newpath) shutil.move(oldpath, newpath) store_path = npath[1:] + [opath[-1],] diff --git a/addons/document/nodes.py b/addons/document/nodes.py index ee89f3d4c6c..15d23f11760 100644 --- a/addons/document/nodes.py +++ b/addons/document/nodes.py @@ -42,7 +42,7 @@ from StringIO import StringIO # root: if we are at the first directory of a ressource # -logger = logging.getLogger('doc2.nodes') +_logger = logging.getLogger(__name__) def _str2time(cre): """ Convert a string with time representation (from db) into time (float) @@ -328,7 +328,7 @@ class node_class(object): if self.DAV_M_NS.has_key(ns): prefix = self.DAV_M_NS[ns] else: - logger.debug('No namespace: %s ("%s")',ns, prop) + _logger.debug('No namespace: %s ("%s")',ns, prop) return None mname = prefix + "_" + prop.replace('-','_') @@ -341,7 +341,7 @@ class node_class(object): r = m(cr) return r except AttributeError: - logger.debug('Property %s not supported' % prop, exc_info=True) + _logger.debug('Property %s not supported' % prop, exc_info=True) return None def get_dav_resourcetype(self, cr): @@ -384,13 +384,13 @@ class node_class(object): def create_child(self, cr, path, data=None): """ Create a regular file under this node """ - logger.warning("Attempted to create a file under %r, not possible.", self) + _logger.warning("Attempted to create a file under %r, not possible.", self) raise IOError(errno.EPERM, "Not allowed to create files here") def create_child_collection(self, cr, objname): """ Create a child collection (directory) under self """ - logger.warning("Attempted to create a collection under %r, not possible.", self) + _logger.warning("Attempted to create a collection under %r, not possible.", self) raise IOError(errno.EPERM, "Not allowed to create folders here") def rm(self, cr): @@ -725,7 +725,7 @@ class node_dir(node_database): assert self.parent if self.parent != ndir_node: - logger.debug('Cannot move dir %r from %r to %r', self, self.parent, ndir_node) + _logger.debug('Cannot move dir %r from %r to %r', self, self.parent, ndir_node) raise NotImplementedError('Cannot move dir to another dir') ret = {} @@ -998,7 +998,7 @@ class node_res_obj(node_class): def get_dav_eprop_DEPR(self, cr, ns, prop): # Deprecated! if ns != 'http://groupdav.org/' or prop != 'resourcetype': - logger.warning("Who asked for %s:%s?" % (ns, prop)) + _logger.warning("Who asked for %s:%s?" % (ns, prop)) return None cntobj = self.context._dirobj.pool.get('document.directory.content') uid = self.context.uid @@ -1328,7 +1328,7 @@ class node_file(node_class): ret = {} if ndir_node and self.parent != ndir_node: if not (isinstance(self.parent, node_dir) and isinstance(ndir_node, node_dir)): - logger.debug('Cannot move file %r from %r to %r', self, self.parent, ndir_node) + _logger.debug('Cannot move file %r from %r to %r', self, self.parent, ndir_node) raise NotImplementedError('Cannot move files between dynamic folders') if not ndir_obj: @@ -1473,7 +1473,7 @@ class nodefd_content(StringIO, node_descriptor): elif mode == 'a': StringIO.__init__(self, None) else: - logging.getLogger('document.content').error("Incorrect mode %s specified", mode) + _logger.error("Incorrect mode %s specified", mode) raise IOError(errno.EINVAL, "Invalid file mode") self.mode = mode @@ -1499,7 +1499,7 @@ class nodefd_content(StringIO, node_descriptor): raise NotImplementedError cr.commit() except Exception: - logging.getLogger('document.content').exception('Cannot update db content #%d for close:', par.cnt_id) + _logger.exception('Cannot update db content #%d for close:', par.cnt_id) raise finally: cr.close() @@ -1526,7 +1526,7 @@ class nodefd_static(StringIO, node_descriptor): elif mode == 'a': StringIO.__init__(self, None) else: - logging.getLogger('document.nodes').error("Incorrect mode %s specified", mode) + _logger.error("Incorrect mode %s specified", mode) raise IOError(errno.EINVAL, "Invalid file mode") self.mode = mode @@ -1551,7 +1551,7 @@ class nodefd_static(StringIO, node_descriptor): raise NotImplementedError cr.commit() except Exception: - logging.getLogger('document.nodes').exception('Cannot update db content #%d for close:', par.cnt_id) + _logger.exception('Cannot update db content #%d for close:', par.cnt_id) raise finally: cr.close() diff --git a/addons/document/std_index.py b/addons/document/std_index.py index e153d018bf0..a3059bd8a76 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -26,6 +26,8 @@ import odt2txt import sys, zipfile, xml.dom.minidom import logging +_logger = logging.getLogger(__name__) + def _to_unicode(s): try: return s.decode('utf-8') @@ -101,9 +103,8 @@ class DocIndex(indexer): (data, _) = pop.communicate() return _to_unicode(data) except OSError: - logger = logging.getLogger('document.DocIndex') - logger.warn("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) - logger.debug("Trace of the failed file indexing attempt: ", exc_info=True) + _logger.warning("Failed attempt to execute antiword (MS Word reader). Antiword is necessary to index the file %s of MIME type %s. Detailed error available at DEBUG level.", fname, self._getMimeTypes()[0]) + _logger.debug("Trace of the failed file indexing attempt: ", exc_info=True) return False cntIndex.register(DocIndex()) diff --git a/addons/document_ftp/ftpserver/__init__.py b/addons/document_ftp/ftpserver/__init__.py index 2e09a938a05..11b041e074b 100644 --- a/addons/document_ftp/ftpserver/__init__.py +++ b/addons/document_ftp/ftpserver/__init__.py @@ -19,6 +19,7 @@ # ############################################################################## +import logging import threading import ftpserver import authorizer @@ -26,6 +27,8 @@ import abstracted_fs import netsvc from tools import config +_logger = logging.getLogger(__name__) + def start_server(): HOST = config.get('ftp_server_host', '127.0.0.1') PORT = int(config.get('ftp_server_port', '8021')) @@ -36,8 +39,7 @@ def start_server(): class ftp_server(threading.Thread): def log(self, level, message): - logger = netsvc.Logger() - logger.notifyChannel('FTP', level, message) + _logger.log(level, message) def run(self): autho = authorizer.authorizer() @@ -56,9 +58,9 @@ def start_server(): ftpd.serve_forever() if HOST.lower() == 'none': - netsvc.Logger().notifyChannel("FTP", netsvc.LOG_INFO, "\n Server FTP Not Started\n") + _logger.info("\n Server FTP Not Started\n") else: - netsvc.Logger().notifyChannel("FTP", netsvc.LOG_INFO, "\n Serving FTP on %s:%s\n" % (HOST, PORT)) + _logger.info(\n Serving FTP on %s:%s\n", HOST, PORT) ds = ftp_server() ds.daemon = True ds.start() diff --git a/addons/edi/__init__.py b/addons/edi/__init__.py index b4a80c0f1dd..70723aea361 100644 --- a/addons/edi/__init__.py +++ b/addons/edi/__init__.py @@ -28,7 +28,7 @@ from models.edi import EDIMixin, edi_document try: import controllers except ImportError: - logging.getLogger('init.load').warn( + logging.getLogger(__name__).warning( """Could not load openerp-web section of EDI, EDI will not behave correctly To fix, launch openerp-web in embedded mode""") diff --git a/addons/edi/edi_service.py b/addons/edi/edi_service.py index 074720a03e9..f48cc60950a 100644 --- a/addons/edi/edi_service.py +++ b/addons/edi/edi_service.py @@ -23,7 +23,7 @@ import logging import netsvc import openerp -_logger = logging.getLogger('edi.service') +_logger = logging.getLogger(__name__) class edi(netsvc.ExportService): diff --git a/addons/edi/models/edi.py b/addons/edi/models/edi.py index c573115618e..6f5a69af470 100644 --- a/addons/edi/models/edi.py +++ b/addons/edi/models/edi.py @@ -36,6 +36,8 @@ from osv import osv,fields,orm from tools.translate import _ from tools.safe_eval import safe_eval as eval +_logger = logging.getLogger(__name__) + EXTERNAL_ID_PATTERN = re.compile(r'^([^.:]+)(?::([^.]+))?\.(\S+)$') EDI_VIEW_WEB_URL = '%s/edi/view?debug=1&db=%s&token=%s' EDI_PROTOCOL_VERSION = 1 # arbitrary ever-increasing version number @@ -72,8 +74,6 @@ def last_update_for(record): return record_log.get('write_date') or record_log.get('create_date') or False return False -_logger = logging.getLogger('edi') - class edi_document(osv.osv): _name = 'edi.document' _description = 'EDI Document' @@ -682,4 +682,4 @@ class EDIMixin(object): return record_id -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/edi/models/res_partner.py b/addons/edi/models/res_partner.py index 7c40a5c7354..6ec511269b3 100644 --- a/addons/edi/models/res_partner.py +++ b/addons/edi/models/res_partner.py @@ -25,6 +25,8 @@ from edi import EDIMixin from openerp import SUPERUSER_ID from tools.translate import _ +_logger = logging.getLogger(__name__) + RES_PARTNER_ADDRESS_EDI_STRUCT = { 'name': True, 'email': True, @@ -72,7 +74,7 @@ class res_partner_address(osv.osv, EDIMixin): code, label = 'edi_generic', 'Generic Bank Type (auto-created for EDI)' bank_code_ids = res_partner_bank_type.search(cr, uid, [('code','=',code)], context=context) if not bank_code_ids: - logging.getLogger('edi.res_partner').info('Normal bank account type is missing, creating ' + _logger.info('Normal bank account type is missing, creating ' 'a generic bank account type for EDI.') self.res_partner_bank_type.create(cr, SUPERUSER_ID, {'name': label, 'code': label}) @@ -98,7 +100,7 @@ class res_partner_address(osv.osv, EDIMixin): bank_name, ext_bank_id, context=import_ctx) except osv.except_osv: # failed to import it, try again with unrestricted default type - logging.getLogger('edi.res_partner').warning('Failed to import bank account using' + _logger.warning('Failed to import bank account using' 'bank type: %s, ignoring', import_ctx['default_state'], exc_info=True) return address_id diff --git a/addons/fetchmail/fetchmail.py b/addons/fetchmail/fetchmail.py index d1e23f49166..51c6f147cff 100644 --- a/addons/fetchmail/fetchmail.py +++ b/addons/fetchmail/fetchmail.py @@ -39,7 +39,7 @@ from osv import osv, fields import tools from tools.translate import _ -logger = logging.getLogger('fetchmail') +_logger = logging.getLogger(__name__) class fetchmail_server(osv.osv): """Incoming POP/IMAP mail server account""" @@ -151,7 +151,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS connection = server.connect() server.write({'state':'done'}) except Exception, e: - logger.exception("Failed to connect to %s server %s", server.type, server.name) + _logger.exception("Failed to connect to %s server %s", server.type, server.name) raise osv.except_osv(_("Connection test failed!"), _("Here is what we got instead:\n %s") % tools.ustr(e)) finally: try: @@ -177,7 +177,7 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS mail_thread = self.pool.get('mail.thread') action_pool = self.pool.get('ir.actions.server') for server in self.browse(cr, uid, ids, context=context): - logger.info('start checking for new emails on %s server %s', server.type, server.name) + _logger.info('start checking for new emails on %s server %s', server.type, server.name) context.update({'fetchmail_server_id': server.id, 'server_type': server.type}) count = 0 if server.type == 'imap': @@ -196,9 +196,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS imap_server.store(num, '+FLAGS', '\\Seen') cr.commit() count += 1 - logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name) + _logger.info("fetched/processed %s email(s) on %s server %s", count, server.type, server.name) except Exception, e: - logger.exception("Failed to fetch mail from %s server %s", server.type, server.name) + _logger.exception("Failed to fetch mail from %s server %s", server.type, server.name) finally: if imap_server: imap_server.close() @@ -220,9 +220,9 @@ openerp_mailgate.py -u %(uid)d -p PASSWORD -o %(model)s -d %(dbname)s --host=HOS action_pool.run(cr, uid, [server.action_id.id], {'active_id': res_id, 'active_ids':[res_id]}) pop_server.dele(num) cr.commit() - logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name) + _logger.info("fetched/processed %s email(s) on %s server %s", numMsgs, server.type, server.name) except Exception, e: - logger.exception("Failed to fetch mail from %s server %s", server.type, server.name) + _logger.exception("Failed to fetch mail from %s server %s", server.type, server.name) finally: if pop_server: pop_server.quit() diff --git a/addons/import_base/import_framework.py b/addons/import_base/import_framework.py index 44243aa952c..2ae51fde6b5 100644 --- a/addons/import_base/import_framework.py +++ b/addons/import_base/import_framework.py @@ -29,11 +29,11 @@ import datetime import logging import StringIO import traceback + +_logger = logging.getLogger(__name__) + pp = pprint.PrettyPrinter(indent=4) - - - class import_framework(Thread): """ This class should be extends, @@ -60,7 +60,6 @@ class import_framework(Thread): self.context = context or {} self.email = email_to_notify self.table_list = [] - self.logger = logging.getLogger(module_name) self.initialize() """ @@ -165,7 +164,7 @@ class import_framework(Thread): data_i is a map external field_name => value and each data_i have a external id => in data_id['id'] """ - self.logger.info(' Importing %s into %s' % (table, model)) + _logger.info(' Importing %s into %s', table, model) if not datas: return (0, 'No data found') mapping['id'] = 'id_new' @@ -188,7 +187,7 @@ class import_framework(Thread): model_obj = self.obj.pool.get(model) if not model_obj: raise ValueError(_("%s is not a valid model name") % model) - self.logger.debug(_(" fields imported : ") + str(fields)) + _logger.debug(_(" fields imported : ") + str(fields)) (p, r, warning, s) = model_obj.import_data(self.cr, self.uid, fields, res, mode='update', current_module=self.module_name, noupdate=True, context=self.context) for (field, field_name) in self_dependencies: self._import_self_dependencies(model_obj, field, datas) @@ -431,9 +430,9 @@ class import_framework(Thread): 'auto_delete' : True}) email_obj.send(self.cr, self.uid, [email_id]) if error: - self.logger.error(_("Import failed due to an unexpected error")) + _logger.error(_("Import failed due to an unexpected error")) else: - self.logger.info(_("Import finished, notification email sended")) + _logger.info(_("Import finished, notification email sended")) def get_email_subject(self, result, error=False): """ diff --git a/addons/l10n_be_invoice_bba/invoice.py b/addons/l10n_be_invoice_bba/invoice.py index 997036c0cec..937e49e83a8 100644 --- a/addons/l10n_be_invoice_bba/invoice.py +++ b/addons/l10n_be_invoice_bba/invoice.py @@ -1,219 +1,218 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# OpenERP, Open Source Management Solution -# -# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. -# -# This program is free software: you can redistribute it and/or modify -# 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 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 . -# -############################################################################## - -import re, time, random -from osv import fields, osv -from tools.translate import _ -import netsvc -logger=netsvc.Logger() - -""" -account.invoice object: - - Add support for Belgian structured communication - - Rename 'reference' field labels to 'Communication' -""" - -class account_invoice(osv.osv): - _inherit = 'account.invoice' - - def _get_reference_type(self, cursor, user, context=None): - """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """ - res = super(account_invoice, self)._get_reference_type(cursor, user, - context=context) - res[[i for i,x in enumerate(res) if x[0] == 'none'][0]] = ('none', 'Free Communication') - res.append(('bba', 'BBA Structured Communication')) - #logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, 'reference_type = %s' %res ) - return res - - def check_bbacomm(self, val): - supported_chars = '0-9+*/ ' - pattern = re.compile('[^' + supported_chars + ']') - if pattern.findall(val or ''): - return False - bbacomm = re.sub('\D', '', val or '') - if len(bbacomm) == 12: - base = int(bbacomm[:10]) - mod = base % 97 or 97 - if mod == int(bbacomm[-2:]): - return True - return False - - def _check_communication(self, cr, uid, ids): - for inv in self.browse(cr, uid, ids): - if inv.reference_type == 'bba': - return self.check_bbacomm(inv.reference) - return True - - def onchange_partner_id(self, cr, uid, ids, type, partner_id, - date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): - result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, - date_invoice, payment_term, partner_bank_id, company_id) -# reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type'] -# logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, 'partner_id %s' % partner_id) - reference = False - reference_type = 'none' - if partner_id: - if (type == 'out_invoice'): - reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type - if reference_type: - algorithm = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_algorithm - if not algorithm: - algorithm = 'random' - reference = self.generate_bbacomm(cr, uid, ids, type, reference_type, algorithm, partner_id, '')['value']['reference'] - res_update = { - 'reference_type': reference_type or 'none', - 'reference': reference, - } - result['value'].update(res_update) - return result - - def generate_bbacomm(self, cr, uid, ids, type, reference_type, algorithm, partner_id, reference): - partner_obj = self.pool.get('res.partner') - reference = reference or '' - if (type == 'out_invoice'): - if reference_type == 'bba': - if not algorithm: - if partner_id: - algorithm = partner_obj.browse(cr, uid, partner_id).out_inv_comm_algorithm - if not algorithm: - if not algorithm: - algorithm = 'random' - if algorithm == 'date': - if not self.check_bbacomm(reference): - doy = time.strftime('%j') - year = time.strftime('%Y') - seq = '001' - seq_ids = self.search(cr, uid, - [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), - ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference') - if seq_ids: - prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15]) - if prev_seq < 999: - seq = '%03d' % (prev_seq + 1) - else: - raise osv.except_osv(_('Warning!'), - _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - bbacomm = doy + year + seq - base = int(bbacomm) - mod = base % 97 or 97 - reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod) - elif algorithm == 'partner_ref': - if not self.check_bbacomm(reference): - partner_ref = self.pool.get('res.partner').browse(cr, uid, partner_id).ref - partner_ref_nr = re.sub('\D', '', partner_ref or '') - if (len(partner_ref_nr) < 3) or (len(partner_ref_nr) > 7): - raise osv.except_osv(_('Warning!'), - _('The Partner should have a 3-7 digit Reference Number for the generation of BBA Structured Communications!' \ - '\nPlease correct the Partner record.')) - else: - partner_ref_nr = partner_ref_nr.ljust(7, '0') - seq = '001' - seq_ids = self.search(cr, uid, - [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), - ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference') - if seq_ids: - prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15]) - if prev_seq < 999: - seq = '%03d' % (prev_seq + 1) - else: - raise osv.except_osv(_('Warning!'), - _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - bbacomm = partner_ref_nr + seq - base = int(bbacomm) - mod = base % 97 or 97 - reference = '+++%s/%s/%s%02d+++' % (partner_ref_nr[:3], partner_ref_nr[3:], seq, mod) - elif algorithm == 'random': - if not self.check_bbacomm(reference): - base = random.randint(1, 9999999999) - bbacomm = str(base).rjust(7, '0') - base = int(bbacomm) - mod = base % 97 or 97 - mod = str(mod).rjust(2, '0') - reference = '+++%s/%s/%s%s+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) - else: - raise osv.except_osv(_('Error!'), - _("Unsupported Structured Communication Type Algorithm '%s' !" \ - "\nPlease contact your OpenERP support channel.") % algorithm) - return {'value': {'reference': reference}} - - def create(self, cr, uid, vals, context=None): - if vals.has_key('reference_type'): - reference_type = vals['reference_type'] - if reference_type == 'bba': - if vals.has_key('reference'): - bbacomm = vals['reference'] - else: - raise osv.except_osv(_('Warning!'), - _('Empty BBA Structured Communication!' \ - '\nPlease fill in a unique BBA Structured Communication.')) - if self.check_bbacomm(bbacomm): - reference = re.sub('\D', '', bbacomm) - vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' - same_ids = self.search(cr, uid, - [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), - ('reference', '=', vals['reference'])]) - if same_ids: - raise osv.except_osv(_('Warning!'), - _('The BBA Structured Communication has already been used!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - return super(account_invoice, self).create(cr, uid, vals, context=context) - - def write(self, cr, uid, ids, vals, context={}): - if isinstance(ids, (int, long)): - ids = [ids] - for inv in self.browse(cr, uid, ids, context): - if vals.has_key('reference_type'): - reference_type = vals['reference_type'] - else: - reference_type = inv.reference_type or '' - if reference_type == 'bba': - if vals.has_key('reference'): - bbacomm = vals['reference'] - else: - bbacomm = inv.reference or '' - if self.check_bbacomm(bbacomm): - reference = re.sub('\D', '', bbacomm) - vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' - same_ids = self.search(cr, uid, - [('id', '!=', inv.id), ('type', '=', 'out_invoice'), - ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])]) - if same_ids: - raise osv.except_osv(_('Warning!'), - _('The BBA Structured Communication has already been used!' \ - '\nPlease create manually a unique BBA Structured Communication.')) - return super(account_invoice, self).write(cr, uid, ids, vals, context) - - _columns = { - 'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."), - 'reference_type': fields.selection(_get_reference_type, 'Communication Type', - required=True), - } - - _constraints = [ - (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']), - ] - -account_invoice() +# -*- encoding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# +# Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. +# +# This program is free software: you can redistribute it and/or modify +# 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 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 . +# +############################################################################## + +import random +import re +import time + +from osv import fields, osv +from tools.translate import _ + +""" +account.invoice object: + - Add support for Belgian structured communication + - Rename 'reference' field labels to 'Communication' +""" + +class account_invoice(osv.osv): + _inherit = 'account.invoice' + + def _get_reference_type(self, cursor, user, context=None): + """Add BBA Structured Communication Type and change labels from 'reference' into 'communication' """ + res = super(account_invoice, self)._get_reference_type(cursor, user, + context=context) + res[[i for i,x in enumerate(res) if x[0] == 'none'][0]] = ('none', 'Free Communication') + res.append(('bba', 'BBA Structured Communication')) + return res + + def check_bbacomm(self, val): + supported_chars = '0-9+*/ ' + pattern = re.compile('[^' + supported_chars + ']') + if pattern.findall(val or ''): + return False + bbacomm = re.sub('\D', '', val or '') + if len(bbacomm) == 12: + base = int(bbacomm[:10]) + mod = base % 97 or 97 + if mod == int(bbacomm[-2:]): + return True + return False + + def _check_communication(self, cr, uid, ids): + for inv in self.browse(cr, uid, ids): + if inv.reference_type == 'bba': + return self.check_bbacomm(inv.reference) + return True + + def onchange_partner_id(self, cr, uid, ids, type, partner_id, + date_invoice=False, payment_term=False, partner_bank_id=False, company_id=False): + result = super(account_invoice, self).onchange_partner_id(cr, uid, ids, type, partner_id, + date_invoice, payment_term, partner_bank_id, company_id) +# reference_type = self.default_get(cr, uid, ['reference_type'])['reference_type'] + reference = False + reference_type = 'none' + if partner_id: + if (type == 'out_invoice'): + reference_type = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_type + if reference_type: + algorithm = self.pool.get('res.partner').browse(cr, uid, partner_id).out_inv_comm_algorithm + if not algorithm: + algorithm = 'random' + reference = self.generate_bbacomm(cr, uid, ids, type, reference_type, algorithm, partner_id, '')['value']['reference'] + res_update = { + 'reference_type': reference_type or 'none', + 'reference': reference, + } + result['value'].update(res_update) + return result + + def generate_bbacomm(self, cr, uid, ids, type, reference_type, algorithm, partner_id, reference): + partner_obj = self.pool.get('res.partner') + reference = reference or '' + if (type == 'out_invoice'): + if reference_type == 'bba': + if not algorithm: + if partner_id: + algorithm = partner_obj.browse(cr, uid, partner_id).out_inv_comm_algorithm + if not algorithm: + if not algorithm: + algorithm = 'random' + if algorithm == 'date': + if not self.check_bbacomm(reference): + doy = time.strftime('%j') + year = time.strftime('%Y') + seq = '001' + seq_ids = self.search(cr, uid, + [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), + ('reference', 'like', '+++%s/%s/%%' % (doy, year))], order='reference') + if seq_ids: + prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15]) + if prev_seq < 999: + seq = '%03d' % (prev_seq + 1) + else: + raise osv.except_osv(_('Warning!'), + _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \ + '\nPlease create manually a unique BBA Structured Communication.')) + bbacomm = doy + year + seq + base = int(bbacomm) + mod = base % 97 or 97 + reference = '+++%s/%s/%s%02d+++' % (doy, year, seq, mod) + elif algorithm == 'partner_ref': + if not self.check_bbacomm(reference): + partner_ref = self.pool.get('res.partner').browse(cr, uid, partner_id).ref + partner_ref_nr = re.sub('\D', '', partner_ref or '') + if (len(partner_ref_nr) < 3) or (len(partner_ref_nr) > 7): + raise osv.except_osv(_('Warning!'), + _('The Partner should have a 3-7 digit Reference Number for the generation of BBA Structured Communications!' \ + '\nPlease correct the Partner record.')) + else: + partner_ref_nr = partner_ref_nr.ljust(7, '0') + seq = '001' + seq_ids = self.search(cr, uid, + [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), + ('reference', 'like', '+++%s/%s/%%' % (partner_ref_nr[:3], partner_ref_nr[3:]))], order='reference') + if seq_ids: + prev_seq = int(self.browse(cr, uid, seq_ids[-1]).reference[12:15]) + if prev_seq < 999: + seq = '%03d' % (prev_seq + 1) + else: + raise osv.except_osv(_('Warning!'), + _('The daily maximum of outgoing invoices with an automatically generated BBA Structured Communications has been exceeded!' \ + '\nPlease create manually a unique BBA Structured Communication.')) + bbacomm = partner_ref_nr + seq + base = int(bbacomm) + mod = base % 97 or 97 + reference = '+++%s/%s/%s%02d+++' % (partner_ref_nr[:3], partner_ref_nr[3:], seq, mod) + elif algorithm == 'random': + if not self.check_bbacomm(reference): + base = random.randint(1, 9999999999) + bbacomm = str(base).rjust(7, '0') + base = int(bbacomm) + mod = base % 97 or 97 + mod = str(mod).rjust(2, '0') + reference = '+++%s/%s/%s%s+++' % (bbacomm[:3], bbacomm[3:7], bbacomm[7:], mod) + else: + raise osv.except_osv(_('Error!'), + _("Unsupported Structured Communication Type Algorithm '%s' !" \ + "\nPlease contact your OpenERP support channel.") % algorithm) + return {'value': {'reference': reference}} + + def create(self, cr, uid, vals, context=None): + if vals.has_key('reference_type'): + reference_type = vals['reference_type'] + if reference_type == 'bba': + if vals.has_key('reference'): + bbacomm = vals['reference'] + else: + raise osv.except_osv(_('Warning!'), + _('Empty BBA Structured Communication!' \ + '\nPlease fill in a unique BBA Structured Communication.')) + if self.check_bbacomm(bbacomm): + reference = re.sub('\D', '', bbacomm) + vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' + same_ids = self.search(cr, uid, + [('type', '=', 'out_invoice'), ('reference_type', '=', 'bba'), + ('reference', '=', vals['reference'])]) + if same_ids: + raise osv.except_osv(_('Warning!'), + _('The BBA Structured Communication has already been used!' \ + '\nPlease create manually a unique BBA Structured Communication.')) + return super(account_invoice, self).create(cr, uid, vals, context=context) + + def write(self, cr, uid, ids, vals, context={}): + if isinstance(ids, (int, long)): + ids = [ids] + for inv in self.browse(cr, uid, ids, context): + if vals.has_key('reference_type'): + reference_type = vals['reference_type'] + else: + reference_type = inv.reference_type or '' + if reference_type == 'bba': + if vals.has_key('reference'): + bbacomm = vals['reference'] + else: + bbacomm = inv.reference or '' + if self.check_bbacomm(bbacomm): + reference = re.sub('\D', '', bbacomm) + vals['reference'] = '+++' + reference[0:3] + '/' + reference[3:7] + '/' + reference[7:] + '+++' + same_ids = self.search(cr, uid, + [('id', '!=', inv.id), ('type', '=', 'out_invoice'), + ('reference_type', '=', 'bba'), ('reference', '=', vals['reference'])]) + if same_ids: + raise osv.except_osv(_('Warning!'), + _('The BBA Structured Communication has already been used!' \ + '\nPlease create manually a unique BBA Structured Communication.')) + return super(account_invoice, self).write(cr, uid, ids, vals, context) + + _columns = { + 'reference': fields.char('Communication', size=64, help="The partner reference of this invoice."), + 'reference_type': fields.selection(_get_reference_type, 'Communication Type', + required=True), + } + + _constraints = [ + (_check_communication, 'Invalid BBA Structured Communication !', ['Communication']), + ] + +account_invoice() # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/l10n_be_invoice_bba/partner.py b/addons/l10n_be_invoice_bba/partner.py index 04a51c3a6ab..4cb6079e0a2 100644 --- a/addons/l10n_be_invoice_bba/partner.py +++ b/addons/l10n_be_invoice_bba/partner.py @@ -21,11 +21,10 @@ # ############################################################################## -from osv import fields, osv import time + +from osv import fields, osv from tools.translate import _ -import netsvc -logger=netsvc.Logger() class res_partner(osv.osv): """ add field to indicate default 'Communication Type' on customer invoices """ diff --git a/addons/l10n_multilang/l10n_multilang.py b/addons/l10n_multilang/l10n_multilang.py index c4130f2761d..331ec12d76f 100644 --- a/addons/l10n_multilang/l10n_multilang.py +++ b/addons/l10n_multilang/l10n_multilang.py @@ -19,11 +19,13 @@ # ############################################################################## -from osv import fields, osv +import logging import os + +from osv import fields, osv from tools.translate import _ -import netsvc -logger=netsvc.Logger() + +_logger = logging.getLogger(__name__) class wizard_multi_charts_accounts(osv.osv_memory): """ @@ -80,8 +82,9 @@ class wizard_multi_charts_accounts(osv.osv_memory): if context.get('lang') == lang: self.pool.get(out_obj._name).write(cr, uid, out_ids[j], {in_field: value[in_id]}) else: - logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, - 'Language: %s. Translation from template: there is no translation available for %s!' %(lang, src[in_id]))#out_obj._name)) + _logger.warning( + 'Language: %s. Translation from template: there is no translation available for %s!', + lang, src[in_id]) return True def execute(self, cr, uid, ids, context=None): diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 1693397f6fa..b2fcd93c779 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -34,7 +34,7 @@ from osv import osv from osv import fields from tools.translate import _ -_logger = logging.getLogger('mail') +_logger = logging.getLogger(__name__) def format_date_tz(date, tz=None): if not date: diff --git a/addons/mail/mail_thread.py b/addons/mail/mail_thread.py index 70b536296bf..7317f954066 100644 --- a/addons/mail/mail_thread.py +++ b/addons/mail/mail_thread.py @@ -25,14 +25,11 @@ import base64 import email from email.utils import parsedate -import logging import xmlrpclib from osv import osv, fields from tools.translate import _ from mail_message import decode, to_email -_logger = logging.getLogger('mail') - class mail_thread(osv.osv): '''Mixin model, meant to be inherited by any model that needs to act as a discussion topic on which messages can be attached. diff --git a/addons/project_messages/project_messages.py b/addons/project_messages/project_messages.py index 93f83d62f4a..fa0b34a0c47 100644 --- a/addons/project_messages/project_messages.py +++ b/addons/project_messages/project_messages.py @@ -20,14 +20,12 @@ ############################################################################## from osv import fields, osv -import netsvc class messages(osv.osv): """ Message from one user to another within a project """ _name = 'project.messages' - logger = netsvc.Logger() _columns = { 'create_date': fields.datetime('Creation Date', readonly=True), diff --git a/addons/report_webkit/webkit_report.py b/addons/report_webkit/webkit_report.py index d3057e5a1ee..a535e54d005 100644 --- a/addons/report_webkit/webkit_report.py +++ b/addons/report_webkit/webkit_report.py @@ -41,7 +41,6 @@ from mako.template import Template from mako.lookup import TemplateLookup from mako import exceptions -import netsvc import pooler from report_helper import WebKitHelper from report.report_sxw import * @@ -50,7 +49,7 @@ import tools from tools.translate import _ from osv.osv import except_osv -logger = logging.getLogger('report_webkit') +_logger = logging.getLogger(__name__) def mako_template(text): """Build a Mako template. @@ -248,7 +247,7 @@ class WebKitParser(report_sxw): htmls.append(html) except Exception, e: msg = exceptions.text_error_template().render() - logger.error(msg) + _logger.error(msg) raise except_osv(_('Webkit render'), msg) else: try : @@ -259,7 +258,7 @@ class WebKitParser(report_sxw): htmls.append(html) except Exception, e: msg = exceptions.text_error_template().render() - logger.error(msg) + _logger.error(msg) raise except_osv(_('Webkit render'), msg) head_mako_tpl = mako_template(header) try : @@ -281,7 +280,7 @@ class WebKitParser(report_sxw): **self.parser_instance.localcontext) except: msg = exceptions.text_error_template().render() - logger.error(msg) + _logger.error(msg) raise except_osv(_('Webkit render'), msg) if report_xml.webkit_debug : try : @@ -292,7 +291,7 @@ class WebKitParser(report_sxw): **self.parser_instance.localcontext) except Exception, e: msg = exceptions.text_error_template().render() - logger.error(msg) + _logger.error(msg) raise except_osv(_('Webkit render'), msg) return (deb, 'html') bin = self.get_lib(cursor, uid, company.id) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index e9928eb0aa7..24467199fc1 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -31,6 +31,7 @@ import tools import decimal_precision as dp import logging +_logger = logging.getLogger(__name__) #---------------------------------------------------------- # Incoterms @@ -408,9 +409,8 @@ class stock_location(osv.osv): # so we ROLLBACK to the SAVEPOINT to restore the transaction to its earlier # state, we return False as if the products were not available, and log it: cr.execute("ROLLBACK TO stock_location_product_reserve") - logger = logging.getLogger('stock.location') - logger.warn("Failed attempt to reserve %s x product %s, likely due to another transaction already in progress. Next attempt is likely to work. Detailed error available at DEBUG level.", product_qty, product_id) - logger.debug("Trace of the failed product reservation attempt: ", exc_info=True) + _logger.warning("Failed attempt to reserve %s x product %s, likely due to another transaction already in progress. Next attempt is likely to work. Detailed error available at DEBUG level.", product_qty, product_id) + _logger.debug("Trace of the failed product reservation attempt: ", exc_info=True) return False # XXX TODO: rewrite this with one single query, possibly even the quantity conversion From 7b45ea1d88dfe415abcc41345a103acd65ab1450 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 25 Jan 2012 11:06:08 +0100 Subject: [PATCH 005/154] [FIX] account_code: forgot import logging. bzr revid: vmt@openerp.com-20120125100608-ny79sc3tp1d9sak2 --- addons/account_coda/wizard/account_coda_import.py | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/account_coda/wizard/account_coda_import.py b/addons/account_coda/wizard/account_coda_import.py index ac9a623e2fc..b7e7eb5eb10 100644 --- a/addons/account_coda/wizard/account_coda_import.py +++ b/addons/account_coda/wizard/account_coda_import.py @@ -21,6 +21,7 @@ ############################################################################## import base64 +import logging import re from sys import exc_info import time From e582a6a893a96e5ce29e6057ee6467b7c63be482 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 25 Jan 2012 13:45:26 +0100 Subject: [PATCH 006/154] [IMP] logging: use logging instead of netsvc, use module __name__ instead of something else. bzr revid: vmt@openerp.com-20120125124526-nqaaw1rfmy8qa9of --- addons/auth_openid/controllers/main.py | 6 +-- addons/base_crypt/crypt.py | 6 ++- .../pylint_test/pylint_test.py | 7 ++- .../speed_test/speed_test.py | 8 ++- .../workflow_test/workflow_test.py | 9 ++-- addons/base_vat/base_vat.py | 4 +- addons/caldav/caldav_node.py | 17 +++--- addons/caldav/calendar.py | 9 ++-- addons/caldav/calendar_collection.py | 5 +- addons/crm/crm_meeting.py | 4 +- .../document_ftp/ftpserver/abstracted_fs.py | 16 +++--- addons/document_webdav/test_davclient.py | 52 +++++++++---------- addons/email_template/email_template.py | 6 ++- addons/hr/hr.py | 4 +- addons/import_sugarcrm/sugar.py | 4 +- addons/portal/ir_ui_menu.py | 5 +- addons/portal/wizard/portal_wizard.py | 4 +- addons/portal/wizard/share_wizard.py | 10 ++-- addons/share/wizard/share_wizard.py | 29 ++++++----- addons/stock_planning/stock_planning.py | 3 +- addons/users_ldap/users_ldap.py | 13 +++-- 21 files changed, 121 insertions(+), 100 deletions(-) diff --git a/addons/auth_openid/controllers/main.py b/addons/auth_openid/controllers/main.py index c95189b7736..dc7c7b21ccd 100644 --- a/addons/auth_openid/controllers/main.py +++ b/addons/auth_openid/controllers/main.py @@ -39,11 +39,7 @@ from openid.extensions import ax, sreg from .. import utils - - -_logger = logging.getLogger('web.auth_openid') -oidutil.log = logging.getLogger('openid').debug - +oidutil.log = logging.getLogger(__name__ + '(oidutil)').debug class GoogleAppsAwareConsumer(consumer.GenericConsumer): def complete(self, message, endpoint, return_to): diff --git a/addons/base_crypt/crypt.py b/addons/base_crypt/crypt.py index c2fd0a25ef8..6d74e482044 100644 --- a/addons/base_crypt/crypt.py +++ b/addons/base_crypt/crypt.py @@ -36,6 +36,7 @@ # Boston, MA 02111-1307 # USA. +import logging from random import seed, sample from string import ascii_letters, digits from osv import fields,osv @@ -43,6 +44,8 @@ import pooler from tools.translate import _ from service import security +_logger = logging.getLogger(__name__) + magic_md5 = '$1$' def gen_salt( length=8, symbols=ascii_letters + digits ): @@ -179,8 +182,7 @@ class users(osv.osv): cr = pooler.get_db(db).cursor() return self._login(cr, db, login, password) except Exception: - import logging - logging.getLogger('netsvc').exception('Could not authenticate') + _logger.exception('Could not authenticate') return Exception('Access Denied') finally: if cr is not None: diff --git a/addons/base_module_quality/pylint_test/pylint_test.py b/addons/base_module_quality/pylint_test/pylint_test.py index 102f93c469e..bfa9e7d1f16 100644 --- a/addons/base_module_quality/pylint_test/pylint_test.py +++ b/addons/base_module_quality/pylint_test/pylint_test.py @@ -19,11 +19,14 @@ # ############################################################################## +import logging import os import addons from tools.translate import _ from base_module_quality import base_module_quality +_logger = logging.getLogger(__name__) + class quality_test(base_module_quality.abstract_quality_check): def __init__(self): @@ -57,7 +60,7 @@ class quality_test(base_module_quality.abstract_quality_check): res = os.popen('pylint --rcfile=' + config_file_path + ' ' + file_path).read() except Exception: self.error = True - self.log.exception("Cannot run pylint test for %s", file_path) + _logger.exception("Cannot run pylint test for %s", file_path) self.result += _("Error. Is pylint correctly installed? (http://pypi.python.org/pypi/pylint)")+"\n" return None count += 1 @@ -66,7 +69,7 @@ class quality_test(base_module_quality.abstract_quality_check): score += float(scr) dict_py[file_py] = [file_py, scr] except Exception: - self.log.warning("Cannot parse pylint result", exc_info=True) + _logger.warning("Cannot parse pylint result", exc_info=True) score += 0 dict_py[file_py] = [file_py, _("Unable to parse the result. Check the details.")] replace_string = '' diff --git a/addons/base_module_quality/speed_test/speed_test.py b/addons/base_module_quality/speed_test/speed_test.py index 21ddee92ea1..26f3ea176b1 100644 --- a/addons/base_module_quality/speed_test/speed_test.py +++ b/addons/base_module_quality/speed_test/speed_test.py @@ -19,9 +19,13 @@ # ############################################################################## +import logging + from tools.translate import _ import pooler +_logger = logging.getLogger(__name__) + from base_module_quality import base_module_quality class CounterCursor(object): @@ -77,7 +81,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need try: obj_ids = self.get_ids(cr, uid, obj_list) except Exception,e: - self.log.warning("Cannot get ids:", exc_info=True) + _logger.warning("Cannot get ids:", exc_info=True) obj_ids= {} self.result_details += e.message result_dict = {} @@ -111,7 +115,7 @@ This test checks the speed of the module. Note that at least 5 demo data is need code_size_complexity = ccr.count except Exception, e: - self.log.warning('Error in read method', exc_info=True) + _logger.warning('Error in read method', exc_info=True) list2 = [obj, _("Error in Read method")] speed_list = [obj, size, code_base_complexity, code_half_complexity, code_size_complexity, _("Error in Read method: %s") % e] else: diff --git a/addons/base_module_quality/workflow_test/workflow_test.py b/addons/base_module_quality/workflow_test/workflow_test.py index 11f7bcf12c3..1ce3f56b83a 100644 --- a/addons/base_module_quality/workflow_test/workflow_test.py +++ b/addons/base_module_quality/workflow_test/workflow_test.py @@ -19,6 +19,7 @@ # ############################################################################## +import loggging import xml.dom.minidom import tools @@ -26,6 +27,8 @@ from tools.translate import _ from base_module_quality import base_module_quality import pooler +_logger = logging.getLogger(__name__) + class quality_test(base_module_quality.abstract_quality_check): def __init__(self): @@ -80,8 +83,8 @@ class quality_test(base_module_quality.abstract_quality_check): #Activity of workflow checking... activity_ids = wkf_activity_obj.search(cr, uid, [('wkf_id', 'in', wkf_ids)]) activities = wkf_activity_obj.browse(cr, uid, activity_ids) - self.log.debug("quality test: wkf_ids = %r", wkf_ids) - self.log.debug("quality test: activity_ids = %r", activity_ids) + _logger.debug("quality test: wkf_ids = %r", wkf_ids) + _logger.debug("quality test: activity_ids = %r", activity_ids) for activity in activities: if activity.flow_start: activity_chk[activity.wkf_id.osv]['start'] = 'ok' @@ -155,4 +158,4 @@ class quality_test(base_module_quality.abstract_quality_check): count = self.count_button(node, count) return count -# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: \ No newline at end of file +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py index 02471f67442..8b9b9fd26c1 100644 --- a/addons/base_vat/base_vat.py +++ b/addons/base_vat/base_vat.py @@ -19,7 +19,6 @@ # ############################################################################## -import logging import string import datetime import re @@ -27,7 +26,8 @@ import re try: import vatnumber except ImportError: - logging.getLogger('base_vat').warning("VAT validation partially unavailable because the `vatnumber` Python library cannot be found. " + import logging + logging.getLogger(__name__).warning("VAT validation partially unavailable because the `vatnumber` Python library cannot be found. " "Install it to support more countries, for example with `easy_install vatnumber`.") vatnumber = None diff --git a/addons/caldav/caldav_node.py b/addons/caldav/caldav_node.py index 71e9bdc2468..edd0a742467 100644 --- a/addons/caldav/caldav_node.py +++ b/addons/caldav/caldav_node.py @@ -29,6 +29,8 @@ try: except ImportError: from document.dict_tools import dict_merge2 +_logger = logging.getLogger(__name__) + # TODO: implement DAV-aware errors, inherit from IOError # Assuming that we have set global properties right, we mark *all* @@ -223,7 +225,6 @@ class node_calendar(nodes.node_class): res = [] if not filters: return res - _log = logging.getLogger('caldav.query') if filters.localName == 'calendar-query': res = [] for filter_child in filters.childNodes: @@ -245,27 +246,27 @@ class node_calendar(nodes.node_class): for cfe in vevent_filter.childNodes: if cfe.localName == 'time-range': if cfe.getAttribute('start'): - _log.warning("Ignore start.. ") + _logger.warning("Ignore start.. ") # No, it won't work in this API #val = cfe.getAttribute('start') #res += [('dtstart','=', cfe)] elif cfe.getAttribute('end'): - _log.warning("Ignore end.. ") + _logger.warning("Ignore end.. ") else: - _log.debug("Unknown comp-filter: %s", cfe.localName) + _logger.debug("Unknown comp-filter: %s", cfe.localName) else: - _log.debug("Unknown comp-filter: %s", vevent_filter.localName) + _logger.debug("Unknown comp-filter: %s", vevent_filter.localName) else: - _log.debug("Unknown filter element: %s", vcalendar_filter.localName) + _logger.debug("Unknown filter element: %s", vcalendar_filter.localName) else: - _log.debug("Unknown calendar-query element: %s", filter_child.localName) + _logger.debug("Unknown calendar-query element: %s", filter_child.localName) return res elif filters.localName == 'calendar-multiget': # this is not the place to process, as it wouldn't support multi-level # hrefs. So, the code is moved to document_webdav/dav_fs.py pass else: - _log.debug("Unknown element in REPORT: %s", filters.localName) + _logger.debug("Unknown element in REPORT: %s", filters.localName) return res def children(self, cr, domain=None): diff --git a/addons/caldav/calendar.py b/addons/caldav/calendar.py index 94d28e4ad37..770865175cd 100644 --- a/addons/caldav/calendar.py +++ b/addons/caldav/calendar.py @@ -40,6 +40,8 @@ try: except ImportError: raise osv.except_osv(_('vobject Import Error!'), _('Please install python-vobject from http://vobject.skyhouseconsulting.com/')) +_logger = logging.getLogger(__name__) + # O-1 Optional and can come only once # O-n Optional and can come more than once # R-1 Required and can come only once @@ -240,7 +242,6 @@ def map_data(cr, uid, obj, context=None): class CalDAV(object): __attribute__ = {} - _logger = logging.getLogger('document.caldav') def ical_set(self, name, value, type): """ set calendar Attribute @@ -725,13 +726,13 @@ class Calendar(CalDAV, osv.osv): objs.append(cal_children[child.name.lower()]) elif child.name.upper() == 'CALSCALE': if child.value.upper() != 'GREGORIAN': - self._logger.warning('How do I handle %s calendars?',child.value) + _logger.warning('How do I handle %s calendars?',child.value) elif child.name.upper() in ('PRODID', 'VERSION'): pass elif child.name.upper().startswith('X-'): - self._logger.debug("skipping custom node %s", child.name) + _logger.debug("skipping custom node %s", child.name) else: - self._logger.debug("skipping node %s", child.name) + _logger.debug("skipping node %s", child.name) res = [] for obj_name in list(set(objs)): diff --git a/addons/caldav/calendar_collection.py b/addons/caldav/calendar_collection.py index 1abbf573ef0..8c845aff5e6 100644 --- a/addons/caldav/calendar_collection.py +++ b/addons/caldav/calendar_collection.py @@ -24,6 +24,8 @@ from tools.translate import _ import caldav_node import logging +_logger = logging.getLogger(__name__) + class calendar_collection(osv.osv): _inherit = 'document.directory' _columns = { @@ -44,8 +46,7 @@ class calendar_collection(osv.osv): root_cal_dir = self.browse(cr,uid, root_id, context=context) return root_cal_dir.name except Exception: - logger = logging.getLogger('document') - logger.warning('Cannot set root directory for Calendars:', exc_info=True) + _logger.warning('Cannot set root directory for Calendars:', exc_info=True) return False return False diff --git a/addons/crm/crm_meeting.py b/addons/crm/crm_meeting.py index 40ba8662f13..f28212051eb 100644 --- a/addons/crm/crm_meeting.py +++ b/addons/crm/crm_meeting.py @@ -25,6 +25,8 @@ from osv import fields, osv from tools.translate import _ import logging +_logger = logging.getLogger(__name__) + class crm_lead(crm_case, osv.osv): """ CRM Leads """ _name = 'crm.lead' @@ -149,7 +151,7 @@ class res_users(osv.osv): 'user_id': user_id}, context=context) except: # Tolerate a missing shortcut. See product/product.py for similar code. - logging.getLogger('orm').debug('Skipped meetings shortcut for user "%s"', data.get('name','", cnod, node.tagName) + _logger.debug("Found %r inside <%s>", cnod, node.tagName) continue if namespaces and (cnod.namespaceURI not in namespaces): - log.debug("Ignoring <%s> in <%s>", cnod.tagName, node.localName) + _logger.debug("Ignoring <%s> in <%s>", cnod.tagName, node.localName) continue yield cnod @@ -533,10 +533,10 @@ class DAVClient(object): assert htver == 'HTTP/1.1' rstatus = int(sta) else: - log.debug("What is <%s> inside a ?", pno.tagName) + _logger.debug("What is <%s> inside a ?", pno.tagName) else: - log.debug("Unknown node: %s", cno.tagName) + _logger.debug("Unknown node: %s", cno.tagName) res.setdefault(href,[]).append((status, res_nss)) @@ -637,7 +637,7 @@ class DAVClient(object): if lsp[1] in davprops: lsline[lsp[0]] = lsp[2] else: - log.debug("Strange status: %s", st) + _logger.debug("Strange status: %s", st) res.append(lsline) diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py index 90eda625759..4d64dd1a4c6 100644 --- a/addons/email_template/email_template.py +++ b/addons/email_template/email_template.py @@ -30,10 +30,12 @@ import tools from tools.translate import _ from urllib import quote as quote +_logger = logging.getLogger(__name__) + try: from mako.template import Template as MakoTemplate except ImportError: - logging.getLogger('init').warning("email_template: mako templates not available, templating features will not work!") + _logger.warning("email_template: mako templates not available, templating features will not work!") class email_template(osv.osv): "Templates for sending email" @@ -73,7 +75,7 @@ class email_template(osv.osv): result = u'' return result except Exception: - logging.exception("failed to render mako template value %r", template) + _logger.exception("failed to render mako template value %r", template) return u"" def get_email_template(self, cr, uid, template_id=False, record_id=None, context=None): diff --git a/addons/hr/hr.py b/addons/hr/hr.py index 76f9295a829..2dfd018eec1 100644 --- a/addons/hr/hr.py +++ b/addons/hr/hr.py @@ -23,6 +23,8 @@ from osv import fields, osv import logging import addons +_logger = logging.getLogger(__name__) + class hr_employee_category(osv.osv): def name_get(self, cr, uid, ids, context=None): @@ -270,7 +272,7 @@ class res_users(osv.osv): 'user_id': user_id}, context=context) except: # Tolerate a missing shortcut. See product/product.py for similar code. - logging.getLogger('orm').debug('Skipped meetings shortcut for user "%s"', data.get('name',' 1: - log = logging.getLogger('ir.ui.menu') - log.warning('User %s belongs to several portals', str(uid)) + _logger.warning('User %s belongs to several portals', str(uid)) p = portal_obj.browse(cr, uid, portal_ids[0]) # if the portal overrides the menu, use its domain if p.menu_action_id: diff --git a/addons/portal/wizard/portal_wizard.py b/addons/portal/wizard/portal_wizard.py index 706d6fd4a7f..f0790cb9bd9 100644 --- a/addons/portal/wizard/portal_wizard.py +++ b/addons/portal/wizard/portal_wizard.py @@ -28,7 +28,7 @@ from tools.translate import _ from base.res.res_users import _lang_get - +_logger = logging.getLogger(__name__) # welcome email sent to new portal users (note that calling tools.translate._ # has no effect except exporting those strings for translation) @@ -178,7 +178,7 @@ class wizard(osv.osv_memory): body = _(WELCOME_EMAIL_BODY) % data res = mail_message_obj.schedule_with_attach(cr, uid, email_from , [email_to], subject, body, context=context) if not res: - logging.getLogger('res.portal.wizard').warning( + _logger.warning( 'Failed to send email from %s to %s', email_from, email_to) return {'type': 'ir.actions.act_window_close'} diff --git a/addons/portal/wizard/share_wizard.py b/addons/portal/wizard/share_wizard.py index b5c9d165cc6..4236206a6fd 100644 --- a/addons/portal/wizard/share_wizard.py +++ b/addons/portal/wizard/share_wizard.py @@ -19,9 +19,13 @@ # ############################################################################## +import logging + from osv import osv, fields from tools.translate import _ +_logger = logging.getLogger(__name__) + UID_ROOT = 1 SHARED_DOCS_MENU = "Documents" SHARED_DOCS_CHILD_MENU = "Shared Documents" @@ -164,19 +168,19 @@ class share_wizard_portal(osv.osv_memory): # v6.1, the algorithm for combining them will OR the rules, hence # extending the visible data. Rules.write(cr, UID_ROOT, share_rule_ids, {'groups': [(4,target_group.id)]}) - self._logger.debug("Linked sharing rules from temporary sharing group to group %s", target_group) + _logger.debug("Linked sharing rules from temporary sharing group to group %s", target_group) # Copy the access rights. This is appropriate too because # groups have the UNION of all permissions granted by their # access right lines. for access_line in share_group.model_access: Rights.copy(cr, UID_ROOT, access_line.id, default={'group_id': target_group.id}) - self._logger.debug("Copied access rights from temporary sharing group to group %s", target_group) + _logger.debug("Copied access rights from temporary sharing group to group %s", target_group) # finally, delete it after removing its users Groups.write(cr, UID_ROOT, [share_group_id], {'users': [(6,0,[])]}) Groups.unlink(cr, UID_ROOT, [share_group_id]) - self._logger.debug("Deleted temporary sharing group %s", share_group_id) + _logger.debug("Deleted temporary sharing group %s", share_group_id) def _finish_result_lines(self, cr, uid, wizard_data, share_group_id, context=None): super(share_wizard_portal,self)._finish_result_lines(cr, uid, wizard_data, share_group_id, context=context) diff --git a/addons/share/wizard/share_wizard.py b/addons/share/wizard/share_wizard.py index 80a0b12f8b2..5ed07142367 100644 --- a/addons/share/wizard/share_wizard.py +++ b/addons/share/wizard/share_wizard.py @@ -33,6 +33,8 @@ from tools.translate import _ from tools.safe_eval import safe_eval import openerp +_logger = logging.getLogger(__name__) + FULL_ACCESS = ('perm_read', 'perm_write', 'perm_create', 'perm_unlink') READ_WRITE_ACCESS = ('perm_read', 'perm_write') READ_ONLY_ACCESS = ('perm_read',) @@ -48,7 +50,6 @@ def generate_random_pass(): return ''.join(random.sample(RANDOM_PASS_CHARACTERS,10)) class share_wizard(osv.osv_memory): - _logger = logging.getLogger('share.wizard') _name = 'share.wizard' _description = 'Share Wizard' @@ -322,7 +323,7 @@ class share_wizard(osv.osv_memory): except Exception: # Note: must catch all exceptions, as UnquoteEvalContext may cause many # different exceptions, as it shadows builtins. - self._logger.debug("Failed to cleanup action context as it does not parse server-side", exc_info=True) + _logger.debug("Failed to cleanup action context as it does not parse server-side", exc_info=True) result = context_str return result @@ -483,8 +484,8 @@ class share_wizard(osv.osv_memory): [x.id for x in current_user.groups_id], target_model_ids, context=context) group_access_map = self._get_access_map_for_groups_and_models(cr, uid, [group_id], target_model_ids, context=context) - self._logger.debug("Current user access matrix: %r", current_user_access_map) - self._logger.debug("New group current access matrix: %r", group_access_map) + _logger.debug("Current user access matrix: %r", current_user_access_map) + _logger.debug("New group current access matrix: %r", group_access_map) # Create required rights if allowed by current user rights and not # already granted @@ -505,7 +506,7 @@ class share_wizard(osv.osv_memory): need_creation = True if need_creation: model_access_obj.create(cr, UID_ROOT, values) - self._logger.debug("Creating access right for model %s with values: %r", model.model, values) + _logger.debug("Creating access right for model %s with values: %r", model.model, values) def _link_or_copy_current_user_rules(self, cr, current_user, group_id, fields_relations, context=None): rule_obj = self.pool.get('ir.rule') @@ -527,13 +528,13 @@ class share_wizard(osv.osv_memory): 'groups': [(6,0,[group_id])], 'domain_force': rule.domain, # evaluated version! }) - self._logger.debug("Copying rule %s (%s) on model %s with domain: %s", rule.name, rule.id, model.model, rule.domain_force) + _logger.debug("Copying rule %s (%s) on model %s with domain: %s", rule.name, rule.id, model.model, rule.domain_force) else: # otherwise we can simply link the rule to keep it dynamic rule_obj.write(cr, 1, [rule.id], { 'groups': [(4,group_id)] }) - self._logger.debug("Linking rule %s (%s) on model %s with domain: %s", rule.name, rule.id, model.model, rule.domain_force) + _logger.debug("Linking rule %s (%s) on model %s with domain: %s", rule.name, rule.id, model.model, rule.domain_force) def _check_personal_rule_or_duplicate(self, cr, group_id, rule, context=None): """Verifies that the given rule only belongs to the given group_id, otherwise @@ -552,7 +553,7 @@ class share_wizard(osv.osv_memory): 'groups': [(6,0,[group_id])], 'domain_force': rule.domain_force, # non evaluated! }) - self._logger.debug("Duplicating rule %s (%s) (domain: %s) for modified access ", rule.name, rule.id, rule.domain_force) + _logger.debug("Duplicating rule %s (%s) (domain: %s) for modified access ", rule.name, rule.id, rule.domain_force) # then disconnect from group_id: rule.write({'groups':[(3,group_id)]}) # disconnects, does not delete! return rule_obj.browse(cr, UID_ROOT, new_id, context=context) @@ -587,7 +588,7 @@ class share_wizard(osv.osv_memory): if restrict: continue else: - self._logger.debug("Ignoring sharing rule on model %s with domain: %s the same rule exists already", model_id, domain) + _logger.debug("Ignoring sharing rule on model %s with domain: %s the same rule exists already", model_id, domain) return if restrict: # restricting existing rules is done by adding the clause @@ -599,7 +600,7 @@ class share_wizard(osv.osv_memory): new_clause = expression.normalize(eval(domain, eval_ctx)) combined_domain = expression.AND([new_clause, org_domain]) rule.write({'domain_force': combined_domain, 'name': rule.name + _('(Modified)')}) - self._logger.debug("Combining sharing rule %s on model %s with domain: %s", rule.id, model_id, domain) + _logger.debug("Combining sharing rule %s on model %s with domain: %s", rule.id, model_id, domain) if not restrict: # Adding the new rule in the group is ok for normal cases, because rules # in the same group and for the same model will be combined with OR @@ -610,7 +611,7 @@ class share_wizard(osv.osv_memory): 'domain_force': domain, 'groups': [(4,group_id)] }) - self._logger.debug("Created sharing rule on model %s with domain: %s", model_id, domain) + _logger.debug("Created sharing rule on model %s with domain: %s", model_id, domain) def _create_indirect_sharing_rules(self, cr, current_user, wizard_data, group_id, fields_relations, context=None): rule_name = _('Indirect sharing filter created by user %s (%s) for group %s') % \ @@ -631,7 +632,7 @@ class share_wizard(osv.osv_memory): group_id, model_id=model.id, domain=str(related_domain), rule_name=rule_name, restrict=True, context=context) except Exception: - self._logger.exception('Failed to create share access') + _logger.exception('Failed to create share access') raise osv.except_osv(_('Sharing access could not be created'), _('Sorry, the current screen and filter you are trying to share are not supported at the moment.\nYou may want to try a simpler filter.')) @@ -749,7 +750,7 @@ class share_wizard(osv.osv_memory): } def send_emails(self, cr, uid, wizard_data, context=None): - self._logger.info('Sending share notifications by email...') + _logger.info('Sending share notifications by email...') mail_message = self.pool.get('mail.message') user = self.pool.get('res.users').browse(cr, UID_ROOT, uid) @@ -795,7 +796,7 @@ class share_wizard(osv.osv_memory): context=context)) # force direct delivery, as users expect instant notification mail_message.send(cr, uid, msg_ids, context=context) - self._logger.info('%d share notification(s) sent.', len(msg_ids)) + _logger.info('%d share notification(s) sent.', len(msg_ids)) def onchange_embed_options(self, cr, uid, ids, opt_title, opt_search, context=None): wizard = self.browse(cr, uid, ids[0], context) diff --git a/addons/stock_planning/stock_planning.py b/addons/stock_planning/stock_planning.py index d104d57c62b..0b9f95deb7e 100644 --- a/addons/stock_planning/stock_planning.py +++ b/addons/stock_planning/stock_planning.py @@ -29,8 +29,7 @@ from tools.translate import _ import logging import decimal_precision as dp -_logger = logging.getLogger('mps') - +_logger = logging.getLogger(__name__) def rounding(fl, round_value): if not round_value: diff --git a/addons/users_ldap/users_ldap.py b/addons/users_ldap/users_ldap.py index 1ad1b2df104..c32d120b298 100644 --- a/addons/users_ldap/users_ldap.py +++ b/addons/users_ldap/users_ldap.py @@ -28,6 +28,8 @@ import tools from osv import fields, osv from openerp import SUPERUSER_ID +_logger = logging.getLogger(__name__) + class CompanyLDAP(osv.osv): _name = 'res.company.ldap' _order = 'sequence' @@ -107,8 +109,7 @@ class CompanyLDAP(osv.osv): except ldap.INVALID_CREDENTIALS: return False except ldap.LDAPError, e: - logger = logging.getLogger('orm.ldap') - logger.error('An LDAP exception occurred: %s', e) + _logger.error('An LDAP exception occurred: %s', e) return entry def query(self, conf, filter, retrieve_attributes=None): @@ -135,7 +136,6 @@ class CompanyLDAP(osv.osv): """ results = [] - logger = logging.getLogger('orm.ldap') try: conn = self.connect(conf) conn.simple_bind_s(conf['ldap_binddn'] or '', @@ -144,9 +144,9 @@ class CompanyLDAP(osv.osv): filter, retrieve_attributes, timeout=60) conn.unbind() except ldap.INVALID_CREDENTIALS: - logger.error('LDAP bind failed.') + _logger.error('LDAP bind failed.') except ldap.LDAPError, e: - logger.error('An LDAP exception occurred: %s', e) + _logger.error('An LDAP exception occurred: %s', e) return results def map_ldap_attributes(self, cr, uid, conf, login, ldap_entry): @@ -188,8 +188,7 @@ class CompanyLDAP(osv.osv): if res[1]: user_id = res[0] elif conf['create_user']: - logger = logging.getLogger('orm.ldap') - logger.debug("Creating new OpenERP user \"%s\" from LDAP" % login) + _logger.debug("Creating new OpenERP user \"%s\" from LDAP" % login) user_obj = self.pool.get('res.users') values = self.map_ldap_attributes(cr, uid, conf, login, ldap_entry) if conf['user']: From bf6d569d75f8e4217773ea6f58d231160f32b557 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Wed, 25 Jan 2012 14:00:11 +0100 Subject: [PATCH 007/154] [IMP] logging: use logging instead of netsvc. bzr revid: vmt@openerp.com-20120125130011-yxfhry0h881k64cn --- addons/document_ftp/ftpserver/__init__.py | 6 ++---- addons/l10n_be/wizard/l10n_be_partner_vat_listing.py | 1 - 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/addons/document_ftp/ftpserver/__init__.py b/addons/document_ftp/ftpserver/__init__.py index 11b041e074b..dd5ec255704 100644 --- a/addons/document_ftp/ftpserver/__init__.py +++ b/addons/document_ftp/ftpserver/__init__.py @@ -38,8 +38,6 @@ def start_server(): PASSIVE_PORTS = int(pps[0]), int(pps[1]) class ftp_server(threading.Thread): - def log(self, level, message): - _logger.log(level, message) def run(self): autho = authorizer.authorizer() @@ -50,9 +48,9 @@ def start_server(): if PASSIVE_PORTS: ftpserver.FTPHandler.passive_ports = PASSIVE_PORTS - ftpserver.log = lambda msg: self.log(netsvc.LOG_INFO, msg) + ftpserver.log = _logger.info ftpserver.logline = lambda msg: None - ftpserver.logerror = lambda msg: self.log(netsvc.LOG_ERROR, msg) + ftpserver.logerror = _logger.error ftpd = ftpserver.FTPServer((HOST, PORT), ftpserver.FTPHandler) ftpd.serve_forever() diff --git a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py index e43dbfecf2b..7e7cba15c78 100644 --- a/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py +++ b/addons/l10n_be/wizard/l10n_be_partner_vat_listing.py @@ -45,7 +45,6 @@ class partner_vat_13(osv.osv_memory): period = obj_period.search(cursor, user, [('date_start' ,'>=', date_start), ('date_stop','<=',date_stop)]) if not period: raise osv.except_osv(_('Data Insufficient!'), _('No data for the selected Year.')) - #logger.notifyChannel('addons.'+self._name, netsvc.LOG_WARNING, 'period = %s' %period ) p_id_list = obj_partner.search(cursor, user, [('vat_subjected', '!=', False)], context=context) if not p_id_list: From cb81b9b6d5647709f5705a47fb51f5c807f754d6 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Wed, 18 Jul 2012 12:02:34 +0530 Subject: [PATCH 008/154] [FIX][TRUNK]Sale order reference changed in sale order calendar view lp bug: https://launchpad.net/bugs/1003861 fixed bzr revid: pan@tinyerp.com-20120718063234-jnhjkhrjnnocg4ag --- addons/web_calendar/static/src/js/calendar.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 59ca58bec86..2989b31ddfa 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -387,8 +387,8 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ } }, get_event_data: function(event_obj) { - var data = { - name: event_obj.text + var data = { + //name: event_obj.text }; data[this.date_start] = instance.web.datetime_to_str(event_obj.start_date); if (this.date_stop) { From aa6aa08f8d08d21834d72466f7f0518783052f90 Mon Sep 17 00:00:00 2001 From: "Anand Patel (OpenERP)" Date: Wed, 29 Aug 2012 15:46:42 +0530 Subject: [PATCH 009/154] [FIX][TRUNK]Sale order reference changed in sale order calendar view bzr revid: pan@tinyerp.com-20120829101642-04qta93yeifjew1i --- addons/web_calendar/static/src/js/calendar.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index b1c164a3c61..4b839f0666a 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -388,9 +388,7 @@ instance.web_calendar.CalendarView = instance.web.View.extend({ } }, get_event_data: function(event_obj) { - var data = { - //name: event_obj.text - }; + var data = {}; data[this.date_start] = instance.web.datetime_to_str(event_obj.start_date); if (this.date_stop) { data[this.date_stop] = instance.web.datetime_to_str(event_obj.end_date); From 2a1bd62ed539a7613d04ed37ac631b8a8c2a6822 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 11:18:46 +0530 Subject: [PATCH 010/154] [IMP] dialog after survey is completed says Complete Survey rename it to Survey Completed bzr revid: fka@tinyerp.com-20121003054846-6yy1eicqk5oqancq --- addons/survey/wizard/survey_answer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 8ece1e184cf..76d2f012be8 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -435,7 +435,7 @@ class survey_question_wiz(osv.osv_memory): xml_form = etree.Element('form', {'string': _('Complete Survey Answer')}) xml_footer = etree.SubElement(xml_form, 'footer', {'col': '6', 'colspan': '4' ,'class': 'oe_survey_title_height'}) - etree.SubElement(xml_form, 'separator', {'string': 'Complete Survey', 'colspan': "4"}) + etree.SubElement(xml_form, 'separator', {'string': 'Survey Completed', 'colspan': "4"}) etree.SubElement(xml_form, 'label', {'string': 'Thanks for your Answer'}) etree.SubElement(xml_form, 'newline') etree.SubElement(xml_footer, 'button', {'special':"cancel",'string':"OK",'colspan':"2",'class':'oe_highlight'}) From 38bca04309f47d2e13b8f26374efeb28d900da54 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 11:37:49 +0530 Subject: [PATCH 011/154] [IMP] remove Survey Open Date field in survey bzr revid: fka@tinyerp.com-20121003060749-wr41pmtkfhdfdcr5 --- addons/survey/survey.py | 3 +-- addons/survey/survey_demo.xml | 3 --- addons/survey/survey_view.xml | 3 --- 3 files changed, 1 insertion(+), 8 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index d01140092d4..a996c4312ab 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -53,7 +53,6 @@ class survey(osv.osv): 'id': fields.integer('ID'), 'title': fields.char('Survey Title', size=128, required=1), 'page_ids': fields.one2many('survey.page', 'survey_id', 'Page'), - 'date_open': fields.datetime('Survey Open Date', readonly=1), 'date_close': fields.datetime('Survey Close Date', readonly=1), 'max_response_limit': fields.integer('Maximum Answer Limit', help="Set to one if survey is answerable only once"), @@ -80,7 +79,7 @@ class survey(osv.osv): } def survey_open(self, cr, uid, ids, arg): - self.write(cr, uid, ids, {'state': 'open', 'date_open': strftime("%Y-%m-%d %H:%M:%S")}) + self.write(cr, uid, ids, {'state': 'open'}) return True def survey_close(self, cr, uid, ids, arg): diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index 6f89095c699..f9a3e8f3159 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -17,7 +17,6 @@ 1 1 5 - @@ -166,7 +165,6 @@ 1 1 5 - @@ -633,7 +631,6 @@ 1 1 5 - diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index 01d6098df55..c71e4e8d537 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -220,7 +220,6 @@ - @@ -253,7 +252,6 @@ - @@ -295,7 +293,6 @@ - From 70d971c3d71ba0dd49cad49a3088e3b386b4bbf0 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 12:04:32 +0530 Subject: [PATCH 012/154] [IMP] every field editable in survey when survey is in open state bzr revid: fka@tinyerp.com-20121003063432-nktuyqz1batgu0ne --- addons/survey/survey.py | 8 ++++---- addons/survey/survey_view.xml | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index a996c4312ab..999dec0aadc 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -60,10 +60,10 @@ class survey(osv.osv): help="Set to one if you require only one Answer per user"), 'state': fields.selection([('open', 'Open'), ('cancel', 'Cancelled'),('close', 'Closed') ], 'Status', readonly=True), 'responsible_id': fields.many2one('res.users', 'Responsible', help="User responsible for survey"), - 'tot_start_survey': fields.integer("Total Started Survey", readonly=1), - 'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1), + 'tot_start_survey': fields.integer("Total Started Survey"), + 'tot_comp_survey': fields.integer("Total Completed Survey"), 'note': fields.text('Description', size=128), - 'history': fields.one2many('survey.history', 'survey_id', 'History Lines', readonly=True), + 'history': fields.one2many('survey.history', 'survey_id', 'History Lines'), 'users': fields.many2many('res.users', 'survey_users_rel', 'sid', 'uid', 'Users'), 'send_response': fields.boolean('Email Notification on Answer'), 'type': fields.many2one('survey.type', 'Type'), @@ -187,7 +187,7 @@ class survey_history(osv.osv): 'date': fields.datetime('Date started', readonly=1), } _defaults = { - 'date': lambda * a: datetime.datetime.now() + 'date': lambda * a: strftime("%Y-%m-%d %H:%M:%S") } survey_history() diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index c71e4e8d537..a03df6800e7 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -49,8 +49,8 @@ - - + + @@ -215,7 +215,7 @@ - + From 9f79e73ac88f12770cffb43b41d5f81fafc30db0 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 12:53:48 +0530 Subject: [PATCH 013/154] [IMP] Add m2m_tags for Select Partne & change default mail subject in send invitation bzr revid: fka@tinyerp.com-20121003072348-lw76eoym8i3jdqcc --- addons/survey/wizard/survey_send_invitation.py | 4 ++-- addons/survey/wizard/survey_send_invitation.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py index 5677a985e09..61e1dd23665 100644 --- a/addons/survey/wizard/survey_send_invitation.py +++ b/addons/survey/wizard/survey_send_invitation.py @@ -50,8 +50,6 @@ class survey_send_invitation(osv.osv_memory): _defaults = { 'send_mail': lambda *a: 1, 'send_mail_existing': lambda *a: 1, - 'mail_subject': lambda *a: "Invitation", - 'mail_subject_existing': lambda *a: "Invitation", 'mail_from': lambda *a: tools.config['email_from'] } @@ -75,6 +73,8 @@ class survey_send_invitation(osv.osv_memory): data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \ \n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s \n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,''' + data['mail_subject'] = "Invitation for " + sur.title + data['mail_subject_existing'] = "Invitation for " + sur.title return data def create_report(self, cr, uid, res_ids, report_name=False, file_name=False): diff --git a/addons/survey/wizard/survey_send_invitation.xml b/addons/survey/wizard/survey_send_invitation.xml index 340cb58b5cf..a611973d772 100644 --- a/addons/survey/wizard/survey_send_invitation.xml +++ b/addons/survey/wizard/survey_send_invitation.xml @@ -16,7 +16,7 @@ - + From 6ff616dd04e02303c855dc0a51b397810e9f8739 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 14:50:43 +0530 Subject: [PATCH 014/154] [IMP] improve code bzr revid: fka@tinyerp.com-20121003092043-e3id1isgm65itoef --- addons/survey/survey.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 999dec0aadc..6e350ccf9ce 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -187,7 +187,7 @@ class survey_history(osv.osv): 'date': fields.datetime('Date started', readonly=1), } _defaults = { - 'date': lambda * a: strftime("%Y-%m-%d %H:%M:%S") + 'date': lambda * a: datetime.datetime.now() } survey_history() From f2ebee24e88f642dddfb339b00c8ca6f73467da1 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 16:05:24 +0530 Subject: [PATCH 015/154] [IMP] improve code bzr revid: fka@tinyerp.com-20121003103524-j480eazwonxu1g4y --- addons/survey/wizard/survey_send_invitation.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py index 61e1dd23665..8c9bb2a7fbe 100644 --- a/addons/survey/wizard/survey_send_invitation.py +++ b/addons/survey/wizard/survey_send_invitation.py @@ -50,7 +50,6 @@ class survey_send_invitation(osv.osv_memory): _defaults = { 'send_mail': lambda *a: 1, 'send_mail_existing': lambda *a: 1, - 'mail_from': lambda *a: tools.config['email_from'] } def genpasswd(self): @@ -68,13 +67,14 @@ class survey_send_invitation(osv.osv_memory): name += "\t --> " + sur.title + "\n" if sur.state != 'open': msg += sur.title + "\n" + data['mail_subject'] = "Invitation for " + sur.title + data['mail_subject_existing'] = "Invitation for " + sur.title + data['mail_from'] = sur.responsible_id.email if msg: raise osv.except_osv(_('Warning!'), _('%sSurvey is not in open state') % msg) data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \ \n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s \n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,''' - data['mail_subject'] = "Invitation for " + sur.title - data['mail_subject_existing'] = "Invitation for " + sur.title return data def create_report(self, cr, uid, res_ids, report_name=False, file_name=False): From 064d80917e76d52e133b6609cdc3ce3fbaf9d4f9 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Wed, 3 Oct 2012 17:19:46 +0530 Subject: [PATCH 016/154] [IMP] change old port 8080 bzr revid: fka@tinyerp.com-20121003114946-n25y3i5yx2s3bild --- addons/survey/wizard/survey_send_invitation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py index 8c9bb2a7fbe..b6d68a47004 100644 --- a/addons/survey/wizard/survey_send_invitation.py +++ b/addons/survey/wizard/survey_send_invitation.py @@ -74,7 +74,7 @@ class survey_send_invitation(osv.osv_memory): raise osv.except_osv(_('Warning!'), _('%sSurvey is not in open state') % msg) data['mail'] = '''Hello %(name)s, \n\n We are inviting you for following survey. \ \n ''' + name + '''\n Your login ID: %(login)s, Your password: %(passwd)s - \n link :- http://'''+ str(socket.gethostname()) + ''':8080 \n\n Thanks,''' + \n link :- http://'''+ str(socket.gethostname()) + ''':8069 \n\n Thanks,''' return data def create_report(self, cr, uid, res_ids, report_name=False, file_name=False): From c2eb5616b7ed3ffb84ef1094b8296b20e5ab9174 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 4 Oct 2012 14:43:51 +0530 Subject: [PATCH 017/154] [IMP] improve code bzr revid: fka@tinyerp.com-20121004091351-sky1or0w62lqmf1d --- addons/survey/survey.py | 10 ++++++---- addons/survey/survey_demo.xml | 3 +++ addons/survey/survey_view.xml | 3 +++ 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index 6e350ccf9ce..b3d38aeeb4d 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -53,6 +53,7 @@ class survey(osv.osv): 'id': fields.integer('ID'), 'title': fields.char('Survey Title', size=128, required=1), 'page_ids': fields.one2many('survey.page', 'survey_id', 'Page'), + 'date_open': fields.datetime('Survey Open Date', readonly=1), 'date_close': fields.datetime('Survey Close Date', readonly=1), 'max_response_limit': fields.integer('Maximum Answer Limit', help="Set to one if survey is answerable only once"), @@ -60,10 +61,10 @@ class survey(osv.osv): help="Set to one if you require only one Answer per user"), 'state': fields.selection([('open', 'Open'), ('cancel', 'Cancelled'),('close', 'Closed') ], 'Status', readonly=True), 'responsible_id': fields.many2one('res.users', 'Responsible', help="User responsible for survey"), - 'tot_start_survey': fields.integer("Total Started Survey"), - 'tot_comp_survey': fields.integer("Total Completed Survey"), + 'tot_start_survey': fields.integer("Total Started Survey", readonly=1), + 'tot_comp_survey': fields.integer("Total Completed Survey", readonly=1), 'note': fields.text('Description', size=128), - 'history': fields.one2many('survey.history', 'survey_id', 'History Lines'), + 'history': fields.one2many('survey.history', 'survey_id', 'History Lines', readonly=True), 'users': fields.many2many('res.users', 'survey_users_rel', 'sid', 'uid', 'Users'), 'send_response': fields.boolean('Email Notification on Answer'), 'type': fields.many2one('survey.type', 'Type'), @@ -76,10 +77,11 @@ class survey(osv.osv): 'tot_comp_survey': lambda * a: 0, 'send_response': lambda * a: 1, 'response_user': lambda * a:1, + 'date_open': strftime("%Y-%m-%d %H:%M:%S"), } def survey_open(self, cr, uid, ids, arg): - self.write(cr, uid, ids, {'state': 'open'}) + self.write(cr, uid, ids, {'state': 'open', 'date_open': strftime("%Y-%m-%d %H:%M:%S")}) return True def survey_close(self, cr, uid, ids, arg): diff --git a/addons/survey/survey_demo.xml b/addons/survey/survey_demo.xml index f9a3e8f3159..6f89095c699 100644 --- a/addons/survey/survey_demo.xml +++ b/addons/survey/survey_demo.xml @@ -17,6 +17,7 @@ 1 1 5 + @@ -165,6 +166,7 @@ 1 1 5 + @@ -631,6 +633,7 @@ 1 1 5 + diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index a03df6800e7..e6d92b72ba1 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -220,6 +220,7 @@ + @@ -252,6 +253,7 @@ + @@ -293,6 +295,7 @@ + From 9dd89df9ce1132de0174ea56145237f9006787e8 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Thu, 4 Oct 2012 16:47:03 +0530 Subject: [PATCH 018/154] [IMP] make all fields readable in close state bzr revid: fka@tinyerp.com-20121004111703-nrzz774gjydu0oo8 --- addons/survey/survey_view.xml | 14 +++++++------- addons/survey/wizard/survey_answer.py | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/survey/survey_view.xml b/addons/survey/survey_view.xml index e6d92b72ba1..c0bf7d25b7b 100644 --- a/addons/survey/survey_view.xml +++ b/addons/survey/survey_view.xml @@ -38,15 +38,15 @@
- - - + + + @@ -55,7 +55,7 @@ - + - + - + diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 76d2f012be8..5a027601446 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -429,7 +429,7 @@ class survey_question_wiz(osv.osv_memory): vals['attachment_ids'] = [(0,0,{'name': a_name, 'datas_fname': a_name, 'datas': str(a_content).encode('base64')}) - for a_name, a_content in attachments] + for a_name, a_content in attachments.items()] self.pool.get('mail.mail').create(cr, uid, vals, context=context) xml_form = etree.Element('form', {'string': _('Complete Survey Answer')}) From f07e90b5cbfa0fbd8f8b57fa097bb5ba8f93a2cd Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 5 Oct 2012 11:08:34 +0530 Subject: [PATCH 019/154] [IMP] solve error When click on Edit Survey bzr revid: fka@tinyerp.com-20121005053834-62y619ae1xe10ojg --- addons/survey/wizard/survey_answer.py | 43 ++++++++++++++------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 5a027601446..10ab4bf82da 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -112,26 +112,29 @@ class survey_question_wiz(osv.osv_memory): flag = False fields = {} if sur_name_read.page == "next" or sur_name_rec.page_no == -1: - if total_pages > sur_name_rec.page_no + 1: - if ((context.has_key('active') and not context.get('active', False)) \ - or not context.has_key('active')) and not sur_name_rec.page_no + 1: - if sur_rec.state != "open" : - raise osv.except_osv(_('Warning!'),_("You cannot answer because the survey is not open.")) - cr.execute('select count(id) from survey_history where user_id=%s\ - and survey_id=%s', (uid,survey_id)) - res = cr.fetchone()[0] - user_limit = survey_obj.browse(cr, uid, survey_id) - user_limit = user_limit.response_user - if user_limit and res >= user_limit: - raise osv.except_osv(_('Warning!'),_("You cannot answer this survey more than %s times.") % (user_limit)) - - if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey and not sur_name_rec.page_no + 1: - survey_obj.write(cr, uid, survey_id, {'state':'close', 'date_close':strftime("%Y-%m-%d %H:%M:%S")}) - - p_id = p_id[sur_name_rec.page_no + 1] - surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'page_no' : sur_name_rec.page_no + 1}) - flag = True - page_number += 1 + if total_pages: + if total_pages > sur_name_rec.page_no + 1: + if ((context.has_key('active') and not context.get('active', False)) \ + or not context.has_key('active')) and not sur_name_rec.page_no + 1: + if sur_rec.state != "open" : + raise osv.except_osv(_('Warning!'),_("You cannot answer because the survey is not open.")) + cr.execute('select count(id) from survey_history where user_id=%s\ + and survey_id=%s', (uid,survey_id)) + res = cr.fetchone()[0] + user_limit = survey_obj.browse(cr, uid, survey_id) + user_limit = user_limit.response_user + if user_limit and res >= user_limit: + raise osv.except_osv(_('Warning!'),_("You cannot answer this survey more than %s times.") % (user_limit)) + + if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey and not sur_name_rec.page_no + 1: + survey_obj.write(cr, uid, survey_id, {'state':'close', 'date_close':strftime("%Y-%m-%d %H:%M:%S")}) + + p_id = p_id[sur_name_rec.page_no + 1] + surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'page_no' : sur_name_rec.page_no + 1}) + flag = True + page_number += 1 + else: + raise osv.except_osv(_('Warning!'),_('This survey has no pages defined. Please define the pages first.')) if sur_name_rec.page_no > - 1: pre_button = True else: From dab351dcc7d8680b91ba99a235811958b41917dc Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 5 Oct 2012 11:53:07 +0530 Subject: [PATCH 020/154] [IMP] solve error When no pages define on test survey bzr revid: fka@tinyerp.com-20121005062307-er263zwe3mm9dgt3 --- addons/survey/survey.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/addons/survey/survey.py b/addons/survey/survey.py index b3d38aeeb4d..809079eaedb 100644 --- a/addons/survey/survey.py +++ b/addons/survey/survey.py @@ -164,10 +164,14 @@ class survey(osv.osv): 'context': context } def test_survey(self, cr, uid, ids, context=None): - sur_obj = self.read(cr, uid, ids,['title'], context=context) + sur_obj = self.read(cr, uid, ids,['title','page_ids'], context=context) for sur in sur_obj: name = sur['title'] - context.update({'active':True,'survey_id': ids[0]}) + pages = sur['page_ids'] + if not pages: + raise osv.except_osv(_('Warning!'), _('This survey has no pages defined. Please define pages first.')) + else: + context.update({'active':True,'survey_id': ids[0]}) return { 'view_type': 'form', 'view_mode': 'form', From b2661913d4ae1ca15e558ed5b8310d78a0fcc4a2 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 5 Oct 2012 16:01:36 +0530 Subject: [PATCH 021/154] [IMP] solve error When no pages define in edit survey bzr revid: fka@tinyerp.com-20121005103136-ji9uo2h4eow9aqec --- addons/survey/wizard/survey_answer.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index 5a027601446..7e1417ecdb7 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -134,6 +134,8 @@ class survey_question_wiz(osv.osv_memory): page_number += 1 if sur_name_rec.page_no > - 1: pre_button = True + else: + flag = True else: if sur_name_rec.page_no != 0: p_id = p_id[sur_name_rec.page_no - 1] @@ -146,7 +148,15 @@ class survey_question_wiz(osv.osv_memory): pre_button = True if flag: pag_rec = page_obj.browse(cr, uid, p_id, context=context) - xml_form = etree.Element('form', {'string': tools.ustr(pag_rec.title or sur_rec.title)}) + note = False + question_ids = [] + if pag_rec: + title = pag_rec.title + note = pag_rec.note + question_ids=pag_rec.question_ids + else: + title=sur_rec.title + xml_form = etree.Element('form', {'string': tools.ustr(title)}) if context.has_key('active') and context.get('active',False) and context.has_key('edit'): context.update({'page_id' : tools.ustr(p_id),'page_number' : sur_name_rec.page_no , 'transfer' : sur_name_read.transfer}) xml_group3 = etree.SubElement(xml_form, 'group', {'col': '4', 'colspan': '4'}) @@ -174,10 +184,10 @@ class survey_question_wiz(osv.osv_memory): fields["wizardid_" + str(wiz_id)] = {'type':'char', 'size' : 255, 'string':"", 'views':{}} etree.SubElement(xml_form, 'field', {'invisible':'1','name': "wizardid_" + str(wiz_id),'default':str(lambda *a: 0),'modifiers':'{"invisible":true}'}) - if pag_rec.note: - for que_test in pag_rec.note.split('\n'): + if note: + for que_test in note.split('\n'): etree.SubElement(xml_form, 'label', {'string': to_xml(tools.ustr(que_test)), 'align':"0.0"}) - que_ids = pag_rec.question_ids + que_ids = question_ids qu_no = 0 for que in que_ids: From 09e5d404df56c542e7f9f8b6256d77183797b9ba Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 14:18:04 +0530 Subject: [PATCH 022/154] [IMP] mail : Improved the terminologies. bzr revid: mdi@tinyerp.com-20121008084804-9mmxzdlyxhyarf0j --- addons/mail/mail_message.py | 4 ++-- addons/mail/mail_thread_view.xml | 2 +- addons/mail/wizard/mail_compose_message_view.xml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index bbf68509277..61ea9fb9f6b 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -580,11 +580,11 @@ class mail_message(osv.Model): partner_wo_email_lst.append(partner) if not partner_wo_email_lst: return {} - warning_msg = _('The following partners chosen as recipients for the email have no email address linked :') + warning_msg = _('The following contacts do not have an email address specified.') for partner in partner_wo_email_lst: warning_msg += '\n- %s' % (partner.name) return {'warning': { - 'title': _('Partners email addresses not found'), + 'title': _('Email not found'), 'message': warning_msg, } } diff --git a/addons/mail/mail_thread_view.xml b/addons/mail/mail_thread_view.xml index 3507e7c449f..5f504f3c3da 100644 --- a/addons/mail/mail_thread_view.xml +++ b/addons/mail/mail_thread_view.xml @@ -9,7 +9,7 @@ sequence="10"/> - + diff --git a/addons/mail/wizard/mail_compose_message_view.xml b/addons/mail/wizard/mail_compose_message_view.xml index 0f384dc5a0d..c7b9ed36a39 100644 --- a/addons/mail/wizard/mail_compose_message_view.xml +++ b/addons/mail/wizard/mail_compose_message_view.xml @@ -58,10 +58,10 @@ - - Date: Mon, 8 Oct 2012 14:35:29 +0530 Subject: [PATCH 023/154] [IMP] mail : Partners should always be replaced with Customer, Supplier, or Contact (if it can be both). bzr revid: mdi@tinyerp.com-20121008090529-pi43dm3zxc1jsqbm --- addons/mail/mail_message.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 61ea9fb9f6b..68e40ef705c 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -580,8 +580,13 @@ class mail_message(osv.Model): partner_wo_email_lst.append(partner) if not partner_wo_email_lst: return {} - warning_msg = _('The following contacts do not have an email address specified.') for partner in partner_wo_email_lst: + terminology = 'Contact' + if partner.customer and not partner.supplier: + terminology = 'Customer' + elif partner.supplier and not partner.customer: + terminology = 'Supplier' + warning_msg = _('The following %s do not have an email address specified.') % (terminology,) warning_msg += '\n- %s' % (partner.name) return {'warning': { 'title': _('Email not found'), From 65e70487c2842b72a2236876650a3dc4e595808f Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 14:40:18 +0530 Subject: [PATCH 024/154] [IMP] mail : Partners should always be replaced with Customer, Supplier, or Contact (if it can be both). bzr revid: mdi@tinyerp.com-20121008091018-s116zi83vwfqkngy --- addons/mail/mail_message.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index 68e40ef705c..df169f94404 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -581,11 +581,11 @@ class mail_message(osv.Model): if not partner_wo_email_lst: return {} for partner in partner_wo_email_lst: - terminology = 'Contact' + terminology = 'contact' if partner.customer and not partner.supplier: - terminology = 'Customer' + terminology = 'customer' elif partner.supplier and not partner.customer: - terminology = 'Supplier' + terminology = 'supplier' warning_msg = _('The following %s do not have an email address specified.') % (terminology,) warning_msg += '\n- %s' % (partner.name) return {'warning': { From 39eea5b86c60ba3f3314d3397eadbbe00f6c1beb Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 15:00:50 +0530 Subject: [PATCH 025/154] [IMP] procurement : 'Compute schedulers' should be 'Run schedulers'. bzr revid: mdi@tinyerp.com-20121008093050-xvhx0vtz010xk2qg --- addons/procurement/wizard/schedulers_all_view.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/procurement/wizard/schedulers_all_view.xml b/addons/procurement/wizard/schedulers_all_view.xml index 2e72dfdbadc..321f05bb223 100644 --- a/addons/procurement/wizard/schedulers_all_view.xml +++ b/addons/procurement/wizard/schedulers_all_view.xml @@ -2,10 +2,10 @@ - + - Compute Schedulers + Run Schedulers procurement.order.compute.all
@@ -13,7 +13,7 @@
-
@@ -21,7 +21,7 @@
- Date: Mon, 8 Oct 2012 15:44:22 +0530 Subject: [PATCH 026/154] [IMP]all : improve string bzr revid: mma@tinyerp.com-20121008101422-hen3r94996e6pzye --- addons/base_calendar/base_calendar.py | 6 ++--- addons/base_calendar/crm_meeting_view.xml | 2 +- .../crm_partner_assign/res_partner_view.xml | 2 +- addons/hr_expense/hr_expense.py | 2 +- addons/membership/membership.py | 2 +- addons/product/product_view.xml | 4 ++-- addons/sale/sale_view.xml | 22 +++++++++++++++++-- 7 files changed, 29 insertions(+), 11 deletions(-) diff --git a/addons/base_calendar/base_calendar.py b/addons/base_calendar/base_calendar.py index 5b8c41787d4..bcfb9340966 100644 --- a/addons/base_calendar/base_calendar.py +++ b/addons/base_calendar/base_calendar.py @@ -1016,9 +1016,9 @@ defines the list of date/time exceptions for a recurring calendar component."), rule or repeating pattern of time to exclude from the recurring rule."), 'rrule': fields.function(_get_rulestring, type='char', size=124, \ fnct_inv=_rrule_write, store=True, string='Recurrent Rule'), - 'rrule_type': fields.selection([('none', ''), ('daily', 'Daily'), \ - ('weekly', 'Weekly'), ('monthly', 'Monthly'), \ - ('yearly', 'Yearly'),], + 'rrule_type': fields.selection([('none', ''), ('daily', 'Day(s)'), \ + ('weekly', 'Week(s)'), ('monthly', 'Month(s)'), \ + ('yearly', 'Year(s)'),], 'Recurrency', states={'done': [('readonly', True)]}, help="Let the event automatically repeat at that interval"), 'alarm_id': fields.many2one('res.alarm', 'Reminder', states={'done': [('readonly', True)]}, diff --git a/addons/base_calendar/crm_meeting_view.xml b/addons/base_calendar/crm_meeting_view.xml index adcfc23a520..26c11262a2c 100644 --- a/addons/base_calendar/crm_meeting_view.xml +++ b/addons/base_calendar/crm_meeting_view.xml @@ -86,7 +86,7 @@ - + diff --git a/addons/crm_partner_assign/res_partner_view.xml b/addons/crm_partner_assign/res_partner_view.xml index f5a1e9aad25..d1e72432550 100644 --- a/addons/crm_partner_assign/res_partner_view.xml +++ b/addons/crm_partner_assign/res_partner_view.xml @@ -77,7 +77,7 @@ - + diff --git a/addons/hr_expense/hr_expense.py b/addons/hr_expense/hr_expense.py index 91dc44fed61..a0d133aef86 100644 --- a/addons/hr_expense/hr_expense.py +++ b/addons/hr_expense/hr_expense.py @@ -233,7 +233,7 @@ hr_expense_expense() class product_product(osv.osv): _inherit = "product.product" _columns = { - 'hr_expense_ok': fields.boolean('Can Constitute an Expense', help="Determines if the product can be visible in the list of product within a selection from an HR expense sheet line."), + 'hr_expense_ok': fields.boolean('Can be Expensed', help="Determines if the product can be visible in the list of product within a selection from an HR expense sheet line."), } def on_change_hr_expense_ok(self, cr, uid, id, hr_expense_ok): diff --git a/addons/membership/membership.py b/addons/membership/membership.py index 87af723f2f9..f3192948afc 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -323,7 +323,7 @@ class Partner(osv.osv): help = 'The price negotiated by the partner'), 'membership_state': fields.function( __get_membership_state, - string = 'Current Membership State', type = 'selection', + string = 'Current Membership Status', type = 'selection', selection = STATE, store = { 'account.invoice': (_get_invoice_partner, ['state'], 10), diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 8c19aee026f..266a70e0fe3 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -144,7 +144,7 @@ - + @@ -763,7 +763,7 @@ - + diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 5505a6a88b5..920e64d46da 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -131,7 +131,24 @@ - + + + + + + + + + + + + sale.order.tree + sale.order + 2 + + + + @@ -358,7 +375,7 @@ - Sales Orders + Sale Orders ir.actions.act_window sale.order form @@ -405,6 +422,7 @@ ir.actions.act_window sale.order form + tree,form,calendar,graph {'show_address': 1} [('state','in',('draft','sent','cancel'))] From 31336151de7d65cbc2fe324c071d7167d1ae72ec Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 15:58:36 +0530 Subject: [PATCH 027/154] [IMP] mrp_byproduct : Renamed 'subproduct' to 'byproduct'. bzr revid: mdi@tinyerp.com-20121008102836-rwd3ooy413yxqou8 --- addons/{mrp_subproduct => mrp_byproduct}/__init__.py | 2 +- .../{mrp_subproduct => mrp_byproduct}/__openerp__.py | 10 +++++----- addons/{mrp_subproduct => mrp_byproduct}/i18n/ab.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ar.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/bg.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/bs.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ca.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/cs.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/da.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/de.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es_AR.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es_CR.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es_EC.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es_MX.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/es_VE.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/et.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/fi.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/fr.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/gl.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/hr.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/hu.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/id.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/it.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ja.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ko.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/lt.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/mn.po | 0 .../i18n/mrp_subproduct.pot | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/nb.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/nl.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/nl_BE.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/oc.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/pl.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/pt.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/pt_BR.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ro.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/ru.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/sk.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/sl.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/sq.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/sr.po | 0 .../{mrp_subproduct => mrp_byproduct}/i18n/sr@latin.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/sv.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/tlh.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/tr.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/uk.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/vi.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/zh_CN.po | 0 addons/{mrp_subproduct => mrp_byproduct}/i18n/zh_TW.po | 0 .../mrp_byproduct.py} | 10 +++++----- .../mrp_byproduct_view.xml} | 6 +++--- .../security/ir.model.access.csv | 0 .../test/mrp_byproduct.yml} | 0 54 files changed, 14 insertions(+), 14 deletions(-) rename addons/{mrp_subproduct => mrp_byproduct}/__init__.py (97%) rename addons/{mrp_subproduct => mrp_byproduct}/__openerp__.py (88%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ab.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ar.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/bg.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/bs.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ca.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/cs.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/da.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/de.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es_AR.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es_CR.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es_EC.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es_MX.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/es_VE.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/et.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/fi.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/fr.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/gl.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/hr.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/hu.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/id.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/it.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ja.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ko.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/lt.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/mn.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/mrp_subproduct.pot (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/nb.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/nl.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/nl_BE.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/oc.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/pl.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/pt.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/pt_BR.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ro.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/ru.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sk.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sl.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sq.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sr.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sr@latin.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/sv.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/tlh.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/tr.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/uk.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/vi.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/zh_CN.po (100%) rename addons/{mrp_subproduct => mrp_byproduct}/i18n/zh_TW.po (100%) rename addons/{mrp_subproduct/mrp_subproduct.py => mrp_byproduct/mrp_byproduct.py} (92%) rename addons/{mrp_subproduct/mrp_subproduct_view.xml => mrp_byproduct/mrp_byproduct_view.xml} (86%) rename addons/{mrp_subproduct => mrp_byproduct}/security/ir.model.access.csv (100%) rename addons/{mrp_subproduct/test/mrp_subproduct.yml => mrp_byproduct/test/mrp_byproduct.yml} (100%) diff --git a/addons/mrp_subproduct/__init__.py b/addons/mrp_byproduct/__init__.py similarity index 97% rename from addons/mrp_subproduct/__init__.py rename to addons/mrp_byproduct/__init__.py index 5b48431ef16..7e507e0fe0a 100644 --- a/addons/mrp_subproduct/__init__.py +++ b/addons/mrp_byproduct/__init__.py @@ -18,5 +18,5 @@ # along with this program. If not, see . # ############################################################################## -import mrp_subproduct +import mrp_byproduct # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/mrp_subproduct/__openerp__.py b/addons/mrp_byproduct/__openerp__.py similarity index 88% rename from addons/mrp_subproduct/__openerp__.py rename to addons/mrp_byproduct/__openerp__.py index 6475cbe4a91..58e7a194771 100644 --- a/addons/mrp_subproduct/__openerp__.py +++ b/addons/mrp_byproduct/__openerp__.py @@ -21,14 +21,14 @@ { - 'name': 'MRP Subproducts', + 'name': 'MRP Byproducts', 'version': '1.0', 'category': 'Manufacturing', 'description': """ This module allows you to produce several products from one production order. ============================================================================= -You can configure sub-products in the bill of material. +You can configure by-products in the bill of material. Without this module: -------------------- @@ -40,14 +40,14 @@ With this module: """, 'author': 'OpenERP SA', 'website': 'http://www.openerp.com', - 'images': ['images/bom_subproduct.jpeg'], + 'images': ['images/bom_byproduct.jpeg'], 'depends': ['base', 'mrp'], 'data': [ 'security/ir.model.access.csv', - 'mrp_subproduct_view.xml' + 'mrp_byproduct_view.xml' ], 'demo': [], - 'test': ['test/mrp_subproduct.yml'], + 'test': ['test/mrp_byproduct.yml'], 'installable': True, 'auto_install': False, } diff --git a/addons/mrp_subproduct/i18n/ab.po b/addons/mrp_byproduct/i18n/ab.po similarity index 100% rename from addons/mrp_subproduct/i18n/ab.po rename to addons/mrp_byproduct/i18n/ab.po diff --git a/addons/mrp_subproduct/i18n/ar.po b/addons/mrp_byproduct/i18n/ar.po similarity index 100% rename from addons/mrp_subproduct/i18n/ar.po rename to addons/mrp_byproduct/i18n/ar.po diff --git a/addons/mrp_subproduct/i18n/bg.po b/addons/mrp_byproduct/i18n/bg.po similarity index 100% rename from addons/mrp_subproduct/i18n/bg.po rename to addons/mrp_byproduct/i18n/bg.po diff --git a/addons/mrp_subproduct/i18n/bs.po b/addons/mrp_byproduct/i18n/bs.po similarity index 100% rename from addons/mrp_subproduct/i18n/bs.po rename to addons/mrp_byproduct/i18n/bs.po diff --git a/addons/mrp_subproduct/i18n/ca.po b/addons/mrp_byproduct/i18n/ca.po similarity index 100% rename from addons/mrp_subproduct/i18n/ca.po rename to addons/mrp_byproduct/i18n/ca.po diff --git a/addons/mrp_subproduct/i18n/cs.po b/addons/mrp_byproduct/i18n/cs.po similarity index 100% rename from addons/mrp_subproduct/i18n/cs.po rename to addons/mrp_byproduct/i18n/cs.po diff --git a/addons/mrp_subproduct/i18n/da.po b/addons/mrp_byproduct/i18n/da.po similarity index 100% rename from addons/mrp_subproduct/i18n/da.po rename to addons/mrp_byproduct/i18n/da.po diff --git a/addons/mrp_subproduct/i18n/de.po b/addons/mrp_byproduct/i18n/de.po similarity index 100% rename from addons/mrp_subproduct/i18n/de.po rename to addons/mrp_byproduct/i18n/de.po diff --git a/addons/mrp_subproduct/i18n/es.po b/addons/mrp_byproduct/i18n/es.po similarity index 100% rename from addons/mrp_subproduct/i18n/es.po rename to addons/mrp_byproduct/i18n/es.po diff --git a/addons/mrp_subproduct/i18n/es_AR.po b/addons/mrp_byproduct/i18n/es_AR.po similarity index 100% rename from addons/mrp_subproduct/i18n/es_AR.po rename to addons/mrp_byproduct/i18n/es_AR.po diff --git a/addons/mrp_subproduct/i18n/es_CR.po b/addons/mrp_byproduct/i18n/es_CR.po similarity index 100% rename from addons/mrp_subproduct/i18n/es_CR.po rename to addons/mrp_byproduct/i18n/es_CR.po diff --git a/addons/mrp_subproduct/i18n/es_EC.po b/addons/mrp_byproduct/i18n/es_EC.po similarity index 100% rename from addons/mrp_subproduct/i18n/es_EC.po rename to addons/mrp_byproduct/i18n/es_EC.po diff --git a/addons/mrp_subproduct/i18n/es_MX.po b/addons/mrp_byproduct/i18n/es_MX.po similarity index 100% rename from addons/mrp_subproduct/i18n/es_MX.po rename to addons/mrp_byproduct/i18n/es_MX.po diff --git a/addons/mrp_subproduct/i18n/es_VE.po b/addons/mrp_byproduct/i18n/es_VE.po similarity index 100% rename from addons/mrp_subproduct/i18n/es_VE.po rename to addons/mrp_byproduct/i18n/es_VE.po diff --git a/addons/mrp_subproduct/i18n/et.po b/addons/mrp_byproduct/i18n/et.po similarity index 100% rename from addons/mrp_subproduct/i18n/et.po rename to addons/mrp_byproduct/i18n/et.po diff --git a/addons/mrp_subproduct/i18n/fi.po b/addons/mrp_byproduct/i18n/fi.po similarity index 100% rename from addons/mrp_subproduct/i18n/fi.po rename to addons/mrp_byproduct/i18n/fi.po diff --git a/addons/mrp_subproduct/i18n/fr.po b/addons/mrp_byproduct/i18n/fr.po similarity index 100% rename from addons/mrp_subproduct/i18n/fr.po rename to addons/mrp_byproduct/i18n/fr.po diff --git a/addons/mrp_subproduct/i18n/gl.po b/addons/mrp_byproduct/i18n/gl.po similarity index 100% rename from addons/mrp_subproduct/i18n/gl.po rename to addons/mrp_byproduct/i18n/gl.po diff --git a/addons/mrp_subproduct/i18n/hr.po b/addons/mrp_byproduct/i18n/hr.po similarity index 100% rename from addons/mrp_subproduct/i18n/hr.po rename to addons/mrp_byproduct/i18n/hr.po diff --git a/addons/mrp_subproduct/i18n/hu.po b/addons/mrp_byproduct/i18n/hu.po similarity index 100% rename from addons/mrp_subproduct/i18n/hu.po rename to addons/mrp_byproduct/i18n/hu.po diff --git a/addons/mrp_subproduct/i18n/id.po b/addons/mrp_byproduct/i18n/id.po similarity index 100% rename from addons/mrp_subproduct/i18n/id.po rename to addons/mrp_byproduct/i18n/id.po diff --git a/addons/mrp_subproduct/i18n/it.po b/addons/mrp_byproduct/i18n/it.po similarity index 100% rename from addons/mrp_subproduct/i18n/it.po rename to addons/mrp_byproduct/i18n/it.po diff --git a/addons/mrp_subproduct/i18n/ja.po b/addons/mrp_byproduct/i18n/ja.po similarity index 100% rename from addons/mrp_subproduct/i18n/ja.po rename to addons/mrp_byproduct/i18n/ja.po diff --git a/addons/mrp_subproduct/i18n/ko.po b/addons/mrp_byproduct/i18n/ko.po similarity index 100% rename from addons/mrp_subproduct/i18n/ko.po rename to addons/mrp_byproduct/i18n/ko.po diff --git a/addons/mrp_subproduct/i18n/lt.po b/addons/mrp_byproduct/i18n/lt.po similarity index 100% rename from addons/mrp_subproduct/i18n/lt.po rename to addons/mrp_byproduct/i18n/lt.po diff --git a/addons/mrp_subproduct/i18n/mn.po b/addons/mrp_byproduct/i18n/mn.po similarity index 100% rename from addons/mrp_subproduct/i18n/mn.po rename to addons/mrp_byproduct/i18n/mn.po diff --git a/addons/mrp_subproduct/i18n/mrp_subproduct.pot b/addons/mrp_byproduct/i18n/mrp_subproduct.pot similarity index 100% rename from addons/mrp_subproduct/i18n/mrp_subproduct.pot rename to addons/mrp_byproduct/i18n/mrp_subproduct.pot diff --git a/addons/mrp_subproduct/i18n/nb.po b/addons/mrp_byproduct/i18n/nb.po similarity index 100% rename from addons/mrp_subproduct/i18n/nb.po rename to addons/mrp_byproduct/i18n/nb.po diff --git a/addons/mrp_subproduct/i18n/nl.po b/addons/mrp_byproduct/i18n/nl.po similarity index 100% rename from addons/mrp_subproduct/i18n/nl.po rename to addons/mrp_byproduct/i18n/nl.po diff --git a/addons/mrp_subproduct/i18n/nl_BE.po b/addons/mrp_byproduct/i18n/nl_BE.po similarity index 100% rename from addons/mrp_subproduct/i18n/nl_BE.po rename to addons/mrp_byproduct/i18n/nl_BE.po diff --git a/addons/mrp_subproduct/i18n/oc.po b/addons/mrp_byproduct/i18n/oc.po similarity index 100% rename from addons/mrp_subproduct/i18n/oc.po rename to addons/mrp_byproduct/i18n/oc.po diff --git a/addons/mrp_subproduct/i18n/pl.po b/addons/mrp_byproduct/i18n/pl.po similarity index 100% rename from addons/mrp_subproduct/i18n/pl.po rename to addons/mrp_byproduct/i18n/pl.po diff --git a/addons/mrp_subproduct/i18n/pt.po b/addons/mrp_byproduct/i18n/pt.po similarity index 100% rename from addons/mrp_subproduct/i18n/pt.po rename to addons/mrp_byproduct/i18n/pt.po diff --git a/addons/mrp_subproduct/i18n/pt_BR.po b/addons/mrp_byproduct/i18n/pt_BR.po similarity index 100% rename from addons/mrp_subproduct/i18n/pt_BR.po rename to addons/mrp_byproduct/i18n/pt_BR.po diff --git a/addons/mrp_subproduct/i18n/ro.po b/addons/mrp_byproduct/i18n/ro.po similarity index 100% rename from addons/mrp_subproduct/i18n/ro.po rename to addons/mrp_byproduct/i18n/ro.po diff --git a/addons/mrp_subproduct/i18n/ru.po b/addons/mrp_byproduct/i18n/ru.po similarity index 100% rename from addons/mrp_subproduct/i18n/ru.po rename to addons/mrp_byproduct/i18n/ru.po diff --git a/addons/mrp_subproduct/i18n/sk.po b/addons/mrp_byproduct/i18n/sk.po similarity index 100% rename from addons/mrp_subproduct/i18n/sk.po rename to addons/mrp_byproduct/i18n/sk.po diff --git a/addons/mrp_subproduct/i18n/sl.po b/addons/mrp_byproduct/i18n/sl.po similarity index 100% rename from addons/mrp_subproduct/i18n/sl.po rename to addons/mrp_byproduct/i18n/sl.po diff --git a/addons/mrp_subproduct/i18n/sq.po b/addons/mrp_byproduct/i18n/sq.po similarity index 100% rename from addons/mrp_subproduct/i18n/sq.po rename to addons/mrp_byproduct/i18n/sq.po diff --git a/addons/mrp_subproduct/i18n/sr.po b/addons/mrp_byproduct/i18n/sr.po similarity index 100% rename from addons/mrp_subproduct/i18n/sr.po rename to addons/mrp_byproduct/i18n/sr.po diff --git a/addons/mrp_subproduct/i18n/sr@latin.po b/addons/mrp_byproduct/i18n/sr@latin.po similarity index 100% rename from addons/mrp_subproduct/i18n/sr@latin.po rename to addons/mrp_byproduct/i18n/sr@latin.po diff --git a/addons/mrp_subproduct/i18n/sv.po b/addons/mrp_byproduct/i18n/sv.po similarity index 100% rename from addons/mrp_subproduct/i18n/sv.po rename to addons/mrp_byproduct/i18n/sv.po diff --git a/addons/mrp_subproduct/i18n/tlh.po b/addons/mrp_byproduct/i18n/tlh.po similarity index 100% rename from addons/mrp_subproduct/i18n/tlh.po rename to addons/mrp_byproduct/i18n/tlh.po diff --git a/addons/mrp_subproduct/i18n/tr.po b/addons/mrp_byproduct/i18n/tr.po similarity index 100% rename from addons/mrp_subproduct/i18n/tr.po rename to addons/mrp_byproduct/i18n/tr.po diff --git a/addons/mrp_subproduct/i18n/uk.po b/addons/mrp_byproduct/i18n/uk.po similarity index 100% rename from addons/mrp_subproduct/i18n/uk.po rename to addons/mrp_byproduct/i18n/uk.po diff --git a/addons/mrp_subproduct/i18n/vi.po b/addons/mrp_byproduct/i18n/vi.po similarity index 100% rename from addons/mrp_subproduct/i18n/vi.po rename to addons/mrp_byproduct/i18n/vi.po diff --git a/addons/mrp_subproduct/i18n/zh_CN.po b/addons/mrp_byproduct/i18n/zh_CN.po similarity index 100% rename from addons/mrp_subproduct/i18n/zh_CN.po rename to addons/mrp_byproduct/i18n/zh_CN.po diff --git a/addons/mrp_subproduct/i18n/zh_TW.po b/addons/mrp_byproduct/i18n/zh_TW.po similarity index 100% rename from addons/mrp_subproduct/i18n/zh_TW.po rename to addons/mrp_byproduct/i18n/zh_TW.po diff --git a/addons/mrp_subproduct/mrp_subproduct.py b/addons/mrp_byproduct/mrp_byproduct.py similarity index 92% rename from addons/mrp_subproduct/mrp_subproduct.py rename to addons/mrp_byproduct/mrp_byproduct.py index bacdeb2c675..bf2a798aeff 100644 --- a/addons/mrp_subproduct/mrp_subproduct.py +++ b/addons/mrp_byproduct/mrp_byproduct.py @@ -30,10 +30,10 @@ class mrp_subproduct(osv.osv): 'product_id': fields.many2one('product.product', 'Product', required=True), 'product_qty': fields.float('Product Qty', digits_compute=dp.get_precision('Product Unit of Measure'), required=True), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), - 'subproduct_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Quantity Type', required=True, help="Define how the quantity of subproducts will be set on the production orders using this BoM.\ - 'Fixed' depicts a situation where the quantity of created subproduct is always equal to the quantity set on the BoM, regardless of how many are created in the production order.\ + 'subproduct_type': fields.selection([('fixed','Fixed'),('variable','Variable')], 'Quantity Type', required=True, help="Define how the quantity of byproducts will be set on the production orders using this BoM.\ + 'Fixed' depicts a situation where the quantity of created byproduct is always equal to the quantity set on the BoM, regardless of how many are created in the production order.\ By opposition, 'Variable' means that the quantity will be computed as\ - '(quantity of subproduct set on the BoM / quantity of manufactured product set on the BoM * quantity of manufactured product in the production order.)'"), + '(quantity of byproduct set on the BoM / quantity of manufactured product set on the BoM * quantity of manufactured product in the production order.)'"), 'bom_id': fields.many2one('mrp.bom', 'BoM'), } _defaults={ @@ -59,7 +59,7 @@ class mrp_bom(osv.osv): _inherit='mrp.bom' _columns={ - 'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'sub_products'), + 'sub_products':fields.one2many('mrp.subproduct', 'bom_id', 'Byproducts'), } mrp_bom() @@ -106,7 +106,7 @@ class mrp_production(osv.osv): def _get_subproduct_factor(self, cr, uid, production_id, move_id=None, context=None): """Compute the factor to compute the qty of procucts to produce for the given production_id. By default, it's always equal to the quantity encoded in the production order or the production wizard, but with - the module mrp_subproduct installed it can differ for subproducts having type 'variable'. + the module mrp_byproduct installed it can differ for byproducts having type 'variable'. :param production_id: ID of the mrp.order :param move_id: ID of the stock move that needs to be produced. Identify the product to produce. :return: The factor to apply to the quantity that we should produce for the given production order and stock move. diff --git a/addons/mrp_subproduct/mrp_subproduct_view.xml b/addons/mrp_byproduct/mrp_byproduct_view.xml similarity index 86% rename from addons/mrp_subproduct/mrp_subproduct_view.xml rename to addons/mrp_byproduct/mrp_byproduct_view.xml index 94da87ef0de..754d7ef1b34 100644 --- a/addons/mrp_subproduct/mrp_subproduct_view.xml +++ b/addons/mrp_byproduct/mrp_byproduct_view.xml @@ -7,15 +7,15 @@ - + - + - + diff --git a/addons/mrp_subproduct/security/ir.model.access.csv b/addons/mrp_byproduct/security/ir.model.access.csv similarity index 100% rename from addons/mrp_subproduct/security/ir.model.access.csv rename to addons/mrp_byproduct/security/ir.model.access.csv diff --git a/addons/mrp_subproduct/test/mrp_subproduct.yml b/addons/mrp_byproduct/test/mrp_byproduct.yml similarity index 100% rename from addons/mrp_subproduct/test/mrp_subproduct.yml rename to addons/mrp_byproduct/test/mrp_byproduct.yml From 9a264c33699fae73e8d9fa139ac4df668e480910 Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 16:11:51 +0530 Subject: [PATCH 028/154] [IMP] There is no consistency throughout OpenERP with 'Source document', 'Source', 'Origin'. It should always be 'Source document'. bzr revid: mdi@tinyerp.com-20121008104151-opvu1mig2xbxxpli --- addons/account/account_invoice.py | 2 +- addons/event/event.py | 2 +- addons/purchase_requisition/purchase_requisition.py | 2 +- addons/stock/stock.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c543b493831..1df4032a3a4 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -1359,7 +1359,7 @@ class account_invoice_line(osv.osv): _description = "Invoice Line" _columns = { 'name': fields.text('Description', required=True), - 'origin': fields.char('Source', size=256, help="Reference of the document that produced this invoice."), + 'origin': fields.char('Source Document', size=256, help="Reference of the document that produced this invoice."), 'invoice_id': fields.many2one('account.invoice', 'Invoice Reference', ondelete='cascade', select=True), 'uos_id': fields.many2one('product.uom', 'Unit of Measure', ondelete='set null'), 'product_id': fields.many2one('product.product', 'Product', ondelete='set null'), diff --git a/addons/event/event.py b/addons/event/event.py index d86fd92d054..e7b562f4c2e 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -327,7 +327,7 @@ class event_registration(osv.osv): _inherit = ['ir.needaction_mixin','mail.thread'] _columns = { 'id': fields.integer('ID'), - 'origin': fields.char('Source', size=124,readonly=True,help="Name of the sale order which create the registration"), + 'origin': fields.char('Source Document', size=124,readonly=True,help="Name of the sale order which create the registration"), 'nb_register': fields.integer('Number of Participants', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'event_id': fields.many2one('event.event', 'Event', required=True, readonly=True, states={'draft': [('readonly', False)]}), 'partner_id': fields.many2one('res.partner', 'Partner', states={'done': [('readonly', True)]}), diff --git a/addons/purchase_requisition/purchase_requisition.py b/addons/purchase_requisition/purchase_requisition.py index 8954de6c1dc..ea2346d3aab 100644 --- a/addons/purchase_requisition/purchase_requisition.py +++ b/addons/purchase_requisition/purchase_requisition.py @@ -34,7 +34,7 @@ class purchase_requisition(osv.osv): _inherit = ['mail.thread', 'ir.needaction_mixin'] _columns = { 'name': fields.char('Requisition Reference', size=32,required=True), - 'origin': fields.char('Source', size=32), + 'origin': fields.char('Source Document', size=32), 'date_start': fields.datetime('Requisition Date'), 'date_end': fields.datetime('Requisition Deadline'), 'user_id': fields.many2one('res.users', 'Responsible'), diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 91e300eaa07..25a05a1f458 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -627,7 +627,7 @@ class stock_picking(osv.osv): _columns = { 'name': fields.char('Reference', size=64, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), - 'origin': fields.char('Source', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True), + 'origin': fields.char('Source Document', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True), 'backorder_id': fields.many2one('stock.picking', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, readonly=True, help="Shipping type specify, goods coming in or going out."), 'note': fields.text('Notes', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), From 9c58413280ffa5bb8e75d3f449148471d8c54bbd Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 8 Oct 2012 16:19:35 +0530 Subject: [PATCH 029/154] [IMP] mrp : In manufacturing orders, 'Consumed product' should have an 'S'. bzr revid: mdi@tinyerp.com-20121008104935-pdeix1mw0do90z19 --- addons/mrp/mrp_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index abf0f823e5c..21d4bca9955 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -692,7 +692,7 @@ - + From 79b2eae9eb6b2b72cc5029c3ac087e3d293fafef Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 8 Oct 2012 16:22:22 +0530 Subject: [PATCH 030/154] [IMP]all : improve button string bzr revid: mma@tinyerp.com-20121008105222-9n6sfk9xnerfwxgj --- addons/base_vat/base_vat_view.xml | 2 +- addons/project_gtd/project_gtd_view.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/base_vat/base_vat_view.xml b/addons/base_vat/base_vat_view.xml index ec98b7922de..6d15099dc5a 100644 --- a/addons/base_vat/base_vat_view.xml +++ b/addons/base_vat/base_vat_view.xml @@ -11,7 +11,7 @@ diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index fdb8ae8495c..da9ffebc0d4 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -93,7 +93,7 @@ - + From 9487c2d9ba9381e04c677d861864e29895f48e8e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 8 Oct 2012 16:35:49 +0530 Subject: [PATCH 031/154] [IMP]account : improve string bzr revid: mma@tinyerp.com-20121008110549-zt946y9190avok3d --- addons/account/account_invoice.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c543b493831..71f37180848 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -206,7 +206,7 @@ class account_invoice(osv.osv): ('open','Open'), ('paid','Paid'), ('cancel','Cancelled'), - ],'State', select=True, readonly=True, + ],'Status', select=True, readonly=True, help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \ \n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \ \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ From 0f2c1ef0df4cc84089a5b4982965065c3ec6e242 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 8 Oct 2012 18:50:14 +0530 Subject: [PATCH 032/154] [IMP]purchase,stock : improve string bzr revid: mma@tinyerp.com-20121008132014-iv7zc5ux9raopaip --- addons/purchase/purchase_view.xml | 6 +++--- addons/stock/stock.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index 7702d182b09..fe69c952f4a 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -82,7 +82,7 @@ action="base.action_partner_supplier_form" sequence="15"/> - @@ -262,7 +262,7 @@ - + @@ -356,7 +356,7 @@ - + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 91e300eaa07..7538f76cebd 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -627,7 +627,7 @@ class stock_picking(osv.osv): _columns = { 'name': fields.char('Reference', size=64, select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), - 'origin': fields.char('Source', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True), + 'origin': fields.char('Source Document', size=64, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="Reference of the document", select=True), 'backorder_id': fields.many2one('stock.picking', 'Back Order of', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}, help="If this shipment was split, then this field links to the shipment which contains the already processed part.", select=True), 'type': fields.selection([('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], 'Shipping Type', required=True, select=True, readonly=True, help="Shipping type specify, goods coming in or going out."), 'note': fields.text('Notes', states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), @@ -653,8 +653,8 @@ class stock_picking(osv.osv): * Cancelled: has been cancelled, can't be confirmed anymore""" ), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", - store=True, type='datetime', string='Scheduled Date', select=1, help="Scheduled date for the shipment to be processed"), - 'date': fields.datetime('Date', help="Creation date, usually the date of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), + store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled date for the shipment to be processed"), + 'date': fields.datetime('Time', help="Creation date, usually the date of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), @@ -3047,7 +3047,7 @@ class stock_picking_in(osv.osv): ('assigned', 'Ready to Receive'), ('done', 'Received'), ('cancel', 'Cancelled'),], - 'State', readonly=True, select=True, + 'Status', readonly=True, select=True, help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n * Waiting Availability: still waiting for the availability of products\n From d430a8976dc3e86efb74a97c76f93a90d49b646d Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 9 Oct 2012 10:51:31 +0530 Subject: [PATCH 033/154] [IMP]purchase: improve menu string bzr revid: mma@tinyerp.com-20121009052131-vwy6zp7xdtqv0780 --- addons/stock/stock_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index f5320a963c7..0f9cd0c817b 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1482,7 +1482,7 @@ - Receive Products + Incoming Products stock.move ir.actions.act_window form From d12acd17a0b5b82ed8a14432f5569f6393bed93e Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 9 Oct 2012 11:00:02 +0530 Subject: [PATCH 034/154] [IMP]membership : improve string bzr revid: mma@tinyerp.com-20121009053002-188wqmud5wtywxjy --- addons/membership/membership.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/membership/membership.py b/addons/membership/membership.py index f3192948afc..c5e2ed3a0bc 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -150,7 +150,7 @@ class membership_line(osv.osv): 'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True), 'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True), 'state': fields.function(_state, - string='Membership State', type='selection', + string='Membership Status', type='selection', selection=STATE, store = { 'account.invoice': (_get_membership_lines, ['state'], 10), 'res.partner': (_get_partners, ['membership_state'], 12), From a4fe575abc4a6b74a9e3d38fce6a3755c52f8096 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 9 Oct 2012 11:31:37 +0530 Subject: [PATCH 035/154] [IMP]event : improve string bzr revid: mma@tinyerp.com-20121009060137-tuaclaj2dm8vr8x0 --- addons/event/event_view.xml | 4 ++-- addons/event_moodle/wizard_moodle.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index b46fafe270f..e31e3c3d0cf 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -15,7 +15,7 @@ id="event_main_menu" groups="base.group_user" sequence="80"/> - + @@ -223,7 +223,7 @@ - + diff --git a/addons/event_moodle/wizard_moodle.xml b/addons/event_moodle/wizard_moodle.xml index 6eda25fcc4d..8dbe5d485f9 100644 --- a/addons/event_moodle/wizard_moodle.xml +++ b/addons/event_moodle/wizard_moodle.xml @@ -8,7 +8,7 @@
@@ -16,12 +16,12 @@ - +
From 91b257b0e8cd27aa63ab86cf498b8c67ae1f4b47 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Tue, 9 Oct 2012 14:31:58 +0530 Subject: [PATCH 036/154] [IMP]event : improve kanban view tickets condition bzr revid: mma@tinyerp.com-20121009090158-btfq6ypk6f7wio41 --- addons/event/event_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index e31e3c3d0cf..5f14c354f53 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -271,8 +271,8 @@ @
Organized by
Only - No ticket available. - + No ticket available. + tickets From 239690244363afd54eeea1c1f776f2dd113d54b2 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Tue, 9 Oct 2012 17:34:17 +0530 Subject: [PATCH 037/154] [IMP] improve code bzr revid: fka@tinyerp.com-20121009120417-ncg1zoqfnfkyi8cx --- addons/survey/wizard/survey_answer.py | 43 +++++++++++++-------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/addons/survey/wizard/survey_answer.py b/addons/survey/wizard/survey_answer.py index a75a08cc974..7e1417ecdb7 100644 --- a/addons/survey/wizard/survey_answer.py +++ b/addons/survey/wizard/survey_answer.py @@ -112,29 +112,26 @@ class survey_question_wiz(osv.osv_memory): flag = False fields = {} if sur_name_read.page == "next" or sur_name_rec.page_no == -1: - if total_pages: - if total_pages > sur_name_rec.page_no + 1: - if ((context.has_key('active') and not context.get('active', False)) \ - or not context.has_key('active')) and not sur_name_rec.page_no + 1: - if sur_rec.state != "open" : - raise osv.except_osv(_('Warning!'),_("You cannot answer because the survey is not open.")) - cr.execute('select count(id) from survey_history where user_id=%s\ - and survey_id=%s', (uid,survey_id)) - res = cr.fetchone()[0] - user_limit = survey_obj.browse(cr, uid, survey_id) - user_limit = user_limit.response_user - if user_limit and res >= user_limit: - raise osv.except_osv(_('Warning!'),_("You cannot answer this survey more than %s times.") % (user_limit)) - - if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey and not sur_name_rec.page_no + 1: - survey_obj.write(cr, uid, survey_id, {'state':'close', 'date_close':strftime("%Y-%m-%d %H:%M:%S")}) - - p_id = p_id[sur_name_rec.page_no + 1] - surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'page_no' : sur_name_rec.page_no + 1}) - flag = True - page_number += 1 - else: - raise osv.except_osv(_('Warning!'),_('This survey has no pages defined. Please define the pages first.')) + if total_pages > sur_name_rec.page_no + 1: + if ((context.has_key('active') and not context.get('active', False)) \ + or not context.has_key('active')) and not sur_name_rec.page_no + 1: + if sur_rec.state != "open" : + raise osv.except_osv(_('Warning!'),_("You cannot answer because the survey is not open.")) + cr.execute('select count(id) from survey_history where user_id=%s\ + and survey_id=%s', (uid,survey_id)) + res = cr.fetchone()[0] + user_limit = survey_obj.browse(cr, uid, survey_id) + user_limit = user_limit.response_user + if user_limit and res >= user_limit: + raise osv.except_osv(_('Warning!'),_("You cannot answer this survey more than %s times.") % (user_limit)) + + if sur_rec.max_response_limit and sur_rec.max_response_limit <= sur_rec.tot_start_survey and not sur_name_rec.page_no + 1: + survey_obj.write(cr, uid, survey_id, {'state':'close', 'date_close':strftime("%Y-%m-%d %H:%M:%S")}) + + p_id = p_id[sur_name_rec.page_no + 1] + surv_name_wiz.write(cr, uid, [context['sur_name_id'],], {'page_no' : sur_name_rec.page_no + 1}) + flag = True + page_number += 1 if sur_name_rec.page_no > - 1: pre_button = True else: From df9e56d33dfbb9bb61ca46ef36ca79122d9722ad Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Wed, 10 Oct 2012 10:45:22 +0530 Subject: [PATCH 038/154] [IMP]sale: improve priority og quotation tree view bzr revid: mma@tinyerp.com-20121010051522-9spi85rv30vwibr7 --- addons/sale/sale_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index 920e64d46da..3639fc5571f 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -144,7 +144,7 @@ sale.order.tree sale.order - 2 + 4 From 4ee77c60581e2928639cfb9ed82d31429b2e0f85 Mon Sep 17 00:00:00 2001 From: "Ravi Gadhia (OpenERP)" Date: Thu, 11 Oct 2012 17:35:34 +0530 Subject: [PATCH 039/154] [FIX]: get context value in one2many bzr revid: atp@tinyerp.com-20121011120534-bo57y7m667hshuz5 --- addons/web/static/src/js/view_form.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index afb5e258c0b..02dd5b1e0c7 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3608,7 +3608,12 @@ instance.web.form.One2ManyDataSet = instance.web.BufferedDataSet.extend({ get_context: function() { this.context = this.o2m.build_context([this.o2m.name]); return this.context; - } + }, + default_get: function(fields, options) { + if(!options) options = {} + _.extend(options, {'context':this.get_context()}) + return this._super(fields, options).then(this.on_default_get); + }, }); instance.web.form.One2ManyListView = instance.web.ListView.extend({ From c1fdc5b3662b1a2bb23da2d2005dc176a4430c21 Mon Sep 17 00:00:00 2001 From: "Purnendu Singh (OpenERP)" Date: Thu, 11 Oct 2012 19:05:06 +0530 Subject: [PATCH 040/154] [IMP] mail: rename variable and improve msg bzr revid: psi@tinyerp.com-20121011133506-knjykwttndmwawc7 --- addons/mail/mail_message.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/mail/mail_message.py b/addons/mail/mail_message.py index b7176e3dc40..34a9116216e 100644 --- a/addons/mail/mail_message.py +++ b/addons/mail/mail_message.py @@ -580,12 +580,12 @@ class mail_message(osv.Model): if not partner_wo_email_lst: return {} for partner in partner_wo_email_lst: - terminology = 'contact' + recipients = "contacts" if partner.customer and not partner.supplier: - terminology = 'customer' + recipients = "customers" elif partner.supplier and not partner.customer: - terminology = 'supplier' - warning_msg = _('The following %s do not have an email address specified.') % (terminology,) + recipients = "suppliers" + warning_msg = _('The following %s do not have an email address specified.') % (recipients,) warning_msg += '\n- %s' % (partner.name) return {'warning': { 'title': _('Email not found'), From 25ac221a0f6622a13d01d9b1ad14f4827adb2603 Mon Sep 17 00:00:00 2001 From: "RGA(OpenERP)" <> Date: Fri, 12 Oct 2012 12:00:04 +0530 Subject: [PATCH 041/154] [IMP] improve code bzr revid: rgaopenerp-20121012063004-cdgbq4w4pa1io9u2 --- addons/web/static/src/js/view_form.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/web/static/src/js/view_form.js b/addons/web/static/src/js/view_form.js index 02dd5b1e0c7..d9254d2d724 100644 --- a/addons/web/static/src/js/view_form.js +++ b/addons/web/static/src/js/view_form.js @@ -3609,11 +3609,11 @@ instance.web.form.One2ManyDataSet = instance.web.BufferedDataSet.extend({ this.context = this.o2m.build_context([this.o2m.name]); return this.context; }, - default_get: function(fields, options) { - if(!options) options = {} - _.extend(options, {'context':this.get_context()}) - return this._super(fields, options).then(this.on_default_get); - }, + default_get: function(fields, options) { + options = options || {}; + _.extend(options, {'context':this.get_context()}); + return this._super(fields, options).then(this.on_default_get); + }, }); instance.web.form.One2ManyListView = instance.web.ListView.extend({ From 3a6f2942d69961b536c5276bda686c0a4a9a49e0 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 12 Oct 2012 14:53:30 +0530 Subject: [PATCH 042/154] [IMP]product: remove conflicts bzr revid: mma@tinyerp.com-20121012092330-j8r0kbmbx5pawrxf --- addons/product/product_view.xml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/addons/product/product_view.xml b/addons/product/product_view.xml index 6a8830b5307..cc068d16a76 100644 --- a/addons/product/product_view.xml +++ b/addons/product/product_view.xml @@ -722,14 +722,6 @@
-<<<<<<< TREE - - - - - -======= ->>>>>>> MERGE-SOURCE
From 2bf21d63e5847b17971bdc0c72ae0cb81096a2ab Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 12 Oct 2012 15:03:32 +0530 Subject: [PATCH 043/154] [IMP]project_gtd: added string timeframe bzr revid: mma@tinyerp.com-20121012093332-noo1hs6e86e2wmlh --- addons/project_gtd/project_gtd_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project_gtd/project_gtd_view.xml b/addons/project_gtd/project_gtd_view.xml index a7026da8854..8f34d6b337b 100644 --- a/addons/project_gtd/project_gtd_view.xml +++ b/addons/project_gtd/project_gtd_view.xml @@ -93,7 +93,7 @@ - + From 65ff8505bd3e83642c792690dff013035a435694 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 12 Oct 2012 15:38:37 +0530 Subject: [PATCH 044/154] [IMP]stock: imporve tool tip bzr revid: mma@tinyerp.com-20121012100837-vjbvvo4zejduhqd2 --- addons/stock/stock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 77944cf6d10..ab29b93bc0f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -653,8 +653,8 @@ class stock_picking(osv.osv): * Cancelled: has been cancelled, can't be confirmed anymore""" ), 'min_date': fields.function(get_min_max_date, fnct_inv=_set_minimum_date, multi="min_max_date", - store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled date for the shipment to be processed"), - 'date': fields.datetime('Time', help="Creation date, usually the date of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), + store=True, type='datetime', string='Scheduled Time', select=1, help="Scheduled time for the shipment to be processed"), + 'date': fields.datetime('Time', help="Creation time, usually the time of the order.", select=True, states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'date_done': fields.datetime('Date Done', help="Date of Completion", states={'done':[('readonly', True)], 'cancel':[('readonly',True)]}), 'max_date': fields.function(get_min_max_date, fnct_inv=_set_maximum_date, multi="min_max_date", store=True, type='datetime', string='Max. Expected Date', select=2), From 0b878800299b9a1f7d55d4db5a6bc15826f392e1 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 12 Oct 2012 17:12:58 +0530 Subject: [PATCH 045/154] [IMP]all: imporve string state to status bzr revid: mma@tinyerp.com-20121012114258-w2q3hg1wb5wlt8wi --- addons/account/account.py | 6 +++--- addons/account/account_invoice.py | 10 +++++----- addons/account/account_move_line.py | 2 +- addons/account/account_view.xml | 2 +- .../account/report/account_invoice_report.py | 2 +- addons/account_asset/account_asset.py | 6 +++--- addons/account_payment/account_payment.py | 2 +- addons/account_voucher/account_voucher.py | 8 ++++---- .../report/account_voucher_sales_receipt.py | 2 +- addons/auth_signup/res_users.py | 2 +- addons/crm/crm.py | 2 +- addons/crm/crm_lead.py | 10 +++++----- addons/crm/crm_phonecall.py | 8 ++++---- addons/crm_claim/crm_claim.py | 12 +++++------ addons/crm_helpdesk/crm_helpdesk.py | 8 ++++---- addons/event/event.py | 2 +- addons/hr_holidays/hr_holidays.py | 8 ++++---- addons/hr_payroll/hr_payroll.py | 8 ++++---- addons/hr_recruitment/hr_recruitment.py | 12 +++++------ .../report/hr_recruitment_report.py | 2 +- .../wizard/hr_timesheet_sign_in_out.py | 4 ++-- .../hr_timesheet_sheet/hr_timesheet_sheet.py | 6 +++--- .../l10n_in_hr_payroll/l10n_in_hr_payroll.py | 2 +- .../report/payment_advice_report.py | 2 +- .../report/payslip_report.py | 2 +- addons/membership/membership.py | 2 +- addons/mrp/mrp.py | 12 +++++------ addons/mrp_operations/mrp_operations.py | 10 +++++----- addons/mrp_repair/mrp_repair.py | 20 +++++++++---------- addons/point_of_sale/point_of_sale.py | 4 ++-- addons/point_of_sale/point_of_sale_view.xml | 2 +- .../wizard/pos_session_opening.py | 4 ++-- addons/procurement/procurement.py | 4 ++-- addons/project/project.py | 10 +++++----- addons/project_issue/project_issue.py | 10 +++++----- addons/project_long_term/project_long_term.py | 4 ++-- addons/purchase/purchase.py | 10 +++++----- addons/purchase/report/purchase_report.py | 2 +- addons/sale/report/sale_report.py | 2 +- addons/sale/sale.py | 12 +++++------ addons/sale_stock/report/sale_report.py | 2 +- addons/sale_stock/sale_stock.py | 6 +++--- addons/stock/stock.py | 2 +- addons/stock/stock_view.xml | 2 +- 44 files changed, 125 insertions(+), 125 deletions(-) diff --git a/addons/account/account.py b/addons/account/account.py index 46cfaf645a8..c18574bcae6 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -1007,7 +1007,7 @@ class account_period(osv.osv): 'date_stop': fields.date('End of Period', required=True, states={'done':[('readonly',True)]}), 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal Year', required=True, states={'done':[('readonly',True)]}, select=True), 'state': fields.selection([('draft','Open'), ('done','Closed')], 'Status', readonly=True, - help='When monthly periods are created. The state is \'Draft\'. At the end of monthly period it is in \'Done\' state.'), + help='When monthly periods are created. The status is \'Draft\'. At the end of monthly period it is in \'Done\' status.'), 'company_id': fields.related('fiscalyear_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } _defaults = { @@ -1134,7 +1134,7 @@ class account_journal_period(osv.osv): 'icon': fields.function(_icon_get, string='Icon', type='char', size=32), 'active': fields.boolean('Active', required=True, help="If the active field is set to False, it will allow you to hide the journal period without removing it."), 'state': fields.selection([('draft','Draft'), ('printed','Printed'), ('done','Done')], 'Status', required=True, readonly=True, - help='When journal period is created. The state is \'Draft\'. If a report is printed it comes to \'Printed\' state. When all transactions are done, it comes in \'Done\' state.'), + help='When journal period is created. The status is \'Draft\'. If a report is printed it comes to \'Printed\' status. When all transactions are done, it comes in \'Done\' status.'), 'fiscalyear_id': fields.related('period_id', 'fiscalyear_id', string='Fiscal Year', type='many2one', relation='account.fiscalyear'), 'company_id': fields.related('journal_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True) } @@ -1282,7 +1282,7 @@ class account_move(osv.osv): 'period_id': fields.many2one('account.period', 'Period', required=True, states={'posted':[('readonly',True)]}), 'journal_id': fields.many2one('account.journal', 'Journal', required=True, states={'posted':[('readonly',True)]}), 'state': fields.selection([('draft','Unposted'), ('posted','Posted')], 'Status', required=True, readonly=True, - help='All manually created new journal entries are usually in the state \'Unposted\', but you can set the option to skip that state on the related journal. In that case, they will behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' state.'), + help='All manually created new journal entries are usually in the status \'Unposted\', but you can set the option to skip that status on the related journal. In that case, they will behave as journal entries automatically created by the system on document validation (invoices, bank statements...) and will be created in \'Posted\' status.'), 'line_id': fields.one2many('account.move.line', 'move_id', 'Entries', states={'posted':[('readonly',True)]}), 'to_check': fields.boolean('To Review', help='Check this box if you are unsure of that journal entry and if you want to note it as \'to be reviewed\' by an accounting expert.'), 'partner_id': fields.related('line_id', 'partner_id', type="many2one", relation="res.partner", string="Partner", store=True), diff --git a/addons/account/account_invoice.py b/addons/account/account_invoice.py index c3f507f1787..7f98bd5fa36 100644 --- a/addons/account/account_invoice.py +++ b/addons/account/account_invoice.py @@ -207,11 +207,11 @@ class account_invoice(osv.osv): ('paid','Paid'), ('cancel','Cancelled'), ],'Status', select=True, readonly=True, - help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Invoice. \ - \n* The \'Pro-forma\' when invoice is in Pro-forma state,invoice does not have an invoice number. \ - \n* The \'Open\' state is used when user create invoice,a invoice number is generated.Its in open state till user does not pay invoice. \ - \n* The \'Paid\' state is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \ - \n* The \'Cancelled\' state is used when user cancel invoice.'), + help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Invoice. \ + \n* The \'Pro-forma\' when invoice is in Pro-forma status,invoice does not have an invoice number. \ + \n* The \'Open\' status is used when user create invoice,a invoice number is generated.Its in open status till user does not pay invoice. \ + \n* The \'Paid\' status is set automatically when the invoice is paid. Its related journal entries may or may not be reconciled. \ + \n* The \'Cancelled\' status is used when user cancel invoice.'), 'sent': fields.boolean('Sent', readonly=True, help="It indicates that the invoice has been sent."), 'date_invoice': fields.date('Invoice Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, help="Keep empty to use the current date"), 'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}, select=True, diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py index b111cf2b771..b6d02ef6eac 100644 --- a/addons/account/account_move_line.py +++ b/addons/account/account_move_line.py @@ -515,7 +515,7 @@ class account_move_line(osv.osv): 'centralisation': fields.selection([('normal','Normal'),('credit','Credit Centralisation'),('debit','Debit Centralisation'),('currency','Currency Adjustment')], 'Centralisation', size=8), 'balance': fields.function(_balance, fnct_search=_balance_search, string='Balance'), 'state': fields.selection([('draft','Unbalanced'), ('valid','Valid')], 'Status', readonly=True, - help='When new move line is created the state will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' state.'), + help='When new move line is created the status will be \'Draft\'.\n* When all the payments are done it will be in \'Valid\' status.'), 'tax_code_id': fields.many2one('account.tax.code', 'Tax Account', help="The Account can either be a base tax code or a tax code account."), 'tax_amount': fields.float('Tax/Base Amount', digits_compute=dp.get_precision('Account'), select=True, help="If the Tax account is a tax code account, this field will contain the taxed amount.If the tax account is base tax code, "\ "this field will contain the basic amount(without tax)."), diff --git a/addons/account/account_view.xml b/addons/account/account_view.xml index d98b53ebbbd..d50364cec37 100644 --- a/addons/account/account_view.xml +++ b/addons/account/account_view.xml @@ -1863,7 +1863,7 @@ - + diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py index d4362484588..9c25934d8fd 100644 --- a/addons/account/report/account_invoice_report.py +++ b/addons/account/report/account_invoice_report.py @@ -63,7 +63,7 @@ class account_invoice_report(osv.osv): ('open','Open'), ('paid','Done'), ('cancel','Cancelled') - ], 'Invoice State', readonly=True), + ], 'Invoice Status', readonly=True), 'date_due': fields.date('Due Date', readonly=True), 'account_id': fields.many2one('account.account', 'Account',readonly=True), 'account_line_id': fields.many2one('account.account', 'Account Line',readonly=True), diff --git a/addons/account_asset/account_asset.py b/addons/account_asset/account_asset.py index 4c6f9b7a637..585798a5235 100644 --- a/addons/account_asset/account_asset.py +++ b/addons/account_asset/account_asset.py @@ -226,9 +226,9 @@ class account_asset_asset(osv.osv): 'child_ids': fields.one2many('account.asset.asset', 'parent_id', 'Children Assets'), 'purchase_date': fields.date('Purchase Date', required=True, readonly=True, states={'draft':[('readonly',False)]}), 'state': fields.selection([('draft','Draft'),('open','Running'),('close','Close')], 'Status', required=True, - help="When an asset is created, the state is 'Draft'.\n" \ - "If the asset is confirmed, the state goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \ - "You can manually close an asset when the depreciation is over. If the last line of depreciation is posted, the asset automatically goes in that state."), + help="When an asset is created, the status is 'Draft'.\n" \ + "If the asset is confirmed, the status goes in 'Running' and the depreciation lines can be posted in the accounting.\n" \ + "You can manually close an asset when the depreciation is over. If the last line of depreciation is posted, the asset automatically goes in that status."), 'active': fields.boolean('Active'), 'partner_id': fields.many2one('res.partner', 'Partner', readonly=True, states={'draft':[('readonly',False)]}), 'method': fields.selection([('linear','Linear'),('degressive','Degressive')], 'Computation Method', required=True, readonly=True, states={'draft':[('readonly',False)]}, help="Choose the method to use to compute the amount of depreciation lines.\n"\ diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index fceff99b3f2..0f6dca56d15 100644 --- a/addons/account_payment/account_payment.py +++ b/addons/account_payment/account_payment.py @@ -95,7 +95,7 @@ class payment_order(osv.osv): ('cancel', 'Cancelled'), ('open', 'Confirmed'), ('done', 'Done')], 'Status', select=True, - help='When an order is placed the state is \'Draft\'.\n Once the bank is confirmed the state is set to \'Confirmed\'.\n Then the order is paid the state is \'Done\'.'), + help='When an order is placed the status is \'Draft\'.\n Once the bank is confirmed the status is set to \'Confirmed\'.\n Then the order is paid the status is \'Done\'.'), 'line_ids': fields.one2many('payment.line', 'order_id', 'Payment lines', states={'done': [('readonly', True)]}), 'total': fields.function(_total, string="Total", type='float'), 'user_id': fields.many2one('res.users', 'Responsible', required=True, states={'done': [('readonly', True)]}), diff --git a/addons/account_voucher/account_voucher.py b/addons/account_voucher/account_voucher.py index f97f3f6af3c..7b887d88d2e 100644 --- a/addons/account_voucher/account_voucher.py +++ b/addons/account_voucher/account_voucher.py @@ -278,10 +278,10 @@ class account_voucher(osv.osv): ('proforma','Pro-forma'), ('posted','Posted') ], 'Status', readonly=True, size=32, - help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed Voucher. \ - \n* The \'Pro-forma\' when voucher is in Pro-forma state,voucher does not have an voucher number. \ - \n* The \'Posted\' state is used when user create voucher,a voucher number is generated and voucher entries are created in account \ - \n* The \'Cancelled\' state is used when user cancel voucher.'), + help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed Voucher. \ + \n* The \'Pro-forma\' when voucher is in Pro-forma status,voucher does not have an voucher number. \ + \n* The \'Posted\' status is used when user create voucher,a voucher number is generated and voucher entries are created in account \ + \n* The \'Cancelled\' status is used when user cancel voucher.'), 'amount': fields.float('Total', digits_compute=dp.get_precision('Account'), required=True, readonly=True, states={'draft':[('readonly',False)]}), 'tax_amount':fields.float('Tax Amount', digits_compute=dp.get_precision('Account'), readonly=True, states={'draft':[('readonly',False)]}), 'reference': fields.char('Ref #', size=64, readonly=True, states={'draft':[('readonly',False)]}, help="Transaction reference number."), diff --git a/addons/account_voucher/report/account_voucher_sales_receipt.py b/addons/account_voucher/report/account_voucher_sales_receipt.py index 53aa5cd4a0d..fdadfc6bc94 100644 --- a/addons/account_voucher/report/account_voucher_sales_receipt.py +++ b/addons/account_voucher/report/account_voucher_sales_receipt.py @@ -52,7 +52,7 @@ class sale_receipt_report(osv.osv): ('proforma','Pro-forma'), ('posted','Posted'), ('cancel','Cancelled') - ], 'Voucher State', readonly=True), + ], 'Voucher Status', readonly=True), 'pay_now':fields.selection([ ('pay_now','Pay Directly'), ('pay_later','Pay Later or Group Funds'), diff --git a/addons/auth_signup/res_users.py b/addons/auth_signup/res_users.py index 59196c4da87..69eee4f18e0 100644 --- a/addons/auth_signup/res_users.py +++ b/addons/auth_signup/res_users.py @@ -138,7 +138,7 @@ class res_users(osv.Model): for user in self.browse(cr, uid, ids, context)) _columns = { - 'state': fields.function(_get_state, string='State', type='selection', + 'state': fields.function(_get_state, string='Status', type='selection', selection=[('new', 'New'), ('active', 'Active'), ('reset', 'Resetting Password')]), } diff --git a/addons/crm/crm.py b/addons/crm/crm.py index d5f5b2511d1..eb602b98c09 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -77,7 +77,7 @@ class crm_case_stage(osv.osv): help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."), 'state': fields.selection(AVAILABLE_STATES, 'Related Status', required=True, help="The status of your document will automatically change regarding the selected stage. " \ - "For example, if a stage is related to the state 'Close', when your document reaches this stage, it is automatically closed."), + "For example, if a stage is related to the status 'Close', when your document reaches this stage, it is automatically closed."), 'case_default': fields.boolean('Common to All Teams', help="If you check this field, this stage will be proposed by default on each sales team. It will not assign this stage to existing teams."), 'fold': fields.boolean('Hide in Views when Empty', diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 48c6491a7c3..63b08898056 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -223,11 +223,11 @@ class crm_lead(base_stage, format_address, osv.osv): 'day_close': fields.function(_compute_day, string='Days to Close', \ multi='day_close', type="float", store=True), 'state': fields.related('stage_id', 'state', type="selection", store=True, - selection=crm.AVAILABLE_STATES, string="State", readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the case is over, the state is set to \'Done\'.\ - If the case needs to be reviewed then the state is \ + selection=crm.AVAILABLE_STATES, string="Status", readonly=True, + help='The Status is set to \'Draft\', when a case is created.\ + If the case is in progress the Status is set to \'Open\'.\ + When the case is over, the Status is set to \'Done\'.\ + If the case needs to be reviewed then the Status is \ set to \'Pending\'.'), # Only used for type opportunity diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index 44894fc881d..d53fb454112 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -50,10 +50,10 @@ class crm_phonecall(base_state, osv.osv): ('cancel', 'Cancelled'), ('done', 'Held'),], string='Status', size=16, readonly=True, - help='The state is set to \'Todo\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the call is over, the state is set to \'Held\'.\ - If the call needs to be done then the state is set to \'Not Held\'.'), + help='The Status is set to \'Todo\', when a case is created.\ + If the case is in progress the Status is set to \'Open\'.\ + When the call is over, the Status is set to \'Held\'.\ + If the call needs to be done then the Status is set to \'Not Held\'.'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'date_open': fields.datetime('Opened', readonly=True), # phonecall fields diff --git a/addons/crm_claim/crm_claim.py b/addons/crm_claim/crm_claim.py index c88b2fe26af..ff7bae18dce 100644 --- a/addons/crm_claim/crm_claim.py +++ b/addons/crm_claim/crm_claim.py @@ -50,7 +50,7 @@ class crm_claim_stage(osv.osv): 'sequence': fields.integer('Sequence', help="Used to order stages. Lower is better."), 'section_ids':fields.many2many('crm.case.section', 'section_claim_stage_rel', 'stage_id', 'section_id', string='Sections', help="Link between stages and sales teams. When set, this limitate the current stage to the selected sales teams."), - 'state': fields.selection(crm.AVAILABLE_STATES, 'State', required=True, help="The related state for the stage. The state of your document will automatically change regarding the selected stage. For example, if a stage is related to the state 'Close', when your document reaches this stage, it will be automatically have the 'closed' state."), + 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change regarding the selected stage. For example, if a stage is related to the status 'Close', when your document reaches this stage, it will be automatically have the 'closed' status."), 'case_refused': fields.boolean('Refused stage', help='Refused stages are specific stages for done.'), 'case_default': fields.boolean('Common to All Teams', @@ -108,11 +108,11 @@ class crm_claim(base_stage, osv.osv): domain="['|', ('section_ids', '=', section_id), ('case_default', '=', True)]"), 'cause': fields.text('Root Cause'), 'state': fields.related('stage_id', 'state', type="selection", store=True, - selection=crm.AVAILABLE_STATES, string="State", readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the case is over, the state is set to \'Done\'.\ - If the case needs to be reviewed then the state is \ + selection=crm.AVAILABLE_STATES, string="Status", readonly=True, + help='The status is set to \'Draft\', when a case is created.\ + If the case is in progress the status is set to \'Open\'.\ + When the case is over, the status is set to \'Done\'.\ + If the case needs to be reviewed then the status is \ set to \'Pending\'.'), } diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py index ceffd282aa8..ddf624c03ac 100644 --- a/addons/crm_helpdesk/crm_helpdesk.py +++ b/addons/crm_helpdesk/crm_helpdesk.py @@ -73,10 +73,10 @@ class crm_helpdesk(base_state, base_stage, osv.osv): ('object_id.model', '=', 'crm.helpdesk')]"), 'duration': fields.float('Duration', states={'done': [('readonly', True)]}), 'state': fields.selection(crm.AVAILABLE_STATES, 'Status', size=16, readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - \nIf the case is in progress the state is set to \'Open\'.\ - \nWhen the case is over, the state is set to \'Done\'.\ - \nIf the case needs to be reviewed then the state is set to \'Pending\'.'), + help='The status is set to \'Draft\', when a case is created.\ + \nIf the case is in progress the status is set to \'Open\'.\ + \nWhen the case is over, the status is set to \'Done\'.\ + \nIf the case needs to be reviewed then the status is set to \'Pending\'.'), } _defaults = { diff --git a/addons/event/event.py b/addons/event/event.py index b3aee2493f8..db218f15a2f 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -200,7 +200,7 @@ class event_event(osv.osv): ('confirm', 'Confirmed'), ('done', 'Done')], 'Status', readonly=True, required=True, - help='If event is created, the state is \'Draft\'.If event is confirmed for the particular dates the state is set to \'Confirmed\'. If the event is over, the state is set to \'Done\'.If event is cancelled the state is set to \'Cancelled\'.'), + help='If event is created, the status is \'Draft\'.If event is confirmed for the particular dates the status is set to \'Confirmed\'. If the event is over, the status is set to \'Done\'.If event is cancelled the status is set to \'Cancelled\'.'), 'email_registration_id' : fields.many2one('email.template','Registration Confirmation Email', help='This field contains the template of the mail that will be automatically sent each time a registration for this event is confirmed.'), 'email_confirmation_id' : fields.many2one('email.template','Event Confirmation Email', help="If you set an email template, each participant will receive this email announcing the confirmation of the event."), 'reply_to': fields.char('Reply-To Email', size=64, readonly=False, states={'done': [('readonly', True)]}, help="The email address of the organizer is likely to be put here, with the effect to be in the 'Reply-To' of the mails sent automatically at event or registrations confirmation. You can also put the email address of your mail gateway if you use one."), diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py index b48f0786704..0977f3729b4 100644 --- a/addons/hr_holidays/hr_holidays.py +++ b/addons/hr_holidays/hr_holidays.py @@ -115,10 +115,10 @@ class hr_holidays(osv.osv): _columns = { 'name': fields.char('Description', size=64), 'state': fields.selection([('draft', 'To Submit'), ('cancel', 'Cancelled'),('confirm', 'To Approve'), ('refuse', 'Refused'), ('validate1', 'Second Approval'), ('validate', 'Approved')], - 'State', readonly=True, help='The state is set to \'To Submit\', when a holiday request is created.\ - \nThe state is \'To Approve\', when holiday request is confirmed by user.\ - \nThe state is \'Refused\', when holiday request is refused by manager.\ - \nThe state is \'Approved\', when holiday request is approved by manager.'), + 'Status', readonly=True, help='The status is set to \'To Submit\', when a holiday request is created.\ + \nThe status is \'To Approve\', when holiday request is confirmed by user.\ + \nThe status is \'Refused\', when holiday request is refused by manager.\ + \nThe status is \'Approved\', when holiday request is approved by manager.'), 'user_id':fields.related('employee_id', 'user_id', type='many2one', relation='res.users', string='User', store=True), 'date_from': fields.datetime('Start Date', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}, select=True), 'date_to': fields.datetime('End Date', readonly=True, states={'draft':[('readonly',False)], 'confirm':[('readonly',False)]}), diff --git a/addons/hr_payroll/hr_payroll.py b/addons/hr_payroll/hr_payroll.py index b56b49d3d99..d1f38ad4a0f 100644 --- a/addons/hr_payroll/hr_payroll.py +++ b/addons/hr_payroll/hr_payroll.py @@ -272,10 +272,10 @@ class hr_payslip(osv.osv): ('done', 'Done'), ('cancel', 'Rejected'), ], 'Status', select=True, readonly=True, - help='* When the payslip is created the state is \'Draft\'.\ - \n* If the payslip is under verification, the state is \'Waiting\'. \ - \n* If the payslip is confirmed then state is set to \'Done\'.\ - \n* When user cancel payslip the state is \'Rejected\'.'), + help='* When the payslip is created the status is \'Draft\'.\ + \n* If the payslip is under verification, the status is \'Waiting\'. \ + \n* If the payslip is confirmed then status is set to \'Done\'.\ + \n* When user cancel payslip the status is \'Rejected\'.'), # 'line_ids': fields.one2many('hr.payslip.line', 'slip_id', 'Payslip Line', required=False, readonly=True, states={'draft': [('readonly', False)]}), 'line_ids': one2many_mod2('hr.payslip.line', 'slip_id', 'Payslip Lines', readonly=True, states={'draft':[('readonly',False)]}), 'company_id': fields.many2one('res.company', 'Company', required=False, readonly=True, states={'draft': [('readonly', False)]}), diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index ccfcae0d26e..696abdcdd85 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -62,7 +62,7 @@ class hr_recruitment_stage(osv.osv): 'name': fields.char('Name', size=64, required=True, translate=True), 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of stages."), 'department_id':fields.many2one('hr.department', 'Specific to a Department', help="Stages of the recruitment process may be different per department. If this stage is common to all departments, keep this field empty."), - 'state': fields.selection(AVAILABLE_STATES, 'State', required=True, help="The related state for the stage. The state of your document will automatically change according to the selected stage. Example, a stage is related to the state 'Close', when your document reach this stage, it will be automatically closed."), + 'state': fields.selection(AVAILABLE_STATES, 'Status', required=True, help="The related status for the stage. The status of your document will automatically change according to the selected stage. Example, a stage is related to the status 'Close', when your document reach this stage, it will be automatically closed."), 'fold': fields.boolean('Hide in views if empty', help="This stage is not visible, for example in status bar or kanban view, when there are no records in that stage to display."), 'requirements': fields.text('Requirements'), } @@ -189,11 +189,11 @@ class hr_applicant(base_stage, osv.Model): 'stage_id': fields.many2one ('hr.recruitment.stage', 'Stage', domain="['&', ('fold', '=', False), '|', ('department_id', '=', department_id), ('department_id', '=', False)]"), 'state': fields.related('stage_id', 'state', type="selection", store=True, - selection=AVAILABLE_STATES, string="State", readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the case is over, the state is set to \'Done\'.\ - If the case needs to be reviewed then the state is \ + selection=AVAILABLE_STATES, string="Status", readonly=True, + help='The status is set to \'Draft\', when a case is created.\ + If the case is in progress the status is set to \'Open\'.\ + When the case is over, the status is set to \'Done\'.\ + If the case needs to be reviewed then the status is \ set to \'Pending\'.'), 'categ_ids': fields.many2many('hr.applicant_category', string='Tags'), 'company_id': fields.many2one('res.company', 'Company'), diff --git a/addons/hr_recruitment/report/hr_recruitment_report.py b/addons/hr_recruitment/report/hr_recruitment_report.py index e888da9ead7..d3faa3f37be 100644 --- a/addons/hr_recruitment/report/hr_recruitment_report.py +++ b/addons/hr_recruitment/report/hr_recruitment_report.py @@ -41,7 +41,7 @@ class hr_recruitment_report(osv.osv): _columns = { 'user_id': fields.many2one('res.users', 'User', readonly=True), 'nbr': fields.integer('# of Applications', readonly=True), - 'state': fields.selection(AVAILABLE_STATES, 'State', size=16, readonly=True), + 'state': fields.selection(AVAILABLE_STATES, 'Status', size=16, readonly=True), 'month':fields.selection([('01', 'January'), ('02', 'February'), \ ('03', 'March'), ('04', 'April'),\ ('05', 'May'), ('06', 'June'), \ diff --git a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py index e92e88bdcbd..e2dab78bfbe 100644 --- a/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py +++ b/addons/hr_timesheet/wizard/hr_timesheet_sign_in_out.py @@ -33,7 +33,7 @@ class hr_so_project(osv.osv_memory): 'date': fields.datetime('Closing Date'), 'analytic_amount': fields.float('Minimum Analytic Amount'), 'name': fields.char('Employees name', size=32, required=True, readonly=True), - 'state': fields.related('emp_id', 'state', string='Current state', type='char', required=True, readonly=True), + 'state': fields.related('emp_id', 'state', string='Current Status', type='char', required=True, readonly=True), 'server_date': fields.datetime('Current Date', required=True, readonly=True), 'emp_id': fields.many2one('hr.employee', 'Employee ID') } @@ -111,7 +111,7 @@ class hr_si_project(osv.osv_memory): _description = 'Sign In By Project' _columns = { 'name': fields.char('Employees name', size=32, readonly=True), - 'state': fields.related('emp_id', 'state', string='Current state', type='char', required=True, readonly=True), + 'state': fields.related('emp_id', 'state', string='Current Status', type='char', required=True, readonly=True), 'date': fields.datetime('Starting Date'), 'server_date': fields.datetime('Current Date', readonly=True), 'emp_id': fields.many2one('hr.employee', 'Employee ID') diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 96cb15ddce1..e33dc457e12 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -206,9 +206,9 @@ class hr_timesheet_sheet(osv.osv): ('draft','Open'), ('confirm','Waiting Approval'), ('done','Approved')], 'Status', select=True, required=True, readonly=True, - help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed timesheet. \ - \n* The \'Confirmed\' state is used for to confirm the timesheet by user. \ - \n* The \'Done\' state is used when users timesheet is accepted by his/her senior.'), + help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed timesheet. \ + \n* The \'Confirmed\' status is used for to confirm the timesheet by user. \ + \n* The \'Done\' status is used when users timesheet is accepted by his/her senior.'), 'state_attendance' : fields.related('employee_id', 'state', type='selection', selection=[('absent', 'Absent'), ('present', 'Present')], string='Current Status', readonly=True), 'total_attendance': fields.function(_total, method=True, string='Total Attendance', multi="_total"), 'total_timesheet': fields.function(_total, method=True, string='Total Timesheet', multi="_total"), diff --git a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py index 085a2679db2..b7c3926d727 100644 --- a/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py +++ b/addons/l10n_in_hr_payroll/l10n_in_hr_payroll.py @@ -65,7 +65,7 @@ class payroll_advice(osv.osv): ('draft', 'Draft'), ('confirm', 'Confirmed'), ('cancel', 'Cancelled'), - ], 'State', select=True, readonly=True), + ], 'Status', select=True, readonly=True), 'number':fields.char('Reference', size=16, readonly=True), 'line_ids':fields.one2many('hr.payroll.advice.line', 'advice_id', 'Employee Salary', states={'draft': [('readonly', False)]}, readonly=True), 'chaque_nos':fields.char('Cheque Numbers', size=256), diff --git a/addons/l10n_in_hr_payroll/report/payment_advice_report.py b/addons/l10n_in_hr_payroll/report/payment_advice_report.py index 838334913a5..a264368be94 100644 --- a/addons/l10n_in_hr_payroll/report/payment_advice_report.py +++ b/addons/l10n_in_hr_payroll/report/payment_advice_report.py @@ -38,7 +38,7 @@ class payment_advice_report(osv.osv): ('draft', 'Draft'), ('confirm', 'Confirmed'), ('cancel', 'Cancelled'), - ], 'State', select=True, readonly=True), + ], 'Status', select=True, readonly=True), 'employee_id': fields.many2one('hr.employee', 'Employee', readonly=True), 'nbr': fields.integer('# Payment Lines', readonly=True), 'number':fields.char('Number', size=16, readonly=True), diff --git a/addons/l10n_in_hr_payroll/report/payslip_report.py b/addons/l10n_in_hr_payroll/report/payslip_report.py index b688af4329b..a78d9850667 100644 --- a/addons/l10n_in_hr_payroll/report/payslip_report.py +++ b/addons/l10n_in_hr_payroll/report/payslip_report.py @@ -39,7 +39,7 @@ class payslip_report(osv.osv): ('draft', 'Draft'), ('done', 'Done'), ('cancel', 'Rejected'), - ], 'State', readonly=True), + ], 'Status', readonly=True), 'employee_id': fields.many2one('hr.employee', 'Employee', readonly=True), 'nbr': fields.integer('# Payslip lines', readonly=True), 'number': fields.char('Number', size=16, readonly=True), diff --git a/addons/membership/membership.py b/addons/membership/membership.py index c5e2ed3a0bc..5e3816419f8 100644 --- a/addons/membership/membership.py +++ b/addons/membership/membership.py @@ -154,7 +154,7 @@ class membership_line(osv.osv): selection=STATE, store = { 'account.invoice': (_get_membership_lines, ['state'], 10), 'res.partner': (_get_partners, ['membership_state'], 12), - }, help="""It indicates the membership state. + }, help="""It indicates the membership status. -Non Member: A member who has not applied for any membership. -Cancelled Member: A member who has cancelled his membership. -Old Member: A member whose membership date has expired. diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index ecac11f856a..2883ca1891e 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -488,12 +488,12 @@ class mrp_production(osv.osv): [('draft', 'New'), ('cancel', 'Cancelled'), ('picking_except', 'Picking Exception'), ('confirmed', 'Waiting Goods'), ('ready', 'Ready to Produce'), ('in_production', 'Production Started'), ('done', 'Done')], string='Status', readonly=True, - help="When the production order is created the state is set to 'Draft'.\n\ - If the order is confirmed the state is set to 'Waiting Goods'.\n\ - If any exceptions are there, the state is set to 'Picking Exception'.\n\ - If the stock is available then the state is set to 'Ready to Produce'.\n\ - When the production gets started then the state is set to 'In Production'.\n\ - When the production is over, the state is set to 'Done'."), + help="When the production order is created the status is set to 'Draft'.\n\ + If the order is confirmed the status is set to 'Waiting Goods'.\n\ + If any exceptions are there, the status is set to 'Picking Exception'.\n\ + If the stock is available then the status is set to 'Ready to Produce'.\n\ + When the production gets started then the status is set to 'In Production'.\n\ + When the production is over, the status is set to 'Done'."), 'hour_total': fields.function(_production_calc, type='float', string='Total Hours', multi='workorder', store=True), 'cycle_total': fields.function(_production_calc, type='float', string='Total Cycles', multi='workorder', store=True), 'user_id':fields.many2one('res.users', 'Responsible'), diff --git a/addons/mrp_operations/mrp_operations.py b/addons/mrp_operations/mrp_operations.py index 9f6671c3b2b..90330c4c988 100644 --- a/addons/mrp_operations/mrp_operations.py +++ b/addons/mrp_operations/mrp_operations.py @@ -87,11 +87,11 @@ class mrp_production_workcenter_line(osv.osv): _columns = { 'state': fields.selection([('draft','Draft'),('cancel','Cancelled'),('pause','Pending'),('startworking', 'In Progress'),('done','Finished')],'Status', readonly=True, - help="* When a work order is created it is set in 'Draft' state.\n" \ - "* When user sets work order in start mode that time it will be set in 'In Progress' state.\n" \ - "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pending' state.\n" \ - "* When the user cancels the work order it will be set in 'Canceled' state.\n" \ - "* When order is completely processed that time it is set in 'Finished' state."), + help="* When a work order is created it is set in 'Draft' status.\n" \ + "* When user sets work order in start mode that time it will be set in 'In Progress' status.\n" \ + "* When work order is in running mode, during that time if user wants to stop or to make changes in order then can set in 'Pending' status.\n" \ + "* When the user cancels the work order it will be set in 'Canceled' status.\n" \ + "* When order is completely processed that time it is set in 'Finished' status."), 'date_start_date': fields.function(_get_date_date, string='Start Date', type='date'), 'date_planned': fields.datetime('Scheduled Date', select=True), 'date_planned_end': fields.function(_get_date_end, string='End Date', type='datetime'), diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index c1ac8f809ce..60fc34a972a 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -131,12 +131,12 @@ class mrp_repair(osv.osv): ('invoice_except','Invoice Exception'), ('done','Repaired') ], 'Status', readonly=True, - help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed repair order. \ - \n* The \'Confirmed\' state is used when a user confirms the repair order. \ - \n* The \'Ready to Repair\' state is used to start to repairing, user can start repairing only after repair order is confirmed. \ - \n* The \'To be Invoiced\' state is used to generate the invoice before or after repairing done. \ - \n* The \'Done\' state is set when repairing is completed.\ - \n* The \'Cancelled\' state is used when user cancel repair order.'), + help=' * The \'Draft\' status is used when a user is encoding a new and unconfirmed repair order. \ + \n* The \'Confirmed\' status is used when a user confirms the repair order. \ + \n* The \'Ready to Repair\' status is used to start to repairing, user can start repairing only after repair order is confirmed. \ + \n* The \'To be Invoiced\' status is used to generate the invoice before or after repairing done. \ + \n* The \'Done\' status is set when repairing is completed.\ + \n* The \'Cancelled\' status is used when user cancel repair order.'), 'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}), 'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}), 'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}), @@ -707,10 +707,10 @@ class mrp_repair_line(osv.osv, ProductChangeMixin): ('confirmed','Confirmed'), ('done','Done'), ('cancel','Cancelled')], 'Status', required=True, readonly=True, - help=' * The \'Draft\' state is set automatically as draft when repair order in draft state. \ - \n* The \'Confirmed\' state is set automatically as confirm when repair order in confirm state. \ - \n* The \'Done\' state is set automatically when repair order is completed.\ - \n* The \'Cancelled\' state is set automatically when user cancel repair order.'), + help=' * The \'Draft\' status is set automatically as draft when repair order in draft status. \ + \n* The \'Confirmed\' status is set automatically as confirm when repair order in confirm status. \ + \n* The \'Done\' status is set automatically when repair order is completed.\ + \n* The \'Cancelled\' status is set automatically when user cancel repair order.'), } _defaults = { 'state': lambda *a: 'draft', diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 788c301a04f..f219f4111ca 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -66,7 +66,7 @@ class pos_config(osv.osv): 'iface_vkeyboard' : fields.boolean('Virtual KeyBoard Interface'), 'iface_print_via_proxy' : fields.boolean('Print via Proxy'), - 'state' : fields.selection(POS_CONFIG_STATE, 'State', required=True, readonly=True), + 'state' : fields.selection(POS_CONFIG_STATE, 'Status', required=True, readonly=True), 'sequence_id' : fields.many2one('ir.sequence', 'Order IDs Sequence', readonly=True, help="This sequence is automatically created by OpenERP but you can change it "\ "to customize the reference numbers of your orders."), @@ -197,7 +197,7 @@ class pos_session(osv.osv): 'start_at' : fields.datetime('Opening Date', readonly=True), 'stop_at' : fields.datetime('Closing Date', readonly=True), - 'state' : fields.selection(POS_SESSION_STATE, 'State', + 'state' : fields.selection(POS_SESSION_STATE, 'Status', required=True, readonly=True, select=1), diff --git a/addons/point_of_sale/point_of_sale_view.xml b/addons/point_of_sale/point_of_sale_view.xml index 66b7e3b6eb5..1ee55f736aa 100644 --- a/addons/point_of_sale/point_of_sale_view.xml +++ b/addons/point_of_sale/point_of_sale_view.xml @@ -1039,7 +1039,7 @@ - + diff --git a/addons/point_of_sale/wizard/pos_session_opening.py b/addons/point_of_sale/wizard/pos_session_opening.py index 4e7965f8e97..7c88986169e 100644 --- a/addons/point_of_sale/wizard/pos_session_opening.py +++ b/addons/point_of_sale/wizard/pos_session_opening.py @@ -16,8 +16,8 @@ class pos_session_opening(osv.osv_memory): 'pos_state' : fields.related('pos_session_id', 'state', type='selection', selection=pos_session.POS_SESSION_STATE, - string='Session State', readonly=True), - 'pos_state_str' : fields.char('State', 32, readonly=True), + string='Session Status', readonly=True), + 'pos_state_str' : fields.char('Status', 32, readonly=True), 'show_config' : fields.boolean('Show Config', readonly=True), 'pos_session_name' : fields.related('pos_session_id', 'name', type='char', size=64, readonly=True), diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index b21cef30773..55a291bd3c2 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -113,8 +113,8 @@ class procurement_order(osv.osv): ('ready','Ready'), ('done','Done'), ('waiting','Waiting')], 'Status', required=True, - help='When a procurement is created the state is set to \'Draft\'.\n If the procurement is confirmed, the state is set to \'Confirmed\'.\ - \nAfter confirming the state is set to \'Running\'.\n If any exception arises in the order then the state is set to \'Exception\'.\n Once the exception is removed the state becomes \'Ready\'.\n It is in \'Waiting\'. state when the procurement is waiting for another one to finish.'), + help='When a procurement is created the status is set to \'Draft\'.\n If the procurement is confirmed, the status is set to \'Confirmed\'.\ + \nAfter confirming the status is set to \'Running\'.\n If any exception arises in the order then the status is set to \'Exception\'.\n Once the exception is removed the status becomes \'Ready\'.\n It is in \'Waiting\'. status when the procurement is waiting for another one to finish.'), 'note': fields.text('Note'), 'company_id': fields.many2one('res.company','Company',required=True), } diff --git a/addons/project/project.py b/addons/project/project.py index 1451f2d7938..ed23bb7ae0b 100644 --- a/addons/project/project.py +++ b/addons/project/project.py @@ -721,11 +721,11 @@ class task(base_stage, osv.osv): 'stage_id': fields.many2one('project.task.type', 'Stage', domain="['&', ('fold', '=', False), '|', ('project_ids', '=', project_id), ('case_default', '=', True)]"), 'state': fields.related('stage_id', 'state', type="selection", store=True, - selection=_TASK_STATE, string="State", readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the case is over, the state is set to \'Done\'.\ - If the case needs to be reviewed then the state is \ + selection=_TASK_STATE, string="Status", readonly=True, + help='The status is set to \'Draft\', when a case is created.\ + If the case is in progress the status is set to \'Open\'.\ + When the case is over, the status is set to \'Done\'.\ + If the case needs to be reviewed then the status is \ set to \'Pending\'.'), 'categ_ids': fields.many2many('project.category', string='Tags'), 'kanban_state': fields.selection([('normal', 'Normal'),('blocked', 'Blocked'),('done', 'Ready To Pull')], 'Kanban State', diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 9e434078d2f..7ea6fc184d1 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -227,11 +227,11 @@ class project_issue(base_stage, osv.osv): 'company_id': fields.many2one('res.company', 'Company'), 'description': fields.text('Description'), 'state': fields.related('stage_id', 'state', type="selection", store=True, - selection=_ISSUE_STATE, string="State", readonly=True, - help='The state is set to \'Draft\', when a case is created.\ - If the case is in progress the state is set to \'Open\'.\ - When the case is over, the state is set to \'Done\'.\ - If the case needs to be reviewed then the state is \ + selection=_ISSUE_STATE, string="Status", readonly=True, + help='The status is set to \'Draft\', when a case is created.\ + If the case is in progress the status is set to \'Open\'.\ + When the case is over, the status is set to \'Done\'.\ + If the case needs to be reviewed then the status is \ set to \'Pending\'.'), 'email_from': fields.char('Email', size=128, help="These people will receive email.", select=1), 'email_cc': fields.char('Watchers Emails', size=256, help="These email addresses will be added to the CC field of all inbound and outbound emails for this record before being sent. Separate multiple email addresses with a comma"), diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py index b19238200e5..db6c532d503 100644 --- a/addons/project_long_term/project_long_term.py +++ b/addons/project_long_term/project_long_term.py @@ -116,8 +116,8 @@ class project_phase(osv.osv): 'user_ids': fields.one2many('project.user.allocation', 'phase_id', "Assigned Users",states={'done':[('readonly',True)], 'cancelled':[('readonly',True)]}, help="The resources on the project can be computed automatically by the scheduler."), 'state': fields.selection([('draft', 'New'), ('cancelled', 'Cancelled'),('open', 'In Progress'), ('pending', 'Pending'), ('done', 'Done')], 'Status', readonly=True, required=True, - help='If the phase is created the state \'Draft\'.\n If the phase is started, the state becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' state.\ - \n If the phase is over, the states is set to \'Done\'.'), + help='If the phase is created the status \'Draft\'.\n If the phase is started, the status becomes \'In Progress\'.\n If review is needed the phase is in \'Pending\' status.\ + \n If the phase is over, the status is set to \'Done\'.'), 'progress': fields.function(_compute_progress, string='Progress', help="Computed based on related tasks"), } _defaults = { diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index db6ed8b80be..0f0e99244a5 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -167,7 +167,7 @@ class purchase_order(osv.osv): 'location_id': fields.many2one('stock.location', 'Destination', required=True, domain=[('usage','<>','view')]), 'pricelist_id':fields.many2one('product.pricelist', 'Pricelist', required=True, states={'confirmed':[('readonly',True)], 'approved':[('readonly',True)],'done':[('readonly',True)]}, help="The pricelist sets the currency used for this purchase order. It also computes the supplier price for the selected products/quantities."), 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", readonly=True, required=True), - 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The state of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' state. Then the order has to be confirmed by the user, the state switch to 'Confirmed'. Then the supplier must confirm the order to change the state to 'Approved'. When the purchase order is paid and received, the state becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the state becomes in exception.", select=True), + 'state': fields.selection(STATE_SELECTION, 'Status', readonly=True, help="The status of the purchase order or the quotation request. A quotation is a purchase order in a 'Draft' status. Then the order has to be confirmed by the user, the status switch to 'Confirmed'. Then the supplier must confirm the order to change the status to 'Approved'. When the purchase order is paid and received, the status becomes 'Done'. If a cancel action occurs in the invoice or in the reception of goods, the status becomes in exception.", select=True), 'order_line': fields.one2many('purchase.order.line', 'order_id', 'Order Lines', states={'approved':[('readonly',True)],'done':[('readonly',True)]}), 'validator' : fields.many2one('res.users', 'Validated by', readonly=True), 'notes': fields.text('Terms and Conditions'), @@ -809,10 +809,10 @@ class purchase_order_line(osv.osv): 'account_analytic_id':fields.many2one('account.analytic.account', 'Analytic Account',), 'company_id': fields.related('order_id','company_id',type='many2one',relation='res.company',string='Company', store=True, readonly=True), 'state': fields.selection([('draft', 'Draft'), ('confirmed', 'Confirmed'), ('done', 'Done'), ('cancel', 'Cancelled')], 'Status', required=True, readonly=True, - help=' * The \'Draft\' state is set automatically when purchase order in draft state. \ - \n* The \'Confirmed\' state is set automatically as confirm when purchase order in confirm state. \ - \n* The \'Done\' state is set automatically when purchase order is set as done. \ - \n* The \'Cancelled\' state is set automatically when user cancel purchase order.'), + help=' * The \'Draft\' status is set automatically when purchase order in draft status. \ + \n* The \'Confirmed\' status is set automatically as confirm when purchase order in confirm status. \ + \n* The \'Done\' status is set automatically when purchase order is set as done. \ + \n* The \'Cancelled\' status is set automatically when user cancel purchase order.'), 'invoice_lines': fields.many2many('account.invoice.line', 'purchase_order_line_invoice_rel', 'order_line_id', 'invoice_id', 'Invoice Lines', readonly=True), 'invoiced': fields.boolean('Invoiced', readonly=True), 'partner_id': fields.related('order_id','partner_id',string='Partner',readonly=True,type="many2one", relation="res.partner", store=True), diff --git a/addons/purchase/report/purchase_report.py b/addons/purchase/report/purchase_report.py index f4bd4fee425..76ffddcb85f 100644 --- a/addons/purchase/report/purchase_report.py +++ b/addons/purchase/report/purchase_report.py @@ -40,7 +40,7 @@ class purchase_report(osv.osv): ('except_picking', 'Shipping Exception'), ('except_invoice', 'Invoice Exception'), ('done', 'Done'), - ('cancel', 'Cancelled')],'Order State', readonly=True), + ('cancel', 'Cancelled')],'Order Status', readonly=True), 'product_id':fields.many2one('product.product', 'Product', readonly=True), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', readonly=True), 'location_id': fields.many2one('stock.location', 'Destination', readonly=True), diff --git a/addons/sale/report/sale_report.py b/addons/sale/report/sale_report.py index 0ae2e4f7133..f592a8fd66c 100644 --- a/addons/sale/report/sale_report.py +++ b/addons/sale/report/sale_report.py @@ -55,7 +55,7 @@ class sale_report(osv.osv): ('invoice_except', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') - ], 'Order State', readonly=True), + ], 'Order Status', readonly=True), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', readonly=True), 'analytic_account_id': fields.many2one('account.analytic.account', 'Analytic Account', readonly=True), } diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 09bb08d46f6..9c20faa5d8d 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -187,7 +187,7 @@ class sale_order(osv.osv): ('manual', 'Sale to Invoice'), ('invoice_except', 'Invoice Exception'), ('done', 'Done'), - ], 'Status', readonly=True, help="Gives the state of the quotation or sales order. \nThe exception state is automatically set when a cancel operation occurs in the processing of a document linked to the sale order. \nThe 'Waiting Schedule' state is set when the invoice is confirmed but waiting for the scheduler to run on the order date.", select=True), + ], 'Status', readonly=True, help="Gives the status of the quotation or sales order. \nThe exception status is automatically set when a cancel operation occurs in the processing of a document linked to the sale order. \nThe 'Waiting Schedule' status is set when the invoice is confirmed but waiting for the scheduler to run on the order date.", select=True), 'date_order': fields.date('Date', required=True, readonly=True, select=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), 'create_date': fields.datetime('Creation Date', readonly=True, select=True, help="Date on which sales order is created."), 'date_confirm': fields.date('Confirmation Date', readonly=True, select=True, help="Date on which sales order is confirmed."), @@ -726,11 +726,11 @@ class sale_order_line(osv.osv): 'discount': fields.float('Discount (%)', digits_compute= dp.get_precision('Discount'), readonly=True, states={'draft': [('readonly', False)]}), 'th_weight': fields.float('Weight', readonly=True, states={'draft': [('readonly', False)]}), 'state': fields.selection([('cancel', 'Cancelled'),('draft', 'Draft'),('confirmed', 'Confirmed'),('exception', 'Exception'),('done', 'Done')], 'Status', required=True, readonly=True, - help='* The \'Draft\' state is set when the related sales order in draft state. \ - \n* The \'Confirmed\' state is set when the related sales order is confirmed. \ - \n* The \'Exception\' state is set when the related sales order is set as exception. \ - \n* The \'Done\' state is set when the sales order line has been picked. \ - \n* The \'Cancelled\' state is set when a user cancel the sales order related.'), + help='* The \'Draft\' status is set when the related sales order in draft status. \ + \n* The \'Confirmed\' status is set when the related sales order is confirmed. \ + \n* The \'Exception\' status is set when the related sales order is set as exception. \ + \n* The \'Done\' status is set when the sales order line has been picked. \ + \n* The \'Cancelled\' status is set when a user cancel the sales order related.'), 'order_partner_id': fields.related('order_id', 'partner_id', type='many2one', relation='res.partner', store=True, string='Customer'), 'salesman_id':fields.related('order_id', 'user_id', type='many2one', relation='res.users', store=True, string='Salesperson'), 'company_id': fields.related('order_id', 'company_id', type='many2one', relation='res.company', string='Company', store=True, readonly=True), diff --git a/addons/sale_stock/report/sale_report.py b/addons/sale_stock/report/sale_report.py index 04587c1e679..a523c0551f2 100644 --- a/addons/sale_stock/report/sale_report.py +++ b/addons/sale_stock/report/sale_report.py @@ -36,7 +36,7 @@ class sale_report(osv.osv): ('invoice_except', 'Invoice Exception'), ('done', 'Done'), ('cancel', 'Cancelled') - ], 'Order State', readonly=True), + ], 'Order Status', readonly=True), } def init(self, cr): diff --git a/addons/sale_stock/sale_stock.py b/addons/sale_stock/sale_stock.py index ce6894318c4..c54bc80d6f8 100644 --- a/addons/sale_stock/sale_stock.py +++ b/addons/sale_stock/sale_stock.py @@ -123,9 +123,9 @@ class sale_order(osv.osv): ('shipping_except', 'Shipping Exception'), ('invoice_except', 'Invoice Exception'), ('done', 'Done'), - ], 'Status', readonly=True,help="Gives the state of the quotation or sales order.\ - \nThe exception state is automatically set when a cancel operation occurs \ - in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception).\nThe 'Waiting Schedule' state is set when the invoice is confirmed\ + ], 'Status', readonly=True,help="Gives the status of the quotation or sales order.\ + \nThe exception status is automatically set when a cancel operation occurs \ + in the invoice validation (Invoice Exception) or in the picking list process (Shipping Exception).\nThe 'Waiting Schedule' status is set when the invoice is confirmed\ but waiting for the scheduler to run on the order date.", select=True), 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), 'picking_policy': fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 765599aa842..bdfd8968e7e 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3084,7 +3084,7 @@ class stock_picking_out(osv.osv): ('assigned', 'Ready to Deliver'), ('done', 'Delivered'), ('cancel', 'Cancelled'),], - 'State', readonly=True, select=True, + 'Status', readonly=True, select=True, help="""* Draft: not confirmed yet and will not be scheduled until confirmed\n * Waiting Another Operation: waiting for another move to proceed before it becomes automatically available (e.g. in Make-To-Order flows)\n * Waiting Availability: still waiting for the availability of products\n diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 329425148c5..4e7c860e87b 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -812,7 +812,7 @@ - + From bafeb4f119fe944b404a9f3b93eae8c9dade3ead Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 12 Oct 2012 17:29:34 +0530 Subject: [PATCH 046/154] [IMP] mrp_repair : Improve label and help string for 'guarantee_limit'. bzr revid: mdi@tinyerp.com-20121012115934-drhfyqtis93pg879 --- addons/mrp_repair/mrp_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index c1ac8f809ce..a3ef7186984 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -140,7 +140,7 @@ class mrp_repair(osv.osv): 'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}), 'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}), 'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}), - 'guarantee_limit': fields.date('Guarantee limit', help="The guarantee limit is computed as: last move date + warranty defined on selected product. If the current date is below the guarantee limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."), + 'guarantee_limit': fields.date('Warranty Expiration Limit', help="The warranty expiration limit is computed as: last move date + warranty defined on selected product. If the current date is below the warranty expiration limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."), 'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help='Pricelist of the selected partner.'), 'partner_invoice_id':fields.many2one('res.partner', 'Invoicing Address'), From 68baa0e49e5d524ece0aa2127bfa99cf6aa19eec Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Fri, 12 Oct 2012 17:34:33 +0530 Subject: [PATCH 047/154] [IMP] stock : Improved the label for 'partner_id' in Incoming Shipment and Delivery Order. bzr revid: mdi@tinyerp.com-20121012120433-1tubvg3wmyijd1qd --- addons/stock/stock_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 329425148c5..1cbfaeac9c9 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -875,7 +875,7 @@ - + @@ -1006,7 +1006,7 @@ - + From c18b907b49824491342c6a7e7559c75ceddaa275 Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Fri, 12 Oct 2012 18:15:13 +0530 Subject: [PATCH 048/154] [IMP]all: imporve string state to status bzr revid: mma@tinyerp.com-20121012124513-u7jbhn39gm17y6tj --- addons/account/account_bank_statement.py | 4 ++-- addons/crm/crm_phonecall.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account/account_bank_statement.py b/addons/account/account_bank_statement.py index 549363ce269..48082451f35 100644 --- a/addons/account/account_bank_statement.py +++ b/addons/account/account_bank_statement.py @@ -123,8 +123,8 @@ class account_bank_statement(osv.osv): ('open','Open'), # used by cash statements ('confirm', 'Closed')], 'Status', required=True, readonly="1", - help='When new statement is created the state will be \'Draft\'.\n' - 'And after getting confirmation from the bank it will be in \'Confirmed\' state.'), + help='When new statement is created the status will be \'Draft\'.\n' + 'And after getting confirmation from the bank it will be in \'Confirmed\' status.'), 'currency': fields.function(_currency, string='Currency', type='many2one', relation='res.currency'), 'account_id': fields.related('journal_id', 'default_debit_account_id', type='many2one', relation='account.account', string='Account used in this journal', readonly=True, help='used in statement reconciliation domain, but shouldn\'t be used elswhere.'), diff --git a/addons/crm/crm_phonecall.py b/addons/crm/crm_phonecall.py index d53fb454112..bac33815794 100644 --- a/addons/crm/crm_phonecall.py +++ b/addons/crm/crm_phonecall.py @@ -50,10 +50,10 @@ class crm_phonecall(base_state, osv.osv): ('cancel', 'Cancelled'), ('done', 'Held'),], string='Status', size=16, readonly=True, - help='The Status is set to \'Todo\', when a case is created.\ - If the case is in progress the Status is set to \'Open\'.\ - When the call is over, the Status is set to \'Held\'.\ - If the call needs to be done then the Status is set to \'Not Held\'.'), + help='The status is set to \'Todo\', when a case is created.\ + If the case is in progress the status is set to \'Open\'.\ + When the call is over, the status is set to \'Held\'.\ + If the call needs to be done then the status is set to \'Not Held\'.'), 'email_from': fields.char('Email', size=128, help="These people will receive email."), 'date_open': fields.datetime('Opened', readonly=True), # phonecall fields From 6e4eca2ba7571bf7a90235e6020ff5314db933c3 Mon Sep 17 00:00:00 2001 From: "Foram Katharotiya (OpenERP)" Date: Fri, 12 Oct 2012 18:30:00 +0530 Subject: [PATCH 049/154] [FIX] traceback:ValueError: too many values to unpack bzr revid: fka@tinyerp.com-20121012130000-qtd29ab755kuszsc --- addons/survey/wizard/survey_send_invitation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/survey/wizard/survey_send_invitation.py b/addons/survey/wizard/survey_send_invitation.py index b6d68a47004..4c2840b787d 100644 --- a/addons/survey/wizard/survey_send_invitation.py +++ b/addons/survey/wizard/survey_send_invitation.py @@ -176,7 +176,7 @@ class survey_send_invitation(osv.osv_memory): vals['attachment_ids'] = [(0,0,{'name': a_name, 'datas_fname': a_name, 'datas': str(a_content).encode('base64')}) - for a_name, a_content in attachments] + for a_name, a_content in attachments.items()] ans = self.pool.get('mail.mail').create(cr, uid, vals, context=context) if ans: res_data = {'name': partner.name or _('Unknown'), From d266cad3752d1aa1dcfc09211ee23464ec0d56eb Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Mon, 15 Oct 2012 11:33:01 +0530 Subject: [PATCH 050/154] [IMP] Improve css to hide buttons,switch view,border,chatter composer when give print screen. bzr revid: bth@tinyerp.com-20121015060301-dtoz4lmf3qbpz34g --- addons/web/static/src/css/base.css | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index 8925c3a0964..c64530814b5 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2914,3 +2914,30 @@ div.ui-widget-overlay { -webkit-border-radius: 3px; border-radius: 3px; } + +@media print { + .oe_header_row { + display: none; + } + .oe_button_box{ + display: none; + } + div.oe_mail_thread_action{ + display: none; + } + ul.oe_header{ + display: none; + } + .oe_mail_recthread_actions{ + display: none; + } + .oe_form button{ + display: none; + } + button.oe_invite{ + display: none; + } + .openerp .oe_application .oe_form_sheet { + border: none; + } +} From 86fda4e9e58feb201223f77fb2d368fcd30af3ff Mon Sep 17 00:00:00 2001 From: "Divyesh Makwana (Open ERP)" Date: Mon, 15 Oct 2012 14:08:20 +0530 Subject: [PATCH 051/154] [IMP] mrp_repair : Improved the label string. bzr revid: mdi@tinyerp.com-20121015083820-dck8ofh4cenktlp7 --- addons/mrp_repair/mrp_repair.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/mrp_repair/mrp_repair.py b/addons/mrp_repair/mrp_repair.py index a3ef7186984..8ccf216d6cf 100644 --- a/addons/mrp_repair/mrp_repair.py +++ b/addons/mrp_repair/mrp_repair.py @@ -140,7 +140,7 @@ class mrp_repair(osv.osv): 'location_id': fields.many2one('stock.location', 'Current Location', select=True, readonly=True, states={'draft':[('readonly',False)]}), 'location_dest_id': fields.many2one('stock.location', 'Delivery Location', readonly=True, states={'draft':[('readonly',False)]}), 'move_id': fields.many2one('stock.move', 'Move',required=True, domain="[('product_id','=',product_id)]", readonly=True, states={'draft':[('readonly',False)]}), - 'guarantee_limit': fields.date('Warranty Expiration Limit', help="The warranty expiration limit is computed as: last move date + warranty defined on selected product. If the current date is below the warranty expiration limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."), + 'guarantee_limit': fields.date('Warranty Expiration', help="The warranty expiration limit is computed as: last move date + warranty defined on selected product. If the current date is below the warranty expiration limit, each operation and fee you will add will be set as 'not to invoiced' by default. Note that you can change manually afterwards."), 'operations' : fields.one2many('mrp.repair.line', 'repair_id', 'Operation Lines', readonly=True, states={'draft':[('readonly',False)]}), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', help='Pricelist of the selected partner.'), 'partner_invoice_id':fields.many2one('res.partner', 'Invoicing Address'), From c58f71ee5c26c6dbee6df3c49166de4d414cd819 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Mon, 15 Oct 2012 15:38:45 +0530 Subject: [PATCH 052/154] [IMP] Improve css style for many class. bzr revid: bth@tinyerp.com-20121015100845-g2i2g9md4129mijm --- addons/web/static/src/css/base.css | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c64530814b5..a163155239c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2916,25 +2916,7 @@ div.ui-widget-overlay { } @media print { - .oe_header_row { - display: none; - } - .oe_button_box{ - display: none; - } - div.oe_mail_thread_action{ - display: none; - } - ul.oe_header{ - display: none; - } - .oe_mail_recthread_actions{ - display: none; - } - .oe_form button{ - display: none; - } - button.oe_invite{ + .oe_header_row, ul.oe_header, div.oe_mail_thread_action, .oe_mail_recthread_actions, .oe_button_box, .oe_form button, button.oe_invite { display: none; } .openerp .oe_application .oe_form_sheet { From 74359456741cadfad32963779363c77daffdb782 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Mon, 15 Oct 2012 16:20:11 +0530 Subject: [PATCH 053/154] [IMP] Hide header status. bzr revid: bth@tinyerp.com-20121015105011-0ilbjq5ynahkp9fe --- addons/web/static/src/css/base.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index a163155239c..680ba83ae54 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2916,7 +2916,7 @@ div.ui-widget-overlay { } @media print { - .oe_header_row, ul.oe_header, div.oe_mail_thread_action, .oe_mail_recthread_actions, .oe_button_box, .oe_form button, button.oe_invite { + .oe_header_row, ul.oe_header, div.oe_mail_thread_action, .oe_mail_recthread_actions, .oe_button_box, .oe_form button, button.oe_invite, .oe_form header { display: none; } .openerp .oe_application .oe_form_sheet { From e479d6a05d6e94dfcfbc89af5c784b7b55954f0d Mon Sep 17 00:00:00 2001 From: "Mayur Maheshwari (OpenERP)" Date: Mon, 15 Oct 2012 16:41:10 +0530 Subject: [PATCH 054/154] [IMP]event : improve kanaban button condition bzr revid: mma@tinyerp.com-20121015111110-wvbw3rg54s2c6u3k --- addons/event/event_view.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/event/event_view.xml b/addons/event/event_view.xml index cebc297c6a1..81984637137 100644 --- a/addons/event/event_view.xml +++ b/addons/event/event_view.xml @@ -274,12 +274,12 @@ tickets - ticket + ticket available.

- + -
TOTAL
+
+
Total
@@ -53,4 +53,4 @@ - \ No newline at end of file + From 4c591fa6062cf28d9593e009d5a9ff0c53ab3411 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Wed, 24 Oct 2012 14:47:09 +0200 Subject: [PATCH 100/154] [FIX] ir_attachment: fix regression when counting attachments (OPW 576295) Cherry-pick forward-port of rev-id odo@openerp.com-20120816154020-5s6wbwfb5l2xsnyv from 6.1. Fixes regression introduced by r.4069. bzr revid: odo@openerp.com-20121024124709-28w8rh8xnelvuhwg --- openerp/addons/base/ir/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openerp/addons/base/ir/ir_attachment.py b/openerp/addons/base/ir/ir_attachment.py index 4978378f22a..730df212b4c 100644 --- a/openerp/addons/base/ir/ir_attachment.py +++ b/openerp/addons/base/ir/ir_attachment.py @@ -57,7 +57,7 @@ class ir_attachment(osv.osv): def _search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False, access_rights_uid=None): ids = super(ir_attachment, self)._search(cr, uid, args, offset=offset, limit=limit, order=order, - context=context, count=count, + context=context, count=False, access_rights_uid=access_rights_uid) if not ids: if count: From 93056efe991e4113c6094bba0a381547ed700524 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Wed, 24 Oct 2012 15:15:18 +0200 Subject: [PATCH 101/154] [FIX] misc useability fixes bzr revid: fp@tinyerp.com-20121024131518-jdyd4stnwozzkr8f --- addons/base_calendar/crm_meeting_view.xml | 7 +------ addons/crm/crm_phonecall_view.xml | 2 +- addons/mrp/mrp_view.xml | 6 +++--- addons/purchase/purchase.py | 9 +++++---- addons/purchase/purchase_view.xml | 4 ++-- 5 files changed, 12 insertions(+), 16 deletions(-) diff --git a/addons/base_calendar/crm_meeting_view.xml b/addons/base_calendar/crm_meeting_view.xml index 9dd37afa3d6..e468460e8e3 100644 --- a/addons/base_calendar/crm_meeting_view.xml +++ b/addons/base_calendar/crm_meeting_view.xml @@ -170,12 +170,7 @@
- - + diff --git a/addons/crm/crm_phonecall_view.xml b/addons/crm/crm_phonecall_view.xml index b6e2f09de68..21b0d295476 100644 --- a/addons/crm/crm_phonecall_view.xml +++ b/addons/crm/crm_phonecall_view.xml @@ -125,7 +125,7 @@
-

diff --git a/addons/mrp/mrp_view.xml b/addons/mrp/mrp_view.xml index 9e35377986a..1e8cf56b96c 100644 --- a/addons/mrp/mrp_view.xml +++ b/addons/mrp/mrp_view.xml @@ -620,10 +620,10 @@
- or - Cancel + + or Cancel From d41219749a2147d2a7007dd75a47b3a6b4d6d1a6 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 25 Oct 2012 11:11:32 +0200 Subject: [PATCH 106/154] [FIX] pager in m2m does not behave correctly bzr revid: nicolas.vanhoren@openerp.com-20121025091132-zbja03rszs6jiavg --- addons/web/static/src/js/view_list.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/web/static/src/js/view_list.js b/addons/web/static/src/js/view_list.js index 75bf6c2f586..5546105e901 100644 --- a/addons/web/static/src/js/view_list.js +++ b/addons/web/static/src/js/view_list.js @@ -374,7 +374,10 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi var total = dataset.size(); var limit = this.limit() || total; - this.$pager.toggle(total !== 0); + if (total == 0) + this.$pager.hide(); + else + this.$pager.css("display", ""); this.$pager.toggleClass('oe_list_pager_single_page', (total <= limit)); var spager = '-'; if (total) { From 098b23d76b06672a988abbdf10ef6f81951a6fd8 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 25 Oct 2012 11:28:14 +0200 Subject: [PATCH 107/154] [FIX] wrong refactoring about do_switch_view bzr revid: nicolas.vanhoren@openerp.com-20121025092814-d3tpt9lfkn6b9w80 --- addons/web/static/src/js/views.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/web/static/src/js/views.js b/addons/web/static/src/js/views.js index c6b150a4d77..ebc7c326724 100644 --- a/addons/web/static/src/js/views.js +++ b/addons/web/static/src/js/views.js @@ -1281,11 +1281,9 @@ instance.web.View = instance.web.Widget.extend({ }, /** * Switches to a specific view type - * - * @param {String} view view type to switch to */ - do_switch_view: function(view) { - this.trigger('switch_mode',view); + do_switch_view: function() { + this.trigger.apply(this, ['switch_mode'].concat(_.toArray(arguments))); }, /** * Cancels the switch to the current view, switches to the previous one From d6fc9033e2c47a2e969148ef14bf0a1d81020db5 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 25 Oct 2012 11:28:33 +0200 Subject: [PATCH 108/154] [FIX] edit button in kanban view does not open the record in edit mode bzr revid: nicolas.vanhoren@openerp.com-20121025092833-4pvl2v0u8kmqapyy --- addons/web_kanban/static/src/js/kanban.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/web_kanban/static/src/js/kanban.js b/addons/web_kanban/static/src/js/kanban.js index 7a179990f6a..39df8123aed 100644 --- a/addons/web_kanban/static/src/js/kanban.js +++ b/addons/web_kanban/static/src/js/kanban.js @@ -826,7 +826,7 @@ instance.web_kanban.KanbanRecord = instance.web.Widget.extend({ type = $action.data('type') || 'button', method = 'do_action_' + (type === 'action' ? 'object' : type); if ((type === 'edit' || type === 'delete') && ! self.view.is_action_enabled(type)) { - self.view.open_record(self.id); + self.view.open_record(self.id, true); } else if (_.str.startsWith(type, 'switch_')) { self.view.do_switch_view(type.substr(7)); } else if (typeof self[method] === 'function') { From 3749817975e99ae47db11a55eb3ef1fd6ff870e3 Mon Sep 17 00:00:00 2001 From: "Bhumi Thakkar (Open ERP)" Date: Thu, 25 Oct 2012 15:56:58 +0530 Subject: [PATCH 109/154] [IMP] remove shadow from kanban title. bzr revid: bth@tinyerp.com-20121025102658-w2ikl6aqtgfllsdr --- addons/web_kanban/static/src/css/kanban.css | 4 ++++ addons/web_kanban/static/src/css/kanban.sass | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/web_kanban/static/src/css/kanban.css b/addons/web_kanban/static/src/css/kanban.css index fbd55dcb0da..3a79c613a92 100644 --- a/addons/web_kanban/static/src/css/kanban.css +++ b/addons/web_kanban/static/src/css/kanban.css @@ -617,4 +617,8 @@ .oe_kanban_groups a[data-type=object], .oe_kanban_groups a[data-type=delete] { visibility: hidden; } + + .openerp .oe_kanban_view .oe_kanban_group_title { + text-shadow: none !important; + } } diff --git a/addons/web_kanban/static/src/css/kanban.sass b/addons/web_kanban/static/src/css/kanban.sass index 1b749731111..eee4989f46a 100644 --- a/addons/web_kanban/static/src/css/kanban.sass +++ b/addons/web_kanban/static/src/css/kanban.sass @@ -509,6 +509,7 @@ a &[data-type=object], &[data-type=delete] visibility: hidden - + .openerp .oe_kanban_view .oe_kanban_group_title + text-shadow: none !important // au BufWritePost,FileWritePost *.sass :!sass --style expanded --line-numbers > "%:p:r.css" // vim:tabstop=4:shiftwidth=4:softtabstop=4:fdm=marker: From 9de8965ebb7a61f6f9b2c90486a7c83ef9025054 Mon Sep 17 00:00:00 2001 From: niv-openerp Date: Thu, 25 Oct 2012 14:25:06 +0200 Subject: [PATCH 110/154] [FIX] make the graph tolerant about formatting in group bys bzr revid: nicolas.vanhoren@openerp.com-20121025122506-2a0xo9nfeeg6dlw4 --- addons/web_graph/static/src/js/graph.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/web_graph/static/src/js/graph.js b/addons/web_graph/static/src/js/graph.js index df26e6fc123..b0106bc8f01 100644 --- a/addons/web_graph/static/src/js/graph.js +++ b/addons/web_graph/static/src/js/graph.js @@ -287,7 +287,11 @@ instance.web_graph.GraphView = instance.web.View.extend({ function _convert(field, data, tick) { tick = tick === undefined ? true : false; - data = instance.web.format_value(data, fields[field]); + try { + data = instance.web.format_value(data, fields[field]); + } catch(e) { + data = "" + data; + } if (tick) { if (ticks[data] === undefined) ticks[data] = _.size(ticks); From 9a016b46447029dc103a12c3b5755fb729206d41 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Thu, 25 Oct 2012 17:10:13 +0200 Subject: [PATCH 111/154] [FIX] useability bzr revid: fp@tinyerp.com-20121025151013-cd0gvro61h8224tv --- addons/account_voucher/voucher_sales_purchase_view.xml | 4 ++-- addons/hr/hr.py | 2 +- addons/hr/hr_view.xml | 4 ++-- addons/hr_expense/hr_expense.py | 10 +++++----- addons/hr_expense/hr_expense_view.xml | 6 +++--- addons/hr_recruitment/hr_recruitment_view.xml | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index a362c553ccd..0441424cc33 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -64,7 +64,7 @@
@@ -209,7 +209,7 @@
+
+ +
diff --git a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py index 2af8792472e..652d5139288 100644 --- a/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py +++ b/addons/hr_timesheet_sheet/wizard/hr_timesheet_current.py @@ -36,7 +36,7 @@ class hr_timesheet_current_open(osv.osv_memory): user_ids = self.pool.get('hr.employee').search(cr, uid, [('user_id','=',uid)], context=context) if not len(user_ids): raise osv.except_osv(_('Error!'), _('Please create an employee and associate it with this user.')) - ids = ts.search(cr, uid, [('user_id','=',uid),('state','=','draft'),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context) + ids = ts.search(cr, uid, [('user_id','=',uid),('state','in',('draft','new')),('date_from','<=',time.strftime('%Y-%m-%d')), ('date_to','>=',time.strftime('%Y-%m-%d'))], context=context) if len(ids) > 1: view_type = 'tree,form' From 0537147d95a1f7b795e6043c7dbdc774dd8dd1b2 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 26 Oct 2012 12:08:19 +0200 Subject: [PATCH 123/154] [IMP] expression.py: added tests for the in/not in operators involving a many2many. bzr revid: vmt@openerp.com-20121026100819-b2o4q9a082um6p2m --- openerp/addons/base/tests/__init__.py | 6 +- openerp/addons/base/tests/test_expression.py | 58 ++++++++++++++++++++ 2 files changed, 62 insertions(+), 2 deletions(-) create mode 100644 openerp/addons/base/tests/test_expression.py diff --git a/openerp/addons/base/tests/__init__.py b/openerp/addons/base/tests/__init__.py index 42fef2eb39d..409f9928c6f 100644 --- a/openerp/addons/base/tests/__init__.py +++ b/openerp/addons/base/tests/__init__.py @@ -1,5 +1,7 @@ -import test_ir_values, test_base +import test_base, test_expression, test_ir_values checks = [ - test_ir_values, test_base + test_base, + test_expression, + test_ir_values, ] diff --git a/openerp/addons/base/tests/test_expression.py b/openerp/addons/base/tests/test_expression.py new file mode 100644 index 00000000000..0bdd4180c0b --- /dev/null +++ b/openerp/addons/base/tests/test_expression.py @@ -0,0 +1,58 @@ +import unittest2 + +import openerp.tests.common as common + +class test_expression(common.TransactionCase): + + def test_00(self): + + registry, cr, uid = self.registry, self.cr, self.uid + + categories = registry('res.partner.category') + cat_a = categories.create(cr, uid, {'name': 'test_expression_category_A'}) + cat_b = categories.create(cr, uid, {'name': 'test_expression_category_B'}) + + partners = registry('res.partner') + a = partners.create(cr, uid, {'name': 'test_expression_partner_A', 'category_id': [(6, 0, [cat_a])]}) + b = partners.create(cr, uid, {'name': 'test_expression_partner_B', 'category_id': [(6, 0, [cat_b])]}) + ab = partners.create(cr, uid, {'name': 'test_expression_partner_AB', 'category_id': [(6, 0, [cat_a, cat_b])]}) + c = partners.create(cr, uid, {'name': 'test_expression_partner_C'}) + + with_a = partners.search(cr, uid, [('category_id', 'in', [cat_a])]) + self.assertEqual(set([a, ab]), set(with_a), "Search for category_id in cat_a failed.") + + with_b = partners.search(cr, uid, [('category_id', 'in', [cat_b])]) + self.assertEqual(set([ab, b]), set(with_b), "Search for category_id in cat_b failed.") + + with_a_or_b = partners.search(cr, uid, [('category_id', 'in', [cat_a, cat_b])]) + self.assertEqual(set([ab, a, b]), set(with_a_or_b), "Search for category_id contains cat_a or cat_b failed.") + + with_a_and_b = partners.search(cr, uid, [('category_id', 'in', [cat_a]), ('category_id', 'in', [cat_b])]) + self.assertEqual(set([ab]), set(with_a_and_b), "Search for category_id contains cat_a and cat_b failed.") + + # Note it is the same as with_a_or_b above. + with_a_or_with_b = partners.search(cr, uid, ['|', ('category_id', 'in', [cat_a]), ('category_id', 'in', [cat_b])]) + self.assertEqual(set([ab, a, b]), set(with_a_or_with_b), "Search for category_id contains cat_a or contains cat_b failed.") + + without_a_or_b = partners.search(cr, uid, [('category_id', 'not in', [cat_a, cat_b])]) + self.assertTrue(all(i not in without_a_or_b for i in [a, b, ab]), "Search for category_id doesn't contain cat_a or cat_b failed (1).") + self.assertTrue(c in without_a_or_b, "Search for category_id doesn't contain cat_a or cat_b failed (2).") + + without_a_and_without_b = partners.search(cr, uid, [('category_id', 'not in', [cat_a]), ('category_id', 'not in', [cat_b])]) + self.assertTrue(all(i not in without_a_and_without_b for i in [a, b, ab]), "Search for category_id doesn't contain cat_a and cat_b failed (1).") + self.assertTrue(c in without_a_and_without_b, "Search for category_id doesn't contain cat_a and cat_b failed (2).") + + without_a = partners.search(cr, uid, [('category_id', 'not in', [cat_a])]) + self.assertTrue(a not in without_a, "Search for category_id doesn't contain cat_a failed (1).") + self.assertTrue(ab not in without_a, "Search for category_id doesn't contain cat_a failed (2).") + self.assertTrue(set([b, c]).issubset(set(without_a)), "Search for category_id doesn't contain cat_a failed (3).") + + without_b = partners.search(cr, uid, [('category_id', 'not in', [cat_b])]) + self.assertTrue(b not in without_b, "Search for category_id doesn't contain cat_b failed (1).") + self.assertTrue(ab not in without_b, "Search for category_id doesn't contain cat_b failed (2).") + self.assertTrue(set([a, c]).issubset(set(without_b)), "Search for category_id doesn't contain cat_b failed (3).") + + # We can't express the following. + # with_any_other_than_a = ... + # self.assertTrue(ab in with_any_other_than_a, "Search for category_id with any other than cat_a failed.") + From 458f6de18480d7af72700752aea54f29da39b312 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 12:12:41 +0200 Subject: [PATCH 124/154] [IMP] typo bzr revid: fp@tinyerp.com-20121026101241-d7j0vaujc73go3bf --- .../hr_timesheet_sheet/static/src/xml/timesheet.xml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml b/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml index 667c7af23be..4390c7c6ed1 100644 --- a/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml +++ b/addons/hr_timesheet_sheet/static/src/xml/timesheet.xml @@ -54,12 +54,16 @@

- Click to add a project you worked on. + Click to add projects/analytic accounts you worked on.

You will be able to register your working hours and - activities on these projects. You can also click on a - selected project/analytic account to setup the - invoicing options. + activities. +

+ By default, you record timesheets on analytic accounts. + But if an analytic account represents a customer + contract, you can change the type of the analytic + account to 'Contract or Project' to setup the invoicing + options.

From 56c1a398a08cb74b8bf4e02e4f2894777a313516 Mon Sep 17 00:00:00 2001 From: Vo Minh Thu Date: Fri, 26 Oct 2012 13:01:09 +0200 Subject: [PATCH 125/154] [IMP] expression.py: added comments to the in/not in many2many tests. bzr revid: vmt@openerp.com-20121026110109-l212flw0p5cklc6p --- openerp/addons/base/tests/test_expression.py | 28 +++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/openerp/addons/base/tests/test_expression.py b/openerp/addons/base/tests/test_expression.py index 0bdd4180c0b..5690cff443a 100644 --- a/openerp/addons/base/tests/test_expression.py +++ b/openerp/addons/base/tests/test_expression.py @@ -4,10 +4,12 @@ import openerp.tests.common as common class test_expression(common.TransactionCase): - def test_00(self): + def test_in_not_in_m2m(self): registry, cr, uid = self.registry, self.cr, self.uid + # Create 4 partners with no category, or one or two categories (out of two categories). + categories = registry('res.partner.category') cat_a = categories.create(cr, uid, {'name': 'test_expression_category_A'}) cat_b = categories.create(cr, uid, {'name': 'test_expression_category_B'}) @@ -18,41 +20,53 @@ class test_expression(common.TransactionCase): ab = partners.create(cr, uid, {'name': 'test_expression_partner_AB', 'category_id': [(6, 0, [cat_a, cat_b])]}) c = partners.create(cr, uid, {'name': 'test_expression_partner_C'}) + # The tests. + + # On a one2many or many2many field, `in` should be read `contains` (and + # `not in` should be read `doesn't contain`. + with_a = partners.search(cr, uid, [('category_id', 'in', [cat_a])]) self.assertEqual(set([a, ab]), set(with_a), "Search for category_id in cat_a failed.") with_b = partners.search(cr, uid, [('category_id', 'in', [cat_b])]) self.assertEqual(set([ab, b]), set(with_b), "Search for category_id in cat_b failed.") + # Partners with the category A or the category B. with_a_or_b = partners.search(cr, uid, [('category_id', 'in', [cat_a, cat_b])]) self.assertEqual(set([ab, a, b]), set(with_a_or_b), "Search for category_id contains cat_a or cat_b failed.") - with_a_and_b = partners.search(cr, uid, [('category_id', 'in', [cat_a]), ('category_id', 'in', [cat_b])]) - self.assertEqual(set([ab]), set(with_a_and_b), "Search for category_id contains cat_a and cat_b failed.") - - # Note it is the same as with_a_or_b above. + # Show that `contains list` is really `contains element or contains element`. with_a_or_with_b = partners.search(cr, uid, ['|', ('category_id', 'in', [cat_a]), ('category_id', 'in', [cat_b])]) self.assertEqual(set([ab, a, b]), set(with_a_or_with_b), "Search for category_id contains cat_a or contains cat_b failed.") + # If we change the OR in AND... + with_a_and_b = partners.search(cr, uid, [('category_id', 'in', [cat_a]), ('category_id', 'in', [cat_b])]) + self.assertEqual(set([ab]), set(with_a_and_b), "Search for category_id contains cat_a and cat_b failed.") + + # Partners without category A and without category B. without_a_or_b = partners.search(cr, uid, [('category_id', 'not in', [cat_a, cat_b])]) self.assertTrue(all(i not in without_a_or_b for i in [a, b, ab]), "Search for category_id doesn't contain cat_a or cat_b failed (1).") self.assertTrue(c in without_a_or_b, "Search for category_id doesn't contain cat_a or cat_b failed (2).") + # Show that `doesn't contain list` is really `doesn't contain element and doesn't contain element`. without_a_and_without_b = partners.search(cr, uid, [('category_id', 'not in', [cat_a]), ('category_id', 'not in', [cat_b])]) self.assertTrue(all(i not in without_a_and_without_b for i in [a, b, ab]), "Search for category_id doesn't contain cat_a and cat_b failed (1).") self.assertTrue(c in without_a_and_without_b, "Search for category_id doesn't contain cat_a and cat_b failed (2).") + # We can exclude any partner containing the category A. without_a = partners.search(cr, uid, [('category_id', 'not in', [cat_a])]) self.assertTrue(a not in without_a, "Search for category_id doesn't contain cat_a failed (1).") self.assertTrue(ab not in without_a, "Search for category_id doesn't contain cat_a failed (2).") self.assertTrue(set([b, c]).issubset(set(without_a)), "Search for category_id doesn't contain cat_a failed (3).") + # (Obviously we can do the same for cateory B.) without_b = partners.search(cr, uid, [('category_id', 'not in', [cat_b])]) self.assertTrue(b not in without_b, "Search for category_id doesn't contain cat_b failed (1).") self.assertTrue(ab not in without_b, "Search for category_id doesn't contain cat_b failed (2).") self.assertTrue(set([a, c]).issubset(set(without_b)), "Search for category_id doesn't contain cat_b failed (3).") - # We can't express the following. + # We can't express the following: Partners with a category different than A. # with_any_other_than_a = ... - # self.assertTrue(ab in with_any_other_than_a, "Search for category_id with any other than cat_a failed.") + # self.assertTrue(a not in with_any_other_than_a, "Search for category_id with any other than cat_a failed (1).") + # self.assertTrue(ab in with_any_other_than_a, "Search for category_id with any other than cat_a failed (2).") From 08db8bbf0f015fd710e1ce79a55fb8faf143f6d5 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 15:05:05 +0200 Subject: [PATCH 126/154] [IMP] useability bzr revid: fp@tinyerp.com-20121026130505-7pdeq2bq3nne7h01 --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 2 ++ 2 files changed, 5 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c3aac6089f0..c18c4d89581 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1326,6 +1326,9 @@ .openerp .oe_view_manager .oe_view_manager_body { height: inherit; } +.openerp .oe_view_manager .oe_view_manager_body .oe_view_manager_view_list { + min-height: 132px; +} .openerp .oe_view_manager .oe_view_manager_view_kanban { height: inherit; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cf1cd38aad2..8b24e6112ae 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1070,6 +1070,8 @@ $sheet-max-width: 860px .oe_view_manager .oe_view_manager_body height: inherit + .oe_view_manager_view_list + min-height: 132px .oe_view_manager_view_kanban height: inherit From a414040f8058ccc0c61312decfff12a19fc7ce56 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 16:37:41 +0200 Subject: [PATCH 127/154] [FIX] account visible when required bzr revid: fp@tinyerp.com-20121026143741-8e46e34v2ngej39w --- addons/account_voucher/voucher_sales_purchase_view.xml | 4 ++-- addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/account_voucher/voucher_sales_purchase_view.xml b/addons/account_voucher/voucher_sales_purchase_view.xml index 0441424cc33..bda9b9c2532 100644 --- a/addons/account_voucher/voucher_sales_purchase_view.xml +++ b/addons/account_voucher/voucher_sales_purchase_view.xml @@ -89,7 +89,7 @@ - + @@ -243,7 +243,7 @@ - + diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml index a7e7bb6d097..c41aae4c21f 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml @@ -108,7 +108,7 @@ - + @@ -153,9 +153,9 @@ - - - + + + From 0e3f06bf4e51d304e7b40cd92d353ac9a9d03ba3 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 16:52:22 +0200 Subject: [PATCH 128/154] fix bzr revid: fp@tinyerp.com-20121026145222-q3k000saytdg9u2s --- addons/web/static/src/css/base.css | 3 --- addons/web/static/src/css/base.sass | 2 -- 2 files changed, 5 deletions(-) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c18c4d89581..c3aac6089f0 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -1326,9 +1326,6 @@ .openerp .oe_view_manager .oe_view_manager_body { height: inherit; } -.openerp .oe_view_manager .oe_view_manager_body .oe_view_manager_view_list { - min-height: 132px; -} .openerp .oe_view_manager .oe_view_manager_view_kanban { height: inherit; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index 8b24e6112ae..cf1cd38aad2 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1070,8 +1070,6 @@ $sheet-max-width: 860px .oe_view_manager .oe_view_manager_body height: inherit - .oe_view_manager_view_list - min-height: 132px .oe_view_manager_view_kanban height: inherit From 00caf72c6c1d679935f4f1359eca83762f40adc4 Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 17:28:50 +0200 Subject: [PATCH 129/154] [IMP] CSS bzr revid: fp@tinyerp.com-20121026152850-bevh0selibxvsixm --- addons/web/static/src/css/base.css | 3 +++ addons/web/static/src/css/base.sass | 3 +++ 2 files changed, 6 insertions(+) diff --git a/addons/web/static/src/css/base.css b/addons/web/static/src/css/base.css index c3aac6089f0..cbbd8e37f6c 100644 --- a/addons/web/static/src/css/base.css +++ b/addons/web/static/src/css/base.css @@ -2519,6 +2519,9 @@ .openerp .oe_form_field_one2many > .oe_view_manager .oe_list_pager_single_page, .openerp .oe_form_field_many2many > .oe_view_manager .oe_list_pager_single_page { display: none !important; } +.openerp .oe_form_field_one2many > .oe_view_manager .oe_view_manager_view_list, .openerp .oe_form_field_many2many > .oe_view_manager .oe_view_manager_view_list { + min-height: 132px; +} .openerp .oe_form_field_one2many .oe_form_field_one2many_list_row_add, .openerp .oe_form_field_many2many .oe_form_field_one2many_list_row_add { font-weight: bold; } diff --git a/addons/web/static/src/css/base.sass b/addons/web/static/src/css/base.sass index cf1cd38aad2..2ef9a8a451d 100644 --- a/addons/web/static/src/css/base.sass +++ b/addons/web/static/src/css/base.sass @@ -1983,6 +1983,9 @@ $sheet-max-width: 860px > .oe_view_manager .oe_list_pager_single_page display: none !important + .oe_view_manager_view_list + min-height: 132px + .oe_form_field_one2many_list_row_add font-weight: bold .oe_list_content From e6159de18f912832acffb3b5cf50537766e7df1c Mon Sep 17 00:00:00 2001 From: Fabien Pinckaers Date: Fri, 26 Oct 2012 17:34:36 +0200 Subject: [PATCH 130/154] [IMP] useability bzr revid: fp@tinyerp.com-20121026153436-v3y2i49iarpoknok --- addons/sale/sale.py | 2 +- addons/sale/sale_view.xml | 5 +---- addons/sale_margin/sale_margin_view.xml | 9 +++------ 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 9c7f07edb25..7c77e239abb 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -202,7 +202,7 @@ class sale_order(osv.osv): - With 'Before Delivery', a draft invoice is created, and it must be paid before delivery."""), 'pricelist_id': fields.many2one('product.pricelist', 'Pricelist', required=True, readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="Pricelist for current sales order."), 'currency_id': fields.related('pricelist_id', 'currency_id', type="many2one", relation="res.currency", readonly=True, required=True), - 'project_id': fields.many2one('account.analytic.account', 'Contract/Analytic Account', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."), + 'project_id': fields.many2one('account.analytic.account', 'Contract / Analytic', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}, help="The analytic account related to a sales order."), 'order_line': fields.one2many('sale.order.line', 'order_id', 'Order Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}), 'invoice_ids': fields.many2many('account.invoice', 'sale_order_invoice_rel', 'order_id', 'invoice_id', 'Invoices', readonly=True, help="This is the list of invoices that have been generated for this sales order. The same sales order may have been invoiced in several times (by line for example)."), diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml index a5d7b9d3af2..bdc687f6e87 100644 --- a/addons/sale/sale_view.xml +++ b/addons/sale/sale_view.xml @@ -286,11 +286,8 @@
- -
-