← Back to team overview

clearcorp team mailing list archive

[Branch ~banking-addons-team/banking-addons/6.1] Rev 137: [FIX] Period search should ignore opening/closing periods

 

Merge authors:
  Stefan Rijnhart (Therp) (stefan-therp)
Related merge proposals:
  https://code.launchpad.net/~therp-nl/banking-addons/6.1-lp1017470-period_search_ignore_special/+merge/112063
  proposed by: Stefan Rijnhart (Therp) (stefan-therp)
------------------------------------------------------------
revno: 137 [merge]
committer: Stefan Rijnhart <stefan@xxxxxxxx>
branch nick: 6.1
timestamp: Mon 2012-07-09 19:28:54 +0200
message:
  [FIX] Period search should ignore opening/closing periods
modified:
  account_banking/wizard/bank_import.py
  account_banking/wizard/banktools.py


--
lp:banking-addons
https://code.launchpad.net/~banking-addons-team/banking-addons/6.1

Your team CLEARCORP development team is subscribed to branch lp:banking-addons.
To unsubscribe from this branch go to https://code.launchpad.net/~banking-addons-team/banking-addons/6.1/+edit-subscription
=== modified file 'account_banking/wizard/bank_import.py'
--- account_banking/wizard/bank_import.py	2012-05-02 15:09:49 +0000
+++ account_banking/wizard/bank_import.py	2012-06-26 09:46:07 +0000
@@ -260,7 +260,8 @@
             # Get the period for the statement (as bank statement object checks this)
             period_ids = period_obj.search(cursor, uid, [('company_id','=',company.id),
                                                          ('date_start','<=',statement.date),
-                                                         ('date_stop','>=',statement.date)])
+                                                         ('date_stop','>=',statement.date),
+                                                         ('special', '=', False)])
 
             # Create the bank statement record
             statement_id = statement_obj.create(cursor, uid, dict(

=== modified file 'account_banking/wizard/banktools.py'
--- account_banking/wizard/banktools.py	2012-04-14 08:58:58 +0000
+++ account_banking/wizard/banktools.py	2012-06-26 11:17:32 +0000
@@ -71,7 +71,8 @@
     fiscalyear_id = fiscalyear_ids[0]
     period_ids = period_obj.search(cursor, uid, [
         ('date_start','<=',search_date), ('date_stop','>=',search_date),
-        ('fiscalyear_id','=',fiscalyear_id), ('state','=','draft')
+        ('fiscalyear_id','=',fiscalyear_id), ('state','=','draft'),
+        ('special', '=', False),
     ])
     if not period_ids:
         log.append(_('No suitable period found for date %(date)s and company %(company_name)s')