Fix check dates for new company field on fiscalyear

This commit is contained in:
Cédric Krier committed 2008-07-03 21:14:24 +02:00
1 parent 442c19b78f
commit 981ddffc56
2 files changed
+4 -2

No files matched your search

+2 -1
View File
@@ -66,11 +66,12 @@ class FiscalYear(OSV):
'WHERE ((start_date <= %s AND end_date >= %s) ' \
'OR (start_date <= %s AND end_date >= %s) ' \
'OR (start_date >= %s AND end_date <= %s)) ' \
'AND company = %s ' \
'AND id != %s',
(fiscalyear.start_date, fiscalyear.start_date,
fiscalyear.end_date, fiscalyear.end_date,
fiscalyear.start_date, fiscalyear.end_date,
fiscalyear.id))
fiscalyear.company.id, fiscalyear.id))
if cursor.rowcount:
return False
return True
+2 -1
View File
@@ -50,11 +50,12 @@ class Period(OSV):
'WHERE ((start_date <= %s AND end_date >= %s) ' \
'OR (start_date <= %s AND end_date >= %s) ' \
'OR (start_date >= %s AND end_date <= %s)) ' \
'fiscalyear = %s ' \
'AND id != %s',
(period.start_date, period.start_date,
period.end_date, period.end_date,
period.start_date, period.end_date,
period.id))
period.fiscalyear.id, period.id))
if cursor.rowcount:
return False
return True