mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[FIX] Period search should ignore opening/closing periods
This commit is contained in:
@@ -260,7 +260,8 @@ class banking_import(osv.osv_memory):
|
||||
# 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(
|
||||
|
||||
@@ -71,7 +71,8 @@ def get_period(pool, cursor, uid, date, company, log):
|
||||
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')
|
||||
|
||||
Reference in New Issue
Block a user