~unifield-team/unifield-wm/us-826

« back to all changes in this revision

Viewing changes to account_activable/account_activable.py

  • Committer: duy.vo at msf
  • Date: 2011-08-24 09:14:23 UTC
  • mto: This revision was merged to the branch mainline in revision 247.
  • Revision ID: duy.vo@geneva.msf.org-20110824091423-605i4n1w9gdzseis
[IMP] UF-418-419 reconcile + acc. class 5 for Dr/Cr

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        self._check_date(vals)
59
59
        return super(account_account_activable, self).write(cr, uid, ids, vals, context=context)
60
60
 
61
 
    def search(self, cr, uid, args, offset=0, limit=None, order=None,
62
 
            context=None, count=False):
 
61
    def search(self, cr, uid, args, offset=0, limit=None, order=None, context=None, count=False):
 
62
        # UF-419: If the args contains journaltype value of Bank, Cheque, Cash, then add the search condition to show only accounts class 5 
 
63
        if not args:
 
64
            args = []
 
65
        args = args[:]
 
66
        
 
67
        pos = 0
 
68
        while pos < len(args):
 
69
            if args[pos][0] == 'journaltype':
 
70
                if args[pos][2] in ('cash', 'bank', 'cheque'):
 
71
                    args[pos] = ('code', 'like', '5%') # add the search condition to show only accounts class 5
 
72
                else:
 
73
                    args.remove(args[pos]) # if not, then just remove this element, and add nothing
 
74
                pos = len(args) # in both case, exit the loop
 
75
            pos += 1
 
76
        # End of UF-419
 
77
        
63
78
        if not context:
64
79
            context = {}
65
80
        if context.get('filter_inactive_accounts'):