~eduardo-bayardo-bias/openobject-addons/bias_trunk_v8

« back to all changes in this revision

Viewing changes to bias_tax_transfer/account_move_line.py

  • Committer: Eduardo Bayardo
  • Date: 2016-10-06 21:28:13 UTC
  • Revision ID: eduardo.bayardo@bias.com.mx-20161006212813-z4utlenj8qtt3dlg
update crm protocol module

Show diffs side-by-side

added added

removed removed

Lines of Context:
75
75
        # Process Fiscal Lines if move line journal type is is 'bank' and have a partner.
76
76
        move_obj = self.pool.get('account.move')
77
77
        reconcile = self.browse(cr, uid, rec_id, context=context)
 
78
        print '*************** create reconcile', reconcile.read([])
78
79
        for line in reconcile.line_id + reconcile.line_partial_ids:
79
80
            self.pool.get('account.move.line').create_fiscal_line(cr, uid, line.id, context.get('account_position',False))
80
81
        return rec_id
81
82
 
 
83
    def write(self, cr, uid, ids, vals, context=None):
 
84
        print '************** write=', ids, vals
 
85
        res = super(account_period, self).write(cr, uid, ids, vals, context=context)
 
86
        return res 
 
87
 
 
88
 
82
89
class account_move_line(osv.osv):
83
90
    _inherit = "account.move.line"
84
91
 
86
93
    ## CREATE account_move_fiscal Lines and create tax transfer account_move_line
87
94
    #####################################################################################################################
88
95
    def create_fiscal_line(self, cr, uid, line_id, account_position=False, context=None):
 
96
        print '*************** create_fiscal_line('
89
97
        fiscal_obj = self.pool.get('account.move.fiscal')
90
98
        if isinstance(line_id,list):
91
99
            line_id = line_id[0]
97
105
        # >>>>>>>>>>    Return if line debit and credit in zero
98
106
        if not line.debit - line.credit:
99
107
            return True
100
 
        print 'create_fiscal_line',line_id
101
108
        res = self.get_base(cr, uid, line, account_position, operation_type, context=context)
102
109
        val = {
103
110
            'id': '__export__.account_move_fiscal_' + str(line.id),
405
412
                    arg_retained_isr, arg_ieps, arg_ieps_imp, arg_total)
406
413
            cr.execute(query)
407
414
            res = cr.dictfetchone()
 
415
            print 'res=',query
408
416
            line_total = abs(line.debit - line.credit)
409
417
            factor = res['inv_total'] and abs(line_total/res['inv_total'])
410
418
            if factor: