~vauxoo/addons-vauxoo/7.0-pylint-luist

« back to all changes in this revision

Viewing changes to account_voucher_tax/account_voucher.py

  • Committer: Moises Lopez
  • Date: 2014-09-30 16:10:27 UTC
  • mfrom: (1138.1.1 70-addons-vauxoo)
  • Revision ID: moylop260@vauxoo.com-20140930161027-dzvea4rbefm0ko7g
[MERGE] [FIX] Fix unused variable with autoflake and pylint

Show diffs side-by-side

added added

removed removed

Lines of Context:
89
89
        return tax_amount*tax_base
90
90
    
91
91
    def voucher_move_line_tax_create(self, cr, uid, voucher_id, move_id, context=None):
92
 
        move_obj = self.pool.get('account.move')
93
92
        move_line_obj = self.pool.get('account.move.line')
94
 
        invoice_obj = self.pool.get('account.invoice')
95
 
        currency_obj = self.pool.get('res.currency')
96
93
        company_currency = self._get_company_currency(cr, uid, voucher_id, context)
97
94
        current_currency = self._get_current_currency(cr, uid, voucher_id, context)
98
95
        move_ids=[]
106
103
                        amount_to_paid = line.amount
107
104
                    factor = ((amount_to_paid * 100) / line.amount_original) / 100
108
105
                for line_tax in line.tax_line_ids:
109
 
                    credit=line_tax.amount_tax
110
106
                    amount_tax_unround=line_tax.amount_tax_unround
111
107
                    
112
108
                    if voucher.type in ('sale', 'receipt'):
139
135
                            amount_tax_unround, reference_currency_id,
140
136
                            tax_id, line_tax, acc_a, amount_base_tax,#informacion de lineas de impuestos
141
137
                            factor=0, context=None):
142
 
        acc_tax_obj = self.pool.get('account.tax')
143
138
        if type == 'payment' or reference_amount < 0:
144
139
            src_account_id, dest_account_id = dest_account_id, src_account_id
145
140
        if type == 'payment' and reference_amount < 0:
238
233
        return [amount_base, tax_secondary]
239
234
    
240
235
    def voucher_move_line_create(self, cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context=None):
241
 
        move_obj = self.pool.get('account.move')
242
 
        move_line_obj = self.pool.get('account.move.line')
243
 
        invoice_obj = self.pool.get('account.invoice')
244
 
        currency_obj = self.pool.get('res.currency')
245
236
        res=super(account_voucher, self).voucher_move_line_create(cr, uid, voucher_id, line_total, move_id, company_currency, current_currency, context=None)
246
237
        new=self.voucher_move_line_tax_create(cr,uid, voucher_id, move_id, context=context)
247
238
        #~ res[1] and res[1][0]+new
251
242
        date=False, context=None):
252
243
        invoice_obj = self.pool.get('account.invoice')
253
244
        currency_obj = self.pool.get('res.currency')
254
 
        tax_line_obj = self.pool.get('account.voucher.line.tax')
255
245
        move_obj = self.pool.get('account.move.line')
256
246
        company_user = self.pool.get('res.users').browse(cr, uid, uid,\
257
247
            context=context).company_id.id
264
254
                context=context).currency_id.id
265
255
        company_currency = company_obj.browse(cr, uid, company_user,\
266
256
            context=context).currency_id.id
267
 
        tax_lines = {}
268
257
        lines_ids = []
269
258
        if lines and lines.get('value', False):
270
259
            lines_ids.extend(lines['value'].get('line_cr_ids', []))
343
332
                                        else:
344
333
                                            diff_account_id=tax.tax_id.\
345
334
                                            account_expense_voucher_id.id
346
 
                                debit_amount = 0.0
347
335
                                move_line_id = False
348
336
                                line_ids = move_obj.browse(cr, uid, line[\
349
337
                                    'move_line_id'], context=context).move_id.\
387
375
        move_obj = self.pool.get('account.move.line')
388
376
        invoice_obj = self.pool.get('account.invoice')
389
377
        company_obj = self.pool.get('res.company')
390
 
        tax_line_obj = self.pool.get('account.voucher.line.tax')
391
378
        company_user = self.pool.get('res.users').browse(cr, uid, uid,\
392
379
            context=context).company_id.id
393
380
        company_currency = company_obj.browse(cr, uid, company_user,\
471
458
                                    diff_account_id = acc_income_voucher_id
472
459
                                else:
473
460
                                    diff_account_id = acc_expense_voucher_id
474
 
                        debit_amount = 0.0
475
461
                        move_line_id2 = False
476
462
                        line_ids = move_obj.browse(cr, uid, move_line_id,\
477
463
                            context=context).move_id.line_id