[MERGE] forward port branch 8.0 up to 16430be

This commit is contained in:
Christophe Simonis
2016-10-12 15:27:07 +02:00
7 changed files with 9 additions and 15 deletions
+1 -2
View File
@@ -2307,8 +2307,7 @@ class account_model(osv.osv):
pt_obj = self.pool.get('account.payment.term')
period_obj = self.pool.get('account.period')
if context is None:
context = {}
context = dict(context or {})
if data.get('date', False):
context = dict(context)
+2 -4
View File
@@ -709,8 +709,7 @@ class account_move_line(osv.osv):
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False, context=None):
if context is None:
context = {}
context = dict(context or {})
account_obj = self.pool.get('account.account')
journal_obj = self.pool.get('account.journal')
currency_obj = self.pool.get('res.currency')
@@ -1131,8 +1130,7 @@ class account_move_line(osv.osv):
return r_id
def view_header_get(self, cr, user, view_id, view_type, context=None):
if context is None:
context = {}
context = dict(context or {})
context = self.convert_to_period(cr, user, context=context)
if context.get('account_id', False):
cr.execute('SELECT code FROM account_account WHERE id = %s', (context['account_id'], ))
@@ -49,8 +49,7 @@ class account_report_general_ledger(osv.osv_memory):
return res
def _print_report(self, cr, uid, ids, data, context=None):
if context is None:
context = {}
context = dict(context or {})
data = self.pre_print_report(cr, uid, ids, data, context=context)
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record
+1 -2
View File
@@ -617,9 +617,8 @@ class node_context(object):
def __init__(self, cr, uid, context=None):
self.dbname = cr.dbname
self.uid = uid
context = dict(context or {})
self.context = context
if context is None:
context = {}
context['uid'] = uid
self._dirobj = openerp.registry(cr.dbname).get('document.directory')
self.node_file_class = node_file
@@ -46,6 +46,7 @@ class partner_vat(osv.osv_memory):
_name = "partner.vat"
def get_partner(self, cr, uid, ids, context=None):
context = dict(context or {})
obj_period = self.pool.get('account.period')
obj_partner = self.pool.get('res.partner')
obj_vat_lclient = self.pool.get('vat.listing.clients')
+2 -4
View File
@@ -466,8 +466,7 @@ class pos_session(osv.osv):
"""
call the Point Of Sale interface and set the pos.session to 'opened' (in progress)
"""
if context is None:
context = dict()
context = dict(context or {})
if isinstance(ids, (int, long)):
ids = [ids]
@@ -556,8 +555,7 @@ class pos_session(osv.osv):
return True
def open_frontend_cb(self, cr, uid, ids, context=None):
if not context:
context = {}
context = dict(context or {})
if not ids:
return {}
for session in self.browse(cr, uid, ids, context=context):
+1 -1
View File
@@ -1913,7 +1913,7 @@ class BaseModel(object):
for order_part in orderby.split(','):
order_split = order_part.split()
order_field = order_split[0]
if order_field in groupby_fields:
if order_field == 'id' or order_field in groupby_fields:
if self._fields[order_field.split(':')[0]].type == 'many2one':
order_clause = self._generate_order_by(order_part, query).replace('ORDER BY ', '')