diff --git a/addons/account/account_move_line.py b/addons/account/account_move_line.py
index 307ab1f58da..2987b3c69d6 100644
--- a/addons/account/account_move_line.py
+++ b/addons/account/account_move_line.py
@@ -300,19 +300,15 @@ class account_move_line(osv.osv):
context = {}
c = context.copy()
c['initital_bal'] = True
- sql = [
- """SELECT l2.id, SUM(l1.debit-l1.credit) FROM account_move_line l1, account_move_line l2""",
- """WHERE l2.account_id = l1.account_id""",
- """AND""",
- """l1.id <= l2.id""",
- """AND""",
- """l2.id IN %s""",
- """AND""",
- self._query_get(cr, uid, obj='l1', context=c),
- """ GROUP BY l2.id""",
- ]
+ sql = """SELECT l2.id, SUM(l1.debit-l1.credit)
+ FROM account_move_line l1, account_move_line l2
+ WHERE l2.account_id = l1.account_id
+ AND l1.id <= l2.id
+ AND l2.id IN %%s AND """ + \
+ self._query_get(cr, uid, obj='l1', context=c) + \
+ " GROUP BY l2.id"
- cr.execute('\n'.join(sql), [tuple(ids)])
+ cr.execute(sql, [tuple(ids)])
res = dict(cr.fetchall())
return res
diff --git a/addons/account/invoice.py b/addons/account/invoice.py
index 9ae8a141f97..3f675f90a07 100644
--- a/addons/account/invoice.py
+++ b/addons/account/invoice.py
@@ -385,7 +385,7 @@ class account_invoice(osv.osv):
raise orm.except_orm(_('Configuration Error!'),
_('There is no Accounting Journal of type Sale/Purchase defined!'))
else:
- raise orm.except_orm(_('UnknownError'), str(e))
+ raise orm.except_orm(_('Unknown Error'), str(e))
def confirm_paid(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'paid'}, context=context)
diff --git a/addons/account/test/account_report.yml b/addons/account/test/account_report.yml
index 0e0ddfb3e99..aaf45de3212 100644
--- a/addons/account/test/account_report.yml
+++ b/addons/account/test/account_report.yml
@@ -42,13 +42,9 @@
Print the Aged Partner Balance Report
-
!python {model: res.partner}: |
- import netsvc, tools, os, time
+ import time
from datetime import datetime
from dateutil.relativedelta import relativedelta
- import warnings
- import md5
- import hashlib
- warnings.filterwarnings('ignore',".*struct integer overflow masking is deprecated*")
start = datetime.fromtimestamp(time.mktime(time.strptime(time.strftime('%Y-%m-%d'), "%Y-%m-%d")))
start = datetime(int(start.year), int(start.month), int(start.day))
res = {}
@@ -71,12 +67,18 @@
query_line = obj_move._query_get(cr, uid, obj='l', context=ctx)
- data_dict = {'model': 'ir.ui.menu', 'form': {'chart_account_id':ref('account.chart0'),'initial_balance': 1, 'periods': period_list,'journal_ids':journal_ids, 'page_split': 0, 'date_from': time.strftime('%Y-%m-%d'), 'period_length': 30, 'amount_currency': 0,'query_line' : query_line, 'result_selection': 'customer','direction_selection': 'past','fiscalyear_id':fy_id}}
+ data_dict = {'model': 'ir.ui.menu', 'form': \
+ {'chart_account_id':ref('account.chart0'),
+ 'initial_balance': 1, 'periods': period_list,
+ 'journal_ids':journal_ids, 'page_split': 0,
+ 'date_from': time.strftime('%Y-%m-%d'),
+ 'period_length': 30, 'amount_currency': 0,
+ 'query_line' : query_line, 'result_selection':
+ 'customer','direction_selection':
+ 'past','fiscalyear_id':fy_id } }
data_dict['form'].update(res)
- (data, format) = netsvc.LocalService('report.account.aged_trial_balance').create(cr, uid, [], data_dict, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'account-aged_partner_balance.'+format), 'wb+').write(data)
-
+ from tools.test_reports import try_report
+ try_report(cr, uid, 'report.account.aged_trial_balance', [], data_dict, context={})
-
Print the Account Balance Sheet in Horizontal mode
-
diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py
index 2704ec987f3..58f2357d452 100644
--- a/addons/analytic/analytic.py
+++ b/addons/analytic/analytic.py
@@ -153,7 +153,7 @@ class account_analytic_account(osv.osv):
}
def check_recursion(self, cr, uid, ids, parent=None):
- return super(account_analytic_account, self).check_recursion(cr, uid, ids, parent=parent)
+ return super(account_analytic_account, self)._check_recursion(cr, uid, ids, parent=parent)
_order = 'date_start desc,parent_id desc,code'
_constraints = [
diff --git a/addons/board/board.py b/addons/board/board.py
index 9677c8aaa17..6049f501e00 100644
--- a/addons/board/board.py
+++ b/addons/board/board.py
@@ -185,7 +185,7 @@ class board_note_type(osv.osv):
Board note Type
"""
_name = 'board.note.type'
- _description = "NOte Type"
+ _description = "Note Type"
_columns = {
'name': fields.char('Note Type', size=64, required=True),
diff --git a/addons/caldav/wizard/calendar_event_export_view.xml b/addons/caldav/wizard/calendar_event_export_view.xml
index 3161bb7d45e..8b74e29a98e 100644
--- a/addons/caldav/wizard/calendar_event_export_view.xml
+++ b/addons/caldav/wizard/calendar_event_export_view.xml
@@ -19,20 +19,11 @@
-
-
- Export .ics File
- calendar.event.export
- form
- tree,form
-
- new
-
-
diff --git a/addons/caldav/wizard/calendar_event_import_view.xml b/addons/caldav/wizard/calendar_event_import_view.xml
index 41afcc7fcfd..e580e6b2733 100644
--- a/addons/caldav/wizard/calendar_event_import_view.xml
+++ b/addons/caldav/wizard/calendar_event_import_view.xml
@@ -37,18 +37,10 @@
-
- Import .ics File
- calendar.event.import
- form
- tree,form
-
- new
-
-
diff --git a/addons/claim_from_delivery/__init__.py b/addons/claim_from_delivery/__init__.py
index 6c1b79535b5..5e947ee409d 100644
--- a/addons/claim_from_delivery/__init__.py
+++ b/addons/claim_from_delivery/__init__.py
@@ -17,7 +17,7 @@
# along with this program. If not, see .
#
##############################################################################
-import claim_delivery
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/claim_from_delivery/claim_delivery.py b/addons/claim_from_delivery/claim_delivery.py
deleted file mode 100644
index 67e6f0baae2..00000000000
--- a/addons/claim_from_delivery/claim_delivery.py
+++ /dev/null
@@ -1,33 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# 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 .
-#
-##############################################################################
-
-from osv import fields, osv
-
-class stock_picking(osv.osv):
- _inherit = "stock.picking"
- _columns = {
- 'partner_id': fields.related('address_id', 'partner_id', type='many2one', relation="res.partner", string="Partner"),
- }
-
-stock_picking()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/crm_profiling/crm_profiling.py b/addons/crm_profiling/crm_profiling.py
index 86cd41c0335..e5165f5b186 100644
--- a/addons/crm_profiling/crm_profiling.py
+++ b/addons/crm_profiling/crm_profiling.py
@@ -266,7 +266,7 @@ class crm_segmentation(osv.osv):
}
_constraints = [
- (orm.orm.check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id'])
+ (orm.orm._check_recursion, 'Error ! You can not create recursive profiles.', ['parent_id'])
]
def process_continue(self, cr, uid, ids, start=False):
diff --git a/addons/delivery/stock.py b/addons/delivery/stock.py
index c9fd50986f7..23cc1563cff 100644
--- a/addons/delivery/stock.py
+++ b/addons/delivery/stock.py
@@ -160,13 +160,12 @@ class stock_move(osv.osv):
_columns = {
'weight': fields.function(_cal_move_weight, method=True, type='float', string='Weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',
store={
- 'stock.move': (lambda self, cr, uid, ids, c={}: ids, ['product_id', 'product_qty', 'product_uom'], 20),
+ 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
}),
'weight_net': fields.function(_cal_move_weight, method=True, type='float', string='Net weight', digits_compute= dp.get_precision('Stock Weight'), multi='_cal_move_weight',
store={
- 'stock.move': (lambda self, cr, uid, ids, c={}: ids, ['product_id', 'product_qty', 'product_uom'], 20),
+ 'stock.move': (lambda self, cr, uid, ids, c=None: ids, ['product_id', 'product_qty', 'product_uom'], 20),
}),
-
}
stock_move()
diff --git a/addons/email_template/email_template.py b/addons/email_template/email_template.py
index def74fe17dc..4b1ec7e8e0f 100644
--- a/addons/email_template/email_template.py
+++ b/addons/email_template/email_template.py
@@ -23,10 +23,9 @@
import base64
import random
import netsvc
+import logging
import re
-LOGGER = netsvc.Logger()
-
TEMPLATE_ENGINES = []
from osv import osv, fields
@@ -35,12 +34,9 @@ from tools.translate import _
try:
from mako.template import Template as MakoTemplate
TEMPLATE_ENGINES.append(('mako', 'Mako Templates'))
-except:
- LOGGER.notifyChannel(
- _("Email Template"),
- netsvc.LOG_WARNING,
- _("Mako templates not installed")
- )
+except ImportError:
+ logging.getLogger('init').warning("module email_template: Mako templates not installed")
+
try:
from django.template import Context, Template as DjangoTemplate
#Workaround for bug:
@@ -49,12 +45,8 @@ try:
settings.configure()
#Workaround ends
TEMPLATE_ENGINES.append(('django', 'Django Template'))
-except:
- LOGGER.notifyChannel(
- _("Email Template"),
- netsvc.LOG_WARNING,
- _("Django templates not installed")
- )
+except ImportError:
+ logging.getLogger('init').warning("module email_template: Django templates not installed")
import tools
import pooler
diff --git a/addons/event/event.py b/addons/event/event.py
index ab90fe64803..8c8bed8584b 100644
--- a/addons/event/event.py
+++ b/addons/event/event.py
@@ -247,17 +247,7 @@ class event_event(osv.osv):
}
def _check_recursion(self, cr, uid, ids):
- """
- Checks for recursion level for event
- """
- level = 100
- while len(ids):
- cr.execute('SELECT DISTINCT parent_id FROM event_event WHERE id IN %s', (tuple(ids),))
- ids = filter(None, map(lambda x: x[0], cr.fetchall()))
- if not level:
- return False
- level -= 1
- return True
+ return super(event_event, self)._check_recursion(cr, uid, ids)
def _check_closing_date(self, cr, uid, ids):
for event in self.browse(cr, uid, ids):
diff --git a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
index 9a22de4d828..39c2d9c6769 100644
--- a/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
+++ b/addons/hr_timesheet_invoice/test/test_hr_timesheet_invoice.yml
@@ -44,8 +44,8 @@
I check that Invoice is created for this timesheet.
-
!python {model: account.analytic.line}: |
- account_id = self.pool.get('account.analytic.line')
- accounts = account_id.browse(cr, uid, [ref("account_analytic_line_developyamlforhrmodule0")])[0]
+ account_id = self.pool.get('account.analytic.line')
+ accounts = account_id.browse(cr, uid, [ref("account_analytic_line_developyamlforhrmodule0")])[0]
exp = self.browse(cr, uid, [ref('account_analytic_line_developyamlforhrmodule0')])[0]
analytic_account_obj = self.pool.get('account.analytic.account')
data = self.pool.get('hr.timesheet.invoice.create').read(cr, uid, [ref("hr_timesheet_invoice_create_0")], [], context)[0]
diff --git a/addons/l10n_ch/test/l10n_ch_report.yml b/addons/l10n_ch/test/l10n_ch_report.yml
index 5b2a636813e..b07c574e5ad 100644
--- a/addons/l10n_ch/test/l10n_ch_report.yml
+++ b/addons/l10n_ch/test/l10n_ch_report.yml
@@ -16,18 +16,12 @@
In order to test the PDF reports defined on a l10n_ch, we will print BVR Report
-
!python {model: account.invoice}: |
- import netsvc, tools, os
- run_str = 'cp ' + tools.config['addons_path'] + '/l10n_ch/report/ocrbb.ttf' + ' ' + '/tmp/ocrbb.ttf'
- os.system(run_str)
- (data, format) = netsvc.LocalService('report.l10n_ch.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_report.'+format), 'wb+').write(data)
+ from tools.test_reports import try_report
+ try_report(cr, uid, 'report.l10n_ch.bvr', [ref('test_invoice_1')])
-
In order to test the PDF reports defined on a l10n_ch, we will print a BVR Invoice Report
-
!python {model: account.invoice}: |
- import netsvc, tools, os
- (data, format) = netsvc.LocalService('report.l10n_ch.invoice.bvr').create(cr, uid, [ref('test_invoice_1')], {}, {})
- if tools.config['test_report_directory']:
- file(os.path.join(tools.config['test_report_directory'], 'l10ch-bvr_invoice_report.'+format), 'wb+').write(data)
+ from tools.test_reports import try_report
+ try_report(cr, uid, 'report.l10n_ch.invoice.bvr', [ref('test_invoice_1')])
diff --git a/addons/product_expiry/product_expiry_demo.xml b/addons/product_expiry/product_expiry_demo.xml
index 4ddeb92e359..bb4962d63c4 100644
--- a/addons/product_expiry/product_expiry_demo.xml
+++ b/addons/product_expiry/product_expiry_demo.xml
@@ -34,7 +34,7 @@
6
4
- 12345678901234
+
10
240
@@ -63,7 +63,7 @@
6
4
- 12345678901234
+
10
240
@@ -92,7 +92,7 @@
6
4
- 12345678901234
+
10
240
@@ -121,7 +121,7 @@
6
4
- 12345678901234
+
10
240
diff --git a/addons/project/board_project_manager_view.xml b/addons/project/board_project_manager_view.xml
index f9db634d51d..6a563bd2910 100644
--- a/addons/project/board_project_manager_view.xml
+++ b/addons/project/board_project_manager_view.xml
@@ -15,7 +15,14 @@
res_model="project.project" view_mode="tree,form"
view_type="form"/>
-
+
diff --git a/addons/purchase/stock.py b/addons/purchase/stock.py
index 987c76e372d..93cd142ac01 100644
--- a/addons/purchase/stock.py
+++ b/addons/purchase/stock.py
@@ -55,7 +55,7 @@ class stock_picking(osv.osv):
ondelete='set null', select=True),
}
_defaults = {
- 'purchase_id': lambda *a: False,
+ 'purchase_id': False,
}
def get_currency_id(self, cursor, user, picking):
diff --git a/addons/sale/stock.py b/addons/sale/stock.py
index 2855323c7a0..72e3f0a6c24 100644
--- a/addons/sale/stock.py
+++ b/addons/sale/stock.py
@@ -188,7 +188,7 @@ class stock_picking(osv.osv):
})
return result
- def action_cancel(self, cr, uid, ids, context={}):
+ def action_cancel(self, cr, uid, ids, context=None):
res = super(stock_picking, self).action_cancel(cr, uid, ids, context=context)
for pick in self.browse(cr, uid, ids, context):
call_ship_end = True
diff --git a/addons/sale_margin/sale_margin.py b/addons/sale_margin/sale_margin.py
index 2f756d5ecda..3a0e09a0309 100644
--- a/addons/sale_margin/sale_margin.py
+++ b/addons/sale_margin/sale_margin.py
@@ -94,13 +94,13 @@ class account_invoice_line(osv.osv):
_columns = {
'cost_price': fields.float('Cost Price', digits=(16, 2)),
}
- def write(self, cr, uid, ids, vals, context={}):
+ def write(self, cr, uid, ids, vals, context=None):
if vals.get('product_id', False):
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price'] = res[0]['standard_price']
return super(account_invoice_line, self).write(cr, uid, ids, vals, context)
- def create(self, cr, uid, vals, context={}):
+ def create(self, cr, uid, vals, context=None):
if vals.get('product_id',False):
res = self.pool.get('product.product').read(cr, uid, [vals['product_id']], ['standard_price'])
vals['cost_price'] = res[0]['standard_price']
diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py
index 01d3b906d29..1f6d7b78e61 100644
--- a/addons/stock_location/stock_location.py
+++ b/addons/stock_location/stock_location.py
@@ -52,10 +52,10 @@ class stock_location_path(osv.osv):
),
}
_defaults = {
- 'auto': lambda *arg: 'auto',
- 'delay': lambda *arg: 1,
- 'invoice_state': lambda *args: 'none',
- 'picking_type':lambda *args:'internal',
+ 'auto': 'auto',
+ 'delay': 1,
+ 'invoice_state': 'none',
+ 'picking_type': 'internal',
}
stock_location_path()