Bad condition in account_date_check

Bug #539073 reported by Alexis Deméaulte
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Fix Released
High
Stephane Wirtel (OpenERP)

Bug Description

The account_date_check module check is the invoice date is between the start and stop date of the period. If it's not the case, it warn you with a popup. I have tested this module but it don't warn me when I choose a date out of the period. I think that the problem is on the condition which check the date. The current condition is (in account_date_check/account_date_check.py, line 67) :

   if not time.strptime(vals['date'],'%Y-%m-%d')>=time.strptime(period.date_start,'%Y-%m-%d') and time.strptime(vals['date'],'%Y-%m-%d')<=time.strptime(period.date_stop,'%Y-%m-%d'):

but it should be more something like that :

   if time.strptime(vals['date'],'%Y-%m-%d')<time.strptime(period.date_start,'%Y-%m-%d') or time.strptime(vals['date'],'%Y-%m-%d')>time.strptime(period.date_stop,'%Y-%m-%d'):

Hope this help.

Related branches

Revision history for this message
Stephane Wirtel (OpenERP) (stephane-openerp) wrote :
Changed in openobject-addons:
status: New → Fix Released
importance: Undecided → Critical
importance: Critical → High
assignee: nobody → Stephane (Open ERP) (stephane-openerp)
milestone: none → 5.0.8
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.