[IMP] account: Improve the code so it will consider the check box display_details_per...
[odoo/odoo.git] / addons / account / wizard / account_vat.py
index 863ae05..186f79c 100644 (file)
@@ -28,7 +28,7 @@ class account_vat_declaration(osv.osv_memory):
     _columns = {
         'based_on': fields.selection([('invoices', 'Invoices'),
                                       ('payments', 'Payments'),],
-                                      'Based On', required=True),
+                                      'Based on', required=True),
         'chart_tax_id': fields.many2one('account.tax.code', 'Chart of Tax', help='Select Charts of Taxes', required=True, domain = [('parent_id','=', False)]),
     }
 
@@ -46,7 +46,10 @@ class account_vat_declaration(osv.osv_memory):
             context = {}
         datas = {'ids': context.get('active_ids', [])}
         datas['model'] = 'account.tax.code'
-        datas['form'] = self.read(cr, uid, ids)[0]
+        datas['form'] = self.read(cr, uid, ids, context=context)[0]
+        for field in datas['form'].keys():
+            if isinstance(datas['form'][field], tuple):
+                datas['form'][field] = datas['form'][field][0]
         datas['form']['company_id'] = self.pool.get('account.tax.code').browse(cr, uid, [datas['form']['chart_tax_id']], context=context)[0].company_id.id
         return {
             'type': 'ir.actions.report.xml',