[FIX] Corrected small things in swiss accounting
authornvi-openerp <nicolas.vanhoren@openerp.com>
Tue, 26 Oct 2010 15:06:32 +0000 (17:06 +0200)
committernvi-openerp <nicolas.vanhoren@openerp.com>
Tue, 26 Oct 2010 15:06:32 +0000 (17:06 +0200)
bzr revid: nicolas.vanhoren@openerp.com-20101026150632-lsvdofxrqdbnmlxh

addons/l10n_ch/__init__.py
addons/l10n_ch/account_move_line.py
addons/l10n_ch/dta.py
addons/l10n_ch/wizard/bvr_import.py
addons/l10n_ch/wizard/create_dta.py

index a8e2ee0..cd5fbfa 100644 (file)
@@ -36,7 +36,6 @@ import wizard
 import invoice
 import company
 import partner
-import company
 import payment
 import report
 import bank
index ab35fdd..9232028 100644 (file)
@@ -31,7 +31,7 @@
 #
 ##############################################################################
 
-from osv import fields, osv
+from osv import osv
 
 class AccountMoveLine(osv.osv):
     """ Inherit account.move.line in order to add a custom link
index c60ae0f..3199b68 100644 (file)
@@ -30,7 +30,6 @@
 #
 ##############################################################################
 
-import time
 from osv import osv, fields
 
 class account_dta(osv.osv):
index 0188eb9..26630bb 100644 (file)
@@ -72,12 +72,10 @@ def _reconstruct_invoice_ref(cursor, user, reference, context=None):
 def _import(self, cursor, user, data, context=None):
 
     statement_line_obj = self.pool.get('account.bank.statement.line')
-#    statement_reconcile_obj = pool.get('account.bank.statement.reconcile')
+    statement_obj = self.pool.get('account.bank.statement')
     voucher_obj = self.pool.get('account.voucher')
     voucher_line_obj = self.pool.get('account.voucher.line')
     move_line_obj = self.pool.get('account.move.line')
-    property_obj = self.pool.get('ir.property')
-    model_fields_obj = self.pool.get('ir.model.fields')
     attachment_obj = self.pool.get('ir.attachment')
     file = data['form']['file']
     statement_id = data['id']
@@ -204,13 +202,13 @@ def _import(self, cursor, user, data, context=None):
         values['voucher_id'] = voucher_id
         voucher_line_dict =  False
         if result['value']['line_ids']:
-             for line_dict in result['value']['line_ids']:
-                 move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context)
-                 if move_id == move_line.move_id.id:
-                     voucher_line_dict = line_dict
+            for line_dict in result['value']['line_ids']:
+                move_line = move_line_obj.browse(cursor, user, line_dict['move_line_id'], context)
+                if move_id == move_line.move_id.id:
+                    voucher_line_dict = line_dict
         if voucher_line_dict:
-             voucher_line_dict.update({'voucher_id':voucher_id})
-             voucher_line_obj.create(cursor, user, voucher_line_dict, context=context)                
+            voucher_line_dict.update({'voucher_id':voucher_id})
+            voucher_line_obj.create(cursor, user, voucher_line_dict, context=context)                
              
         if not account_id:
             if record['amount'] >= 0:
index 859e5e8..d8cdec8 100644 (file)
@@ -385,7 +385,6 @@ def _create_dta(obj, cr, uid, data, context=None):
         raise osv.except_osv(_('Error'),
                 _('No IBAN for the company bank account.'))
 
-    dta_line_obj = pool.get('account.dta.line')
     res_partner_bank_obj = pool.get('res.partner.bank')
 
     seq = 1