775
775
month = time.strftime('%m')
776
776
# search current fiscalyear
777
777
fy_ids = self.db.search_data('account.fiscalyear', [('date_start', '<=', today), ('date_stop', '>=', today)])
782
fy_ids = self.db.search_data('account.fiscalyear', [('date_start', '<=', today), ('date_stop', '>=', today)])
778
784
assert len(fy_ids) > 0, "No fiscalyear found!"
779
785
period_ids = self.db.search_data('account.period', [('fiscalyear_id', 'in', fy_ids), ('number', '<=', month), ('state', '=', 'created')])
780
786
# change all period by draft state (should use action_set_state but openerplib doesn't give way to do this)