[MERGE] lp:872686 (account: fix refund wizard)
[odoo/odoo.git] / addons / account / wizard / account_invoice_refund.py
index 436ea20..ec74320 100644 (file)
@@ -62,6 +62,8 @@ 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):
         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
+        context.pop('form_view_ref', None)
         res = super(account_invoice_refund,self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
         type = context.get('type', 'out_invoice')
         company_id = user_obj.browse(cr, uid, uid, context=context).company_id.id