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
6eef0707
Commit
6eef0707
authored
Sep 22, 2022
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_accounting: only automate packing list with automated ledger
parent
864aa413
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
35 deletions
+2
-35
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_deliverStartedAggregatedSalePackingList.py
...counting/Alarm_deliverStartedAggregatedSalePackingList.py
+1
-14
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_deliverStartedAggregatedSalePackingList.py
...nting/Delivery_deliverStartedAggregatedSalePackingList.py
+1
-21
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_deliverStartedAggregatedSalePackingList.py
View file @
6eef0707
portal
=
context
.
getPortalObject
()
trade_condition_uid_list
=
[]
root_trade_condition_uid_list
=
[
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
()).
getUid
(),
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredAggregatedSaleTradeCondition
()).
getUid
()]
trade_condition_uid_list
.
extend
(
root_trade_condition_uid_list
)
trade_condition_uid_list
.
extend
([
i
.
uid
for
i
in
portal
.
ERP5Site_searchRelatedInheritedSpecialiseList
(
specialise_uid
=
root_trade_condition_uid_list
,
validation_state
=
"validated"
)])
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Sale Packing List'
,
simulation_state
=
'started'
,
causality_state
=
'solved'
,
specialise_uid
=
trade_condition_uid_list
,
ledger__uid
=
portal
.
portal_categories
.
ledger
.
automated
.
getUid
()
,
method_id
=
'Delivery_deliverStartedAggregatedSalePackingList'
,
activate_kw
=
{
'tag'
:
tag
},
)
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_deliverStartedAggregatedSalePackingList.py
View file @
6eef0707
...
...
@@ -4,30 +4,10 @@ if context.getPortalType() != 'Sale Packing List':
raise
TypeError
(
'Incorrect delivery.'
)
isTransitionPossible
=
portal
.
portal_workflow
.
isTransitionPossible
if
context
.
getSimulationState
()
==
'started'
\
and
context
.
getLedger
()
==
'automated'
\
and
len
(
context
.
checkConsistency
())
==
0
\
and
context
.
getCausalityState
()
==
'solved'
:
if
context
.
getSpecialise
()
not
in
[
portal
.
portal_preferences
.
getPreferredAggregatedSaleTradeCondition
(),
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
()]:
trade_condition_uid_list
=
[]
# search for user specific trade conditions
root_trade_condition_uid_list
=
[
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
()).
getUid
(),
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredAggregatedSaleTradeCondition
()).
getUid
()]
trade_condition_uid_list
.
extend
(
root_trade_condition_uid_list
)
trade_condition_uid_list
.
extend
([
i
.
uid
for
i
in
portal
.
ERP5Site_searchRelatedInheritedSpecialiseList
(
specialise_uid
=
root_trade_condition_uid_list
,
validation_state
=
"validated"
)])
if
context
.
getSpecialiseUid
()
not
in
trade_condition_uid_list
:
return
comment
=
'Delivered by alarm as all actions in started state are ready.'
if
isTransitionPossible
(
context
,
'stop'
):
context
.
stop
(
comment
=
comment
)
...
...
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