Kuldeep Joshi(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-fix-server-log-account-kjo into
lp:~openerp-dev/openobject-addons/trunk-fix-server-log.
Requested reviews:
Bhumika (OpenERP) (sbh-openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-server-log-account-kjo/+merge/110013
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-fix-server-log-account-kjo/+merge/110013
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-fix-server-log.
=== modified file 'account/account.py'
--- account/account.py 2012-06-05 11:19:46 +0000
+++ account/account.py 2012-06-13 09:35:25 +0000
@@ -24,7 +24,7 @@
from dateutil.relativedelta import relativedelta
from operator import itemgetter
-import netsvc
+import logging
import pooler
from osv import fields, osv
import decimal_precision as dp
@@ -212,7 +212,6 @@
_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 +294,7 @@
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)
+ logging.getLogger('account').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 +310,7 @@
" 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)
+ logging.getLogger('account').debug('Status: %s'%cr.statusmessage)
for res in cr.dictfetchall():
accounts[res['id']] = res
@@ -886,6 +883,7 @@
class account_fiscalyear(osv.osv):
_name = "account.fiscalyear"
_description = "Fiscal Year"
+ _inherit = 'mail.thread'
_columns = {
'name': fields.char('Fiscal Year', size=64, required=True),
'code': fields.char('Code', size=6, required=True),
@@ -982,6 +980,7 @@
class account_period(osv.osv):
_name = "account.period"
_description = "Account period"
+ _inherit = 'mail.thread'
_columns = {
'name': fields.char('Period Name', size=64, required=True),
'code': fields.char('Code', size=12),
@@ -2095,9 +2094,7 @@
}
def compute(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None):
- logger = netsvc.Logger()
- logger.notifyChannel("warning", netsvc.LOG_WARNING,
- "Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included")
+ logging.getLogger('account').debug("Deprecated, use compute_all(...)['taxes'] instead of compute(...) to manage prices with tax included")
return self._compute(cr, uid, taxes, price_unit, quantity, product, partner)
def _compute(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None):
=== modified file 'account/project/report/cost_ledger.py'
--- account/project/report/cost_ledger.py 2012-02-03 11:08:54 +0000
+++ account/project/report/cost_ledger.py 2012-06-13 09:35:25 +0000
@@ -75,10 +75,10 @@
return res
def _account_sum_debit(self, account, date1, date2):
- return self._sum_debit(self, [account], date1, date2)
+ return self._sum_debit([account], date1, date2)
def _account_sum_credit(self, account, date1, date2):
- return self._sum_credit(self, [account], date1, date2)
+ return self._sum_credit([account], date1, date2)
def _account_sum_balance(self, account, date1, date2):
debit = self._account_sum_debit(account, date1, date2)
=== modified file 'account/report/account_general_ledger.rml'
--- account/report/account_general_ledger.rml 2011-12-21 09:08:11 +0000
+++ account/report/account_general_ledger.rml 2012-06-13 09:35:25 +0000
@@ -497,7 +497,7 @@
<para style="terp_default_8">[[ strip_name(line['partner_name'],10) ]]</para>
</td>
<td>
- <para style="terp_default_8">[[ strip_name(line['lref'],9) ]]</para>
+ <para style="terp_default_8">[[ line['lref'] and strip_name(line['lref'],9) ]]</para>
</td>
<td>
<para style="terp_default_8">[[ strip_name(line['move'],9) ]]</para>
@@ -590,7 +590,7 @@
<para style="terp_default_8">[[ strip_name(line['partner_name'],20) ]]</para>
</td>
<td>
- <para style="terp_default_8">[[ strip_name(line['lref'],9) ]]</para>
+ <para style="terp_default_8">[[ line['lref'] and strip_name(line['lref'],9) ]]</para>
</td>
<td>
<para style="terp_default_8">[[ strip_name(line['move'],9) ]]</para>
=== modified file 'account/report/account_general_ledger_landscape.rml'
--- account/report/account_general_ledger_landscape.rml 2011-10-27 21:11:24 +0000
+++ account/report/account_general_ledger_landscape.rml 2012-06-13 09:35:25 +0000
@@ -505,7 +505,7 @@
<para style="terp_default_Bold_7_Right">[[ formatLang(sum_credit_account(o), digits=get_digits(dp='Account')) ]]</para>
</td>
<td>
- <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'), currency = company.currency_id) ]]</para>
+ <para style="terp_default_Bold_7_Right">[[ formatLang(sum_balance_account(o), digits=get_digits(dp='Account'), currency_obj= company.currency_id) ]]</para>
</td>
<td>
<para style="terp_default_Bold_7_Right">[[ o.currency_id and formatLang(sum_currency_amount_account(o), digits=get_digits(dp='Account'),currency_obj=o.currency_id) or '' ]]</para>
@@ -529,7 +529,7 @@
<para style="terp_default_7">[[ strip_name(line['partner_name'],20) ]]</para>
</td>
<td>
- <para style="terp_default_7">[[ strip_name(line['lref'],17) ]]</para>
+ <para style="terp_default_7">[[ line['lref'] and strip_name(line['lref'],17) ]]</para>
</td>
<td>
<para style="terp_default_7">[[ line['move'] ]]</para>
=== modified file 'account/report/account_partner_ledger.rml'
--- account/report/account_partner_ledger.rml 2011-12-21 09:08:11 +0000
+++ account/report/account_partner_ledger.rml 2012-06-13 09:35:25 +0000
@@ -519,7 +519,7 @@
<para style="terp_default_8">[[ line['a_code'] ]]</para>
</td>
<td>
- <para style="terp_default_8">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
+ <para style="terp_default_8">[[ line['ref'] and strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
=== modified file 'account/report/account_partner_ledger_other.rml'
--- account/report/account_partner_ledger_other.rml 2011-12-21 09:08:11 +0000
+++ account/report/account_partner_ledger_other.rml 2012-06-13 09:35:25 +0000
@@ -524,7 +524,7 @@
<para style="terp_default_8">[[ line['a_code'] ]]</para>
</td>
<td>
- <para style="terp_default_8">[[ strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
+ <para style="terp_default_8">[[ line['ref'] and strip_name(line['ref'],10) ]] - [[ strip_name(line['name'],15) ]]</para>
</td>
<td>
<para style="terp_default_Right_8">[[ formatLang((line['debit'])) ]]</para>
=== modified file 'account/report/account_print_invoice.rml'
--- account/report/account_print_invoice.rml 2012-05-04 12:32:02 +0000
+++ account/report/account_print_invoice.rml 2012-06-13 09:35:25 +0000
@@ -162,7 +162,7 @@
</td>
<td>
<para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
- <para style="terp_default_8">[[ display_address(o.partner_id,'invoice') ]]</para>
+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
=== modified file 'account/wizard/account_fiscalyear_close_state.py'
--- account/wizard/account_fiscalyear_close_state.py 2011-03-15 14:53:57 +0000
+++ account/wizard/account_fiscalyear_close_state.py 2012-06-13 09:35:25 +0000
@@ -20,6 +20,7 @@
##############################################################################
from osv import fields, osv
+from tools.translate import _
class account_fiscalyear_close_state(osv.osv_memory):
"""
@@ -56,7 +57,7 @@
# Log message for Fiscalyear
fy_pool = self.pool.get('account.fiscalyear')
fy_code = fy_pool.browse(cr, uid, fy_id, context=context).code
- fy_pool.log(cr, uid, fy_id, "Fiscal year '%s' is closed, no more modification allowed." % (fy_code))
+ fy_pool.message_append_note(cr, uid, [fy_id], body=_("Fiscal year '%s' is closed, no more modification allowed.") % (fy_code))
return {'type': 'ir.actions.act_window_close'}
account_fiscalyear_close_state()
=== modified file 'account/wizard/account_period_close.py'
--- account/wizard/account_period_close.py 2011-12-13 04:41:48 +0000
+++ account/wizard/account_period_close.py 2012-06-13 09:35:25 +0000
@@ -55,9 +55,9 @@
# Log message for Period
for period_id, name in period_pool.name_get(cr, uid, [id]):
- period_pool.log(cr, uid, period_id, "Period '%s' is closed, no more modification allowed for this period." % (name))
+ period_pool.message_append_note(cr, uid, [period_id], body=_("Period '%s' is closed, no more modification allowed for this period.") % (name))
return {'type': 'ir.actions.act_window_close'}
account_period_close()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_analytic_plans/report/crossovered_analytic.py'
--- account_analytic_plans/report/crossovered_analytic.py 2011-01-14 00:11:01 +0000
+++ account_analytic_plans/report/crossovered_analytic.py 2012-06-13 09:35:25 +0000
@@ -109,7 +109,6 @@
res['ref_qty'] = info[0]['qty']
res['ref_amt'] = info[0]['amt']
self.base_amount = info[0]['amt']
-
result.append(res)
return result
=== modified file 'account_analytic_plans/report/crossovered_analytic.rml'
--- account_analytic_plans/report/crossovered_analytic.rml 2011-12-21 09:08:11 +0000
+++ account_analytic_plans/report/crossovered_analytic.rml 2012-06-13 09:35:25 +0000
@@ -237,10 +237,10 @@
<para style="terp_default_Centre_9">[[ a['ref_code'] ]]</para>
</td>
<td>
- <para style="terp_default_Right_9">[[ formatLang(a['ref_qty']) ]]</para>
+ <para style="terp_default_Right_9">[[ a['ref_qty'] and formatLang(a['ref_qty']) ]]</para>
</td>
<td>
- <para style="terp_default_Right_9">[[ formatLang(a['ref_amt'], currency_obj=company.currency_id) ]]</para>
+ <para style="terp_default_Right_9">[[ a['ref_amt'] and formatLang(a['ref_amt'], currency_obj=company.currency_id) ]]</para>
</td>
<td>
<para style="terp_default_Right_9">100.00%</para>
=== modified file 'account_bank_statement_extensions/account_bank_statement.py'
--- account_bank_statement_extensions/account_bank_statement.py 2012-05-04 11:57:48 +0000
+++ account_bank_statement_extensions/account_bank_statement.py 2012-06-13 09:35:25 +0000
@@ -23,7 +23,6 @@
import time
from osv import osv, fields
import decimal_precision as dp
-import netsvc
from tools.translate import _
class account_bank_statement(osv.osv):
=== modified file 'account_bank_statement_extensions/report/bank_statement_balance_report.py'
--- account_bank_statement_extensions/report/bank_statement_balance_report.py 2011-12-23 11:56:02 +0000
+++ account_bank_statement_extensions/report/bank_statement_balance_report.py 2012-06-13 09:35:25 +0000
@@ -23,13 +23,12 @@
import time
from report import report_sxw
import pooler
-import netsvc
-logger=netsvc.Logger()
+import logging
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))
+ #logging('bank.statement.balance.report').warning('addons.'+__name__, 'set_context, objects = %s, data = %s, ids = %s' % (objects, data, ids))
cr = self.cr
uid = self.uid
context = self.context
=== modified file 'account_coda/account_coda.py'
--- account_coda/account_coda.py 2012-02-13 18:07:41 +0000
+++ account_coda/account_coda.py 2012-06-13 09:35:25 +0000
@@ -22,9 +22,7 @@
from osv import osv, fields
import decimal_precision as dp
-import netsvc
from tools.translate import _
-logger=netsvc.Logger()
class coda_bank_account(osv.osv):
_name= 'coda.bank.account'
=== modified file 'account_coda/wizard/account_coda_import.py'
--- account_coda/wizard/account_coda_import.py 2012-02-14 12:25:20 +0000
+++ account_coda/wizard/account_coda_import.py 2012-06-13 09:35:25 +0000
@@ -24,11 +24,10 @@
import base64
from osv import fields,osv
from tools.translate import _
-import netsvc
+import logging
import re
from traceback import format_exception
from sys import exc_info
-logger=netsvc.Logger()
class account_coda_import(osv.osv_memory):
_name = 'account.coda.import'
@@ -816,7 +815,7 @@
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)
+ #logging('account.coda').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 +888,19 @@
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))
+ logging('account.coda').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))
+ logging('account.coda').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))
+ logging('account.coda').error('Unknown Error while processing Statement %s\n%s' % (statement.get('name', '/'),tb))
# end 'for statement in coda_statements'
=== modified file 'account_invoice_layout/report/report_account_invoice_layout.rml'
--- account_invoice_layout/report/report_account_invoice_layout.rml 2012-05-04 12:32:02 +0000
+++ account_invoice_layout/report/report_account_invoice_layout.rml 2012-06-13 09:35:25 +0000
@@ -193,7 +193,7 @@
</td>
<td>
<para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
- <para style="terp_default_8">[[ display_address(o.partner_id, 'invoice') ]]</para>
+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
=== modified file 'account_invoice_layout/report/special_message_invoice.rml'
--- account_invoice_layout/report/special_message_invoice.rml 2012-05-04 12:32:02 +0000
+++ account_invoice_layout/report/special_message_invoice.rml 2012-06-13 09:35:25 +0000
@@ -197,7 +197,7 @@
</td>
<td>
<para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
- <para style="terp_default_8">[[ display_address(o.partner_id, 'invoice') ]]</para>
+ <para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
=== modified file 'account_voucher/report/account_voucher.py'
--- account_voucher/report/account_voucher.py 2011-01-14 00:11:01 +0000
+++ account_voucher/report/account_voucher.py 2012-06-13 09:35:25 +0000
@@ -36,6 +36,8 @@
})
def convert(self, amount, cur):
+ if cur is None:
+ cur='euro'
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
return amt_en
@@ -72,4 +74,4 @@
parser=report_voucher,header="external"
)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account_voucher/report/account_voucher_print.py'
--- account_voucher/report/account_voucher_print.py 2011-01-14 00:11:01 +0000
+++ account_voucher/report/account_voucher_print.py 2012-06-13 09:35:25 +0000
@@ -35,6 +35,7 @@
})
def convert(self, amount, cur):
+ print "\n\n\n =-=-=-convert -=->", cur
amt_en = amount_to_text_en.amount_to_text(amount, 'en', cur)
return amt_en
@@ -93,4 +94,4 @@
parser=report_voucher_print,header="external"
)
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'l10n_be_invoice_bba/invoice.py'
--- l10n_be_invoice_bba/invoice.py 2011-12-19 16:54:40 +0000
+++ l10n_be_invoice_bba/invoice.py 2012-06-13 09:35:25 +0000
@@ -23,8 +23,7 @@
import re, time, random
from osv import fields, osv
from tools.translate import _
-import netsvc
-logger=netsvc.Logger()
+import logging
"""
account.invoice object:
@@ -41,7 +40,7 @@
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 )
+ #logging('l1on.be.invoice.bba').warning('reference_type = %s' %res )
return res
def check_bbacomm(self, val):
@@ -68,7 +67,7 @@
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)
+# logging('l1on.be.invoice.bba').warning('partner_id %s' % partner_id)
reference = False
reference_type = 'none'
if partner_id:
@@ -215,5 +214,5 @@
]
account_invoice()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'l10n_be_invoice_bba/partner.py'
--- l10n_be_invoice_bba/partner.py 2011-12-19 16:54:40 +0000
+++ l10n_be_invoice_bba/partner.py 2012-06-13 09:35:25 +0000
@@ -24,8 +24,6 @@
from osv import fields, osv
import time
from tools.translate import _
-import netsvc
-logger=netsvc.Logger()
class res_partner(osv.osv):
""" add field to indicate default 'Communication Type' on customer invoices """
=== modified file 'mail/mail_thread.py'
--- mail/mail_thread.py 2012-06-13 08:47:45 +0000
+++ mail/mail_thread.py 2012-06-13 09:35:25 +0000
@@ -276,7 +276,6 @@
ir_attachment = self.pool.get('ir.attachment')
mail_message = self.pool.get('mail.message')
-
new_msg_ids = []
for thread in threads:
to_attach = []
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp