Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Xueyun Qian
erp5
Commits
d418a1e9
Commit
d418a1e9
authored
Feb 01, 2013
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
accounting periods: refuse to close if previous period is not closed
parent
ee428750
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
3 deletions
+19
-3
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
...unting_period_workflow/scripts/checkTransactionsState.xml
+18
-2
bt5/erp5_accounting/bt/revision
bt5/erp5_accounting/bt/revision
+1
-1
No files found.
bt5/erp5_accounting/WorkflowTemplateItem/portal_workflow/accounting_period_workflow/scripts/checkTransactionsState.xml
View file @
d418a1e9
...
@@ -50,7 +50,9 @@
...
@@ -50,7 +50,9 @@
</item>
</item>
<item>
<item>
<key>
<string>
_body
</string>
</key>
<key>
<string>
_body
</string>
</key>
<value>
<string>
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
<value>
<string
encoding=
"cdata"
>
<![CDATA[
from Products.DCWorkflow.DCWorkflow import ValidationFailed\n
from Products.ERP5Type.Message import translateString\n
from Products.ERP5Type.Message import translateString\n
\n
\n
period = state_change[\'object\']\n
period = state_change[\'object\']\n
...
@@ -64,6 +66,18 @@ all_state_list = [x[1] for x in\n
...
@@ -64,6 +66,18 @@ all_state_list = [x[1] for x in\n
invalid_simulation_state_list = [state for state in all_state_list\n
invalid_simulation_state_list = [state for state in all_state_list\n
if state not in valid_simulation_state_list]\n
if state not in valid_simulation_state_list]\n
\n
\n
if period.getParentValue().getPortalType() == \'Organisation\':\n
# if this is a "main" accounting period, we refuse to close if the previous\n
# period is not already closed.\n
for other_period in period.getParentValue().contentValues(\n
portal_type=\'Accounting Period\',\n
checked_permission=\'View\'):\n
if other_period != period and \\\n
other_period.getSimulationState() not in (\'delivered\', \'cancelled\') and\\\n
other_period.getStartDate() < period.getStartDate():\n
raise ValidationFailed(translateString(\n
"Previous accounting periods has to be closed first."))\n
\n
section = period.getParentValue()\n
section = period.getParentValue()\n
while section.getPortalType() == period.getPortalType():\n
while section.getPortalType() == period.getPortalType():\n
section = section.getParentValue()\n
section = section.getParentValue()\n
...
@@ -115,7 +129,9 @@ movement_list = portal.portal_simulation.getMovementHistoryList(\n
...
@@ -115,7 +129,9 @@ movement_list = portal.portal_simulation.getMovementHistoryList(\n
if movement_list:\n
if movement_list:\n
raise ValidationFailed, translateString(\n
raise ValidationFailed, translateString(\n
"All Accounting Transactions for this organisation during the period have to be closed first.")\n
"All Accounting Transactions for this organisation during the period have to be closed first.")\n
</string>
</value>
]]>
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
...
...
bt5/erp5_accounting/bt/revision
View file @
d418a1e9
151
6
151
7
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment