Fix check dates for new company field on fiscalyear
This commit is contained in:
1 parent
442c19b78f
commit
981ddffc56
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in new issue
Block a user