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
fb60ed3e
Commit
fb60ed3e
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
4242deb6
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_startConfirmedAggregatedSubscriptionSalePackingList.py
...rm_startConfirmedAggregatedSubscriptionSalePackingList.py
+1
-14
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_startConfirmedAggregatedSalePackingList.py
...nting/Delivery_startConfirmedAggregatedSalePackingList.py
+1
-21
No files found.
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Alarm_startConfirmedAggregatedSubscriptionSalePackingList.py
View file @
fb60ed3e
...
...
@@ -4,24 +4,11 @@ if params is None:
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
trade_condition_uid_list
=
[]
root_trade_condition_value
=
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredAggregatedSubscriptionSaleTradeCondition
())
root_trade_condition_uid
=
root_trade_condition_value
.
getUid
()
trade_condition_uid_list
.
append
(
root_trade_condition_uid
)
trade_condition_uid_list
.
extend
([
i
.
uid
for
i
in
portal
.
ERP5Site_searchRelatedInheritedSpecialiseList
(
portal_type
=
root_trade_condition_value
.
getPortalType
(),
specialise_uid
=
root_trade_condition_uid
,
validation_state
=
"validated"
)])
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Sale Packing List'
,
simulation_state
=
'confirmed'
,
causality_state
=
'solved'
,
specialise__uid
=
trade_condition_uid_list
,
ledger__uid
=
portal
.
portal_categories
.
ledger
.
automated
.
getUid
()
,
method_id
=
'Delivery_startConfirmedAggregatedSalePackingList'
,
activate_kw
=
{
'tag'
:
tag
},
)
...
...
master/bt5/slapos_accounting/SkinTemplateItem/portal_skins/slapos_accounting/Delivery_startConfirmedAggregatedSalePackingList.py
View file @
fb60ed3e
...
...
@@ -7,30 +7,10 @@ if context.getPortalType() != 'Sale Packing List':
isTransitionPossible
=
portal
.
portal_workflow
.
isTransitionPossible
if
context
.
getSimulationState
()
==
'confirmed'
\
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
=
'Start by alarm as all actions in confirmed state are ready.'
date
=
context
.
getStartDate
()
if
date
is
None
:
...
...
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