Commit 3a7397ef authored by Jérome Perrin's avatar Jérome Perrin

contentValues(filter= cannot filter by simulation state. Use the more common...

contentValues(filter= cannot filter by simulation state. Use the more common contentValues(portal_type=, checked_permission= and filter simulation states in the loop

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34735 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 5d9ba8d9
...@@ -67,12 +67,14 @@ def getAccountingPeriodStartDateForSectionCategory(section_category, date):\n ...@@ -67,12 +67,14 @@ def getAccountingPeriodStartDateForSectionCategory(section_category, date):\n
section_uid.extend(portal.Base_getSectionUidListForSectionCategory(\n section_uid.extend(portal.Base_getSectionUidListForSectionCategory(\n
section_category, strict_membership=False))\n section_category, strict_membership=False))\n
period_start_date = None\n period_start_date = None\n
valid_accounting_period = dict(portal_type=\'Accounting Period\',\n
simulation_state=(\'planned\', \'confirmed\',\n
\'started\', \'stopped\', \'closing\', \'delivered\'))\n
for uid in section_uid:\n for uid in section_uid:\n
section = portal.portal_catalog.getObject(uid)\n section = portal.portal_catalog.getObject(uid)\n
for ap in section.contentValues(filter=valid_accounting_period):\n for ap in section.contentValues(portal_type=\'Accounting Period\',\n
checked_permission=\'Access contents information\'):\n
if ap.getSimulationState() not in (\'planned\', \'confirmed\',\n
\'started\', \'stopped\',\n
\'closing\', \'delivered\'):\n
continue\n
if ap.getStartDate() <= date <= ap.getStopDate():\n if ap.getStartDate() <= date <= ap.getStopDate():\n
period_start_date = ap.getStartDate().earliestTime()\n period_start_date = ap.getStartDate().earliestTime()\n
if period_start_date:\n if period_start_date:\n
......
1191 1193
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment