Commit ab7b06ee authored by Xiaowu Zhang's avatar Xiaowu Zhang Committed by Xiaowu Zhang

epr5_accounting: only check valide accounting period

parent c74e8a68
......@@ -79,8 +79,10 @@ if not skip_period_validation :
section = source_section
if section.getPortalType() == 'Organisation':
section = section.Organisation_getMappingRelatedOrganisation()
if not len(section.contentValues(
filter=dict(portal_type="Accounting Period"))):
if not len([ap for ap in section.contentValues(
portal_type="Accounting Period",
checked_permission="Access contents information")
if ap.getSimulationState() not in ('deleted', 'cancelled', 'draft',)]):
valid_date = True
else:
accounting_period = transaction\
......@@ -109,8 +111,10 @@ if not skip_period_validation :
section = destination_section
if section.getPortalType() == 'Organisation':
section = section.Organisation_getMappingRelatedOrganisation()
if not len(section.contentValues(
filter=dict(portal_type="Accounting Period"))):
if not len([ap for ap in section.contentValues(
portal_type="Accounting Period",
checked_permission="Access contents information")
if ap.getSimulationState() not in ('deleted', 'cancelled', 'draft',)]):
valid_date = True
else:
accounting_period = transaction\
......
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