Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lu Xu
slapos.core
Commits
7ff64f0c
Commit
7ff64f0c
authored
Jan 26, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply rules only in case if movement is completed.
parent
5d3a182b
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
97 additions
and
3 deletions
+97
-3
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testDeliverySimulationRule.xml
...ulation/SimulationMovement_testDeliverySimulationRule.xml
+85
-0
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testInvoiceSimulationRule.xml
...mulation/SimulationMovement_testInvoiceSimulationRule.xml
+4
-1
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testInvoiceTransactionSimulationRule.xml
...mulationMovement_testInvoiceTransactionSimulationRule.xml
+4
-1
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testPaymentSimulationRule.xml
...mulation/SimulationMovement_testPaymentSimulationRule.xml
+3
-0
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
No files found.
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testDeliverySimulationRule.xml
0 → 100644
View file @
7ff64f0c
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_body
</string>
</key>
<value>
<string>
movement = context\n
\n
if movement.getExplanationValue().getPortalType().startswith(\'Purchase\'):\n
# Vifib case: Purchase Business Process is minimalistic and does not care about\n
# invoice (and deeper parts of tree)\n
# But when this rule would get applied, it will try to create 0 simulation movements\n
# and code inside of BusinessProcess.py would raise "ValueError: A Business Process can not erase amounts"\n
# So just do not apply the rule in such case.\n
return False\n
source_section = movement.getSourceSection()\n
destination_section = movement.getDestinationSection()\n
if source_section == destination_section or source_section is None \\\n
or destination_section is None:\n
return False\n
\n
if movement.getSimulationState() in movement.getCausalityValue(portal_type=\'Business Link\').getCompletedStateList():\n
return True\n
\n
return False\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
rule
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SimulationMovement_testDeliverySimulationRule
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testInvoiceSimulationRule.xml
View file @
7ff64f0c
...
...
@@ -65,7 +65,10 @@ if source_section == destination_section or source_section is None \\\n
or destination_section is None:\n
return False\n
\n
return True\n
if movement.getSimulationState() in movement.getCausalityValue(portal_type=\'Business Link\').getCompletedStateList():\n
return True\n
\n
return False\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testInvoiceTransactionSimulationRule.xml
View file @
7ff64f0c
...
...
@@ -58,7 +58,10 @@ if delivery_movement is not None and (\n
and delivery_movement.getPortalType() not in movement.getPortalTaxMovementTypeList()):\n
return False\n
\n
return True\n
if movement.getSimulationState() in movement.getCausalityValue(portal_type=\'Business Link\').getCompletedStateList():\n
return True\n
\n
return False\n
</string>
</value>
</item>
<item>
...
...
master/bt5/vifib_base/SkinTemplateItem/portal_skins/vifib_simulation/SimulationMovement_testPaymentSimulationRule.xml
View file @
7ff64f0c
...
...
@@ -56,6 +56,9 @@
receivable_account_type_list = (\'asset/receivable\',)\n
payable_account_type_list = (\'liability/payable\',)\n
\n
if movement.getSimulationState() not in movement.getCausalityValue(portal_type=\'Business Link\').getCompletedStateList():\n
return False\n
\n
for account in (movement.getSourceValue(portal_type=\'Account\'),\n
movement.getDestinationValue(portal_type=\'Account\')):\n
if account is not None:\n
...
...
master/bt5/vifib_base/bt/revision
View file @
7ff64f0c
354
\ No newline at end of file
355
\ No newline at end of file
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