~serpent-consulting-services/openerp-usa/cim-SerpentCS

« back to all changes in this revision

Viewing changes to account_voucher_credits_us/wizard/account_post_voucher.py

  • Committer: npgllc
  • Author(s): Serpent-Consulting-Services
  • Date: 2012-08-14 13:32:19 UTC
  • mfrom: (73.1.16 openerp-usa)
  • Revision ID: npgllc-20120814133219-z4lvfyiw1ggsy0sx
[IMP]: all modules related to credit card functionality

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
        'total_paid': fields.float('Total Received'),
31
31
        'total_allocated': fields.float('Total Allocated'),
32
32
        'ok_to_go': fields.float('OK to Go'),
33
 
         }
 
33
    }
34
34
 
35
35
    def _get_total_paid(self, cr, uid, context=None):
36
36
        """
81
81
            return total_allocated
82
82
        for line in voucher.line_cr_ids:
83
83
            total_allocated += line.amount
84
 
 
85
 
        
86
84
        return total_allocated - voucher.amount
87
85
 
88
86
    _defaults = {
89
87
        'total_paid': _get_total_paid,
90
88
        'total_allocated': _get_total_allocated,
91
89
        'ok_to_go': _get_ok_to_go,
92
 
        }
 
90
    }
93
91
    
94
92
    def onchange_ok_to_go(self, cr, uid, ids, ok_to_go, context=None):
95
93
        """
102
100
        """
103
101
        if ok_to_go > 0.0:
104
102
            return {'warning': {'title': _('Overallocated invoices'), 'message': _('Reduce allocations to match Total Receipt')}}
105
 
        else:
106
 
            return {'value': {}}
 
103
        return {'value': {}}
107
104
        
108
105
    def launch_wizard(self, cr, uid, ids, context=None):
109
106
        """