Skip to content

Commit ef4efea

Browse files
committed
[MERGE] forward port branch 8.0 up to 16430be
2 parents 3cd8091 + 16430be commit ef4efea

File tree

7 files changed

+9
-15
lines changed

7 files changed

+9
-15
lines changed

addons/account/account.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -2307,8 +2307,7 @@ def generate(self, cr, uid, ids, data=None, context=None):
23072307
pt_obj = self.pool.get('account.payment.term')
23082308
period_obj = self.pool.get('account.period')
23092309

2310-
if context is None:
2311-
context = {}
2310+
context = dict(context or {})
23122311

23132312
if data.get('date', False):
23142313
context = dict(context)

addons/account/account_move_line.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -709,8 +709,7 @@ def _check_currency_company(self, cr, uid, ids, context=None):
709709

710710
#TODO: ONCHANGE_ACCOUNT_ID: set account_tax_id
711711
def onchange_currency(self, cr, uid, ids, account_id, amount, currency_id, date=False, journal=False, context=None):
712-
if context is None:
713-
context = {}
712+
context = dict(context or {})
714713
account_obj = self.pool.get('account.account')
715714
journal_obj = self.pool.get('account.journal')
716715
currency_obj = self.pool.get('res.currency')
@@ -1131,8 +1130,7 @@ def reconcile(self, cr, uid, ids, type='auto', writeoff_acc_id=False, writeoff_p
11311130
return r_id
11321131

11331132
def view_header_get(self, cr, user, view_id, view_type, context=None):
1134-
if context is None:
1135-
context = {}
1133+
context = dict(context or {})
11361134
context = self.convert_to_period(cr, user, context=context)
11371135
if context.get('account_id', False):
11381136
cr.execute('SELECT code FROM account_account WHERE id = %s', (context['account_id'], ))

addons/account/wizard/account_report_general_ledger.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,7 @@ def onchange_fiscalyear(self, cr, uid, ids, fiscalyear=False, context=None):
4949
return res
5050

5151
def _print_report(self, cr, uid, ids, data, context=None):
52-
if context is None:
53-
context = {}
52+
context = dict(context or {})
5453
data = self.pre_print_report(cr, uid, ids, data, context=context)
5554
data['form'].update(self.read(cr, uid, ids, ['landscape', 'initial_balance', 'amount_currency', 'sortby'])[0])
5655
if not data['form']['fiscalyear_id']:# GTK client problem onchange does not consider in save record

addons/document/document.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,8 @@ class node_context(object):
617617
def __init__(self, cr, uid, context=None):
618618
self.dbname = cr.dbname
619619
self.uid = uid
620+
context = dict(context or {})
620621
self.context = context
621-
if context is None:
622-
context = {}
623622
context['uid'] = uid
624623
self._dirobj = openerp.registry(cr.dbname).get('document.directory')
625624
self.node_file_class = node_file

addons/l10n_be/wizard/l10n_be_partner_vat_listing.py

+1
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class partner_vat(osv.osv_memory):
4646
_name = "partner.vat"
4747

4848
def get_partner(self, cr, uid, ids, context=None):
49+
context = dict(context or {})
4950
obj_period = self.pool.get('account.period')
5051
obj_partner = self.pool.get('res.partner')
5152
obj_vat_lclient = self.pool.get('vat.listing.clients')

addons/point_of_sale/point_of_sale.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,7 @@ def open_cb(self, cr, uid, ids, context=None):
466466
"""
467467
call the Point Of Sale interface and set the pos.session to 'opened' (in progress)
468468
"""
469-
if context is None:
470-
context = dict()
469+
context = dict(context or {})
471470

472471
if isinstance(ids, (int, long)):
473472
ids = [ids]
@@ -556,8 +555,7 @@ def _confirm_orders(self, cr, uid, ids, context=None):
556555
return True
557556

558557
def open_frontend_cb(self, cr, uid, ids, context=None):
559-
if not context:
560-
context = {}
558+
context = dict(context or {})
561559
if not ids:
562560
return {}
563561
for session in self.browse(cr, uid, ids, context=context):

openerp/models.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ def _read_group_prepare(self, orderby, aggregated_fields, annotated_groupbys, qu
19131913
for order_part in orderby.split(','):
19141914
order_split = order_part.split()
19151915
order_field = order_split[0]
1916-
if order_field in groupby_fields:
1916+
if order_field == 'id' or order_field in groupby_fields:
19171917

19181918
if self._fields[order_field.split(':')[0]].type == 'many2one':
19191919
order_clause = self._generate_order_by(order_part, query).replace('ORDER BY ', '')

0 commit comments

Comments
 (0)