diff --git a/addons/account_payment/account_payment.py b/addons/account_payment/account_payment.py index 0f6dca56d15..84eeddfb5db 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 is 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/document/std_index.py b/addons/document/std_index.py index 95c5e594c25..b20874e72f8 100644 --- a/addons/document/std_index.py +++ b/addons/document/std_index.py @@ -103,7 +103,7 @@ class DocIndex(indexer): return _to_unicode(data) except OSError: - _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.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 diff --git a/addons/edi/__init__.py b/addons/edi/__init__.py index 46fabbc2fd0..0be96869f61 100644 --- a/addons/edi/__init__.py +++ b/addons/edi/__init__.py @@ -29,7 +29,7 @@ _logger = logging.getLogger(__name__) try: import controllers except ImportError: - _logger.warn( + _logger.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/stock/stock.py b/addons/stock/stock.py index 729e0976f94..999b495a4d5 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -425,7 +425,7 @@ 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.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.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