diff --git a/addons/account/wizard/account_invoice_refund.py b/addons/account/wizard/account_invoice_refund.py index fea020b5c4b..98c32eda7ee 100644 --- a/addons/account/wizard/account_invoice_refund.py +++ b/addons/account/wizard/account_invoice_refund.py @@ -60,6 +60,7 @@ class account_invoice_refund(osv.osv_memory): } def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False): + if context is None:context = {} journal_obj = self.pool.get('account.journal') user_obj = self.pool.get('res.users') # remove the entry with key 'form_view_ref', otherwise fields_view_get crashes diff --git a/addons/account/wizard/account_move_journal.py b/addons/account/wizard/account_move_journal.py index 6756e0d06c6..a7d4f36916b 100644 --- a/addons/account/wizard/account_move_journal.py +++ b/addons/account/wizard/account_move_journal.py @@ -77,56 +77,57 @@ class account_move_journal(osv.osv_memory): @return: Returns a dict that contains definition for fields, views, and toolbars """ - + if context is None:context = {} res = super(account_move_journal, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False) - if not view_id: - return res - - period_pool = self.pool.get('account.period') - journal_pool = self.pool.get('account.journal') - - journal_id = self._get_journal(cr, uid, context) - period_id = self._get_period(cr, uid, context) - - journal = False - if journal_id: - journal = journal_pool.read(cr, uid, [journal_id], ['name'])[0]['name'] - journal_string = _("Journal: %s") % tools.ustr(journal) - else: - journal_string = _("Journal: All") - - period = False - if period_id: - period = period_pool.browse(cr, uid, [period_id], ['name'])[0]['name'] - period_string = _("Period: %s") % tools.ustr(period) - - separator_string = _("Open Journal Items !") - cancel_string = _("Cancel") - open_string = _("Open") - view = """ -
""" % (separator_string, journal_string, period_string, cancel_string, open_string) - - view = etree.fromstring(view.encode('utf8')) - xarch, xfields = self._view_look_dom_arch(cr, uid, view, view_id, context=context) - view = xarch - res.update({ - 'arch': view - }) +