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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
87ba4a2f
Commit
87ba4a2f
authored
Apr 18, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: trigger the deposit's packing list creation in an alarm
parent
a379f510
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
357 additions
and
11 deletions
+357
-11
master/bt5/slapos_accounting/PathTemplateItem/portal_alarms/slapos_generate_deposit_sale_packing_list.xml
...rtal_alarms/slapos_generate_deposit_sale_packing_list.xml
+103
-0
master/bt5/slapos_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+4
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_generateSlapOSDepositSalePackingList.py
..._accounting/Alarm_generateSlapOSDepositSalePackingList.py
+19
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_generateSlapOSDepositSalePackingList.xml
...accounting/Alarm_generateSlapOSDepositSalePackingList.xml
+62
-0
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_acceptDepositPayment.py
...pos_accounting/PaymentTransaction_acceptDepositPayment.py
+16
-2
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_acceptDepositPayment.xml
...os_accounting/PaymentTransaction_acceptDepositPayment.xml
+1
-1
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
..._components/test.erp5.testSlapOSERP5AccountingScenario.py
+6
-3
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interaction_PaymentTransaction_stop.xml
...eraction_workflow/interaction_PaymentTransaction_stop.xml
+54
-0
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/script_Base_triggerGenerateDepositSalePackingListAlarm.py
...script_Base_triggerGenerateDepositSalePackingListAlarm.py
+1
-0
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/script_Base_triggerGenerateDepositSalePackingListAlarm.xml
...cript_Base_triggerGenerateDepositSalePackingListAlarm.xml
+78
-0
master/bt5/slapos_accounting/bt/template_path_list
master/bt5/slapos_accounting/bt/template_path_list
+1
-0
master/bt5/slapos_accounting/bt/template_portal_type_workflow_chain_list
...os_accounting/bt/template_portal_type_workflow_chain_list
+1
-0
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5CRMScenario.py
.../portal_components/test.erp5.testSlapOSERP5CRMScenario.py
+2
-1
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+1
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
...mponents/test.erp5.testSlapOSERP5VirtualMasterScenario.py
+8
-4
No files found.
master/bt5/slapos_accounting/PathTemplateItem/portal_alarms/slapos_generate_deposit_sale_packing_list.xml
0 → 100644
View file @
87ba4a2f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_generateSlapOSDepositSalePackingList
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_generate_deposit_sale_packing_list
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_day_frequency
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
0.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
SlapOS Generate Deposit Sale Packing List
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
87ba4a2f
...
...
@@ -31,6 +31,10 @@
<type>
Open Sale Order
</type>
<workflow>
slapos_accounting_interaction_workflow, slapos_simulation_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Payment Transaction
</type>
<workflow>
slapos_accounting_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Project
</type>
<workflow>
slapos_accounting_interaction_workflow
</workflow>
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_generateSlapOSDepositSalePackingList.py
0 → 100644
View file @
87ba4a2f
portal
=
context
.
getPortalObject
()
activate_kw
=
{
'tag'
:
tag
}
select_dict
=
{
'causality__uid'
:
None
}
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Payment Transaction'
,
simulation_state
=
'stopped'
,
ledger__uid
=
portal
.
portal_categories
.
ledger
.
automated
.
getUid
(),
# Only check standalone payment
left_join_list
=
select_dict
.
keys
(),
causality__uid
=
None
,
method_id
=
'PaymentTransaction_acceptDepositPayment'
,
method_kw
=
{
'activate_kw'
:
activate_kw
},
activate_kw
=
activate_kw
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_generateSlapOSDepositSalePackingList.xml
0 → 100644
View file @
87ba4a2f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_generateSlapOSDepositSalePackingList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_acceptDepositPayment.py
View file @
87ba4a2f
from
zExceptions
import
Unauthorized
if
REQUEST
is
not
None
:
raise
Unauthorized
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
payment_transaction
=
context
payment_transaction
.
stop
()
assert
payment_transaction
.
getSimulationState
()
==
'stopped'
trade_condition
=
payment_transaction
.
getSpecialiseValue
()
assert
trade_condition
is
not
None
assert
trade_condition
.
getTradeConditionType
()
==
'deposit'
# Ensure the payment has no grouping reference
assert
not
[
x
for
x
in
trade_condition
.
contentValues
(
portal_type
=
'Accounting Transaction Line'
)
if
x
.
getGroupingReference
(
None
)
is
not
None
]
start_date
=
DateTime
()
stop_date
=
None
...
...
@@ -14,7 +23,12 @@ quantity_unit_value = resource_value.getQuantityUnitValue()
order_portal_type
=
'Sale Packing List'
order_line_portal_type
=
'Sale Packing List Line'
activate_kw
=
None
existing_packing_list
=
portal
.
portal_catalog
.
getResultValue
(
portal_type
=
order_portal_type
,
causality__uid
=
payment_transaction
.
getUid
()
)
if
existing_packing_list
is
not
None
:
return
#######################################################
# Open Sale Order
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/PaymentTransaction_acceptDepositPayment.xml
View file @
87ba4a2f
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
activate_kw=None, REQUEST=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_accounting/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5AccountingScenario.py
View file @
87ba4a2f
...
...
@@ -35,7 +35,8 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
with
PinnedDateTime
(
self
,
DateTime
(
'2021/04/04'
)):
payment_transaction
=
owner_person
.
Person_addDepositPayment
(
99
*
10
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
self
.
tic
()
self
.
assertTrue
(
owner_person
.
Entity_hasOutstandingAmount
(
include_planned
=
True
))
...
...
@@ -209,7 +210,8 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
with
PinnedDateTime
(
self
,
creation_date
+
2
):
for
person
in
person_list
:
payment_transaction
=
person
.
Person_addDepositPayment
(
99
*
100
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
##################################################
# Add first batch of service, and generate invoices
...
...
@@ -310,7 +312,8 @@ class TestSlapOSAccountingScenario(TestSlapOSVirtualMasterScenarioMixin):
# Add deposit (0.1 to prevent discount generation)
with
PinnedDateTime
(
self
,
creation_date
+
0.1
):
payment_transaction
=
owner_person
.
Person_addDepositPayment
(
99
*
100
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
self
.
logout
()
self
.
login
()
...
...
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/interaction_PaymentTransaction_stop.xml
0 → 100644
View file @
87ba4a2f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interaction Workflow Interaction"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
after_script/portal_workflow/slapos_accounting_interaction_workflow/script_Base_triggerGenerateDepositSalePackingListAlarm
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interaction_PaymentTransaction_stop
</string>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<tuple>
<string>
Payment Transaction
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
trigger_method_id
</string>
</key>
<value>
<tuple>
<string>
stop
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
trigger_once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/script_Base_triggerGenerateDepositSalePackingListAlarm.py
0 → 100644
View file @
87ba4a2f
return
state_change
[
'object'
].
Base_reindexAndSenseAlarm
([
'slapos_generate_deposit_sale_packing_list'
])
master/bt5/slapos_accounting/WorkflowTemplateItem/portal_workflow/slapos_accounting_interaction_workflow/script_Base_triggerGenerateDepositSalePackingListAlarm.xml
0 → 100644
View file @
87ba4a2f
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_Base_triggerGenerateDepositSalePackingListAlarm
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_accounting/bt/template_path_list
View file @
87ba4a2f
...
...
@@ -19,6 +19,7 @@ currency_module/EUR
portal_alarms/slapos_accounting_generate_packing_list_from_tioxml
portal_alarms/slapos_archive_open_sale_order_with_unused_item
portal_alarms/slapos_cancel_sale_invoice_transaction_paied_payment_list
portal_alarms/slapos_generate_deposit_sale_packing_list
portal_alarms/slapos_manage_building_calculating_delivery
portal_alarms/slapos_remove_bogus_delivery_link
portal_alarms/slapos_stop_confirmed_aggregated_sale_invoice_transaction
...
...
master/bt5/slapos_accounting/bt/template_portal_type_workflow_chain_list
View file @
87ba4a2f
...
...
@@ -10,6 +10,7 @@ Hosting Subscription | slapos_accounting_interaction_workflow
Instance Tree | slapos_accounting_interaction_workflow
Open Sale Order | slapos_accounting_interaction_workflow
Open Sale Order | slapos_simulation_interaction_workflow
Payment Transaction | slapos_accounting_interaction_workflow
Project | slapos_accounting_interaction_workflow
Sale Invoice Transaction | slapos_accounting_interaction_workflow
Sale Invoice Transaction | slapos_simulation_interaction_workflow
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5CRMScenario.py
View file @
87ba4a2f
...
...
@@ -57,7 +57,8 @@ class TestSlapOSCRMScenario(TestSlapOSVirtualMasterScenarioMixin):
# Add deposit
with
PinnedDateTime
(
self
,
creation_date
):
payment_transaction
=
owner_person
.
Person_addDepositPayment
(
99
*
100
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
##################################################
# Add first batch of service, and generate invoices
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
87ba4a2f
...
...
@@ -166,6 +166,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_accounting/Base_getAccountForUse'
,
'slapos_accounting/Entity_createPaymentTransactionAction'
,
'slapos_accounting/Movement_getPriceCalculationOperandDict'
,
'slapos_accounting/PaymentTransaction_acceptDepositPayment'
,
'slapos_accounting/PaymentTransaction_getExternalPaymentId'
,
'slapos_accounting/PaymentTransaction_postOrderBuild'
,
'slapos_accounting/SaleInvoiceTransaction_init'
,
...
...
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5VirtualMasterScenario.py
View file @
87ba4a2f
...
...
@@ -489,7 +489,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
self
.
tic
()
self
.
logout
()
self
.
login
()
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
self
.
tic
()
assert
payment_transaction
.
receivable
.
getGroupingReference
(
None
)
is
not
None
...
...
@@ -561,7 +562,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
project
=
self
.
portal
.
restrictedTraverse
(
project_relative_url
)
payment_transaction
=
customer_section_organisation
.
Person_addDepositPayment
(
99
*
10
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
self
.
tic
()
self
.
portal
.
log
(
'SubscriptionRequest_validateIfSubmitted %s'
%
payment_transaction
.
getSimulationState
())
...
...
@@ -780,7 +782,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
project
=
self
.
portal
.
restrictedTraverse
(
project_relative_url
)
payment_transaction
=
owner_person
.
Person_addDepositPayment
(
99
*
10
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
preference
=
self
.
portal
.
portal_preferences
.
slapos_default_system_preference
preference
.
edit
(
...
...
@@ -869,7 +872,8 @@ class TestSlapOSVirtualMasterScenario(TestSlapOSVirtualMasterScenarioMixin):
reference
=
public_reference
).
getParentValue
()
payment_transaction
=
public_person
.
Person_addDepositPayment
(
99
*
10
,
currency
.
getRelativeUrl
(),
1
)
payment_transaction
.
PaymentTransaction_acceptDepositPayment
()
# payzen interface will only stop the payment
payment_transaction
.
stop
()
with
PinnedDateTime
(
self
,
DateTime
(
'2024/02/17 01:01'
)):
public_instance_title
=
'Public title %s'
%
self
.
generateNewId
()
...
...
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