diff --git a/addons/account/account.py b/addons/account/account.py index f0c16d8586c..caf1d68c45d 100644 --- a/addons/account/account.py +++ b/addons/account/account.py @@ -24,11 +24,12 @@ from datetime import datetime 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 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 @@ -212,7 +213,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 +295,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 +311,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 @@ -2095,9 +2093,7 @@ class account_tax(osv.osv): } 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") + _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, product, partner) def _compute(self, cr, uid, taxes, price_unit, quantity, product=None, partner=None): @@ -2969,10 +2965,10 @@ class wizard_multi_charts_accounts(osv.osv_memory): _columns = { 'company_id':fields.many2one('res.company', 'Company', required=True), + 'only_one_chart_template': fields.boolean('Only One Chart Template Available'), 'chart_template_id': fields.many2one('account.chart.template', 'Chart Template', required=True), 'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Cash and Banks', required=True), 'code_digits':fields.integer('# of Digits', required=True, help="No. of Digits to use for account code"), - 'seq_journal':fields.boolean('Separated Journal Sequences', help="Check this box if you want to use a different sequence for each created journal. Otherwise, all will use the same sequence."), "sale_tax": fields.many2one("account.tax.template", "Default Sale Tax"), "purchase_tax": fields.many2one("account.tax.template", "Default Purchase Tax"), 'sale_tax_rate': fields.float('Sales Tax(%)'), @@ -3009,13 +3005,11 @@ class wizard_multi_charts_accounts(osv.osv_memory): res.update({'bank_accounts_id': [{'acc_name': _('Cash'), 'account_type': 'cash'},{'acc_name': _('Bank'), 'account_type': 'bank'}]}) if 'company_id' in fields: res.update({'company_id': self.pool.get('res.users').browse(cr, uid, [uid], context=context)[0].company_id.id}) - if 'seq_journal' in fields: - res.update({'seq_journal': True}) ids = self.pool.get('account.chart.template').search(cr, uid, [('visible', '=', True)], context=context) if ids: if 'chart_template_id' in fields: - res.update({'chart_template_id': ids[0]}) + res.update({'only_one_chart_template': len(ids) == 1, 'chart_template_id': ids[0]}) if 'sale_tax' in fields: sale_tax_ids = tax_templ_obj.search(cr, uid, [("chart_template_id" , "=", ids[0]), ('type_tax_use', 'in', ('sale','all'))], order="sequence") diff --git a/addons/account/account_installer.xml b/addons/account/account_installer.xml index c12fe321edf..e2d67e7fb55 100644 --- a/addons/account/account_installer.xml +++ b/addons/account/account_installer.xml @@ -6,36 +6,34 @@ form - -
+ Accounting Application Configuration
- - Configure - - - - - - - - - - - - - - - - Configure Your Chart of Accounts -
- Install your Chart of Accounts + Configure your Chart of Accounts ir.actions.act_window account.installer diff --git a/addons/account/account_invoice_view.xml b/addons/account/account_invoice_view.xml index fe8ed307aa6..a10cba705e4 100644 --- a/addons/account/account_invoice_view.xml +++ b/addons/account/account_invoice_view.xml @@ -39,7 +39,7 @@ - + @@ -56,13 +56,13 @@ @@ -2071,14 +2071,14 @@ + + - - - - + + - + @@ -2139,13 +2139,14 @@ search - - + + + - - - + + + @@ -2154,7 +2155,7 @@ - + @@ -2261,11 +2262,11 @@ + + - - @@ -2304,8 +2305,7 @@ - - + @@ -2347,48 +2347,61 @@ - Generate Chart of Accounts from a Chart Template + Set Your Accounting Options wizard.multi.charts.accounts form -
- Accounting Application Configuration + Accounting Application Configuration
+ -
+ account.invoice.customer.pay + account.invoice + form + + + + + +