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
Labels
Merge Requests
139
Merge Requests
139
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
0a6664a2
Commit
0a6664a2
authored
Jul 24, 2019
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fxup! erp5_pdm: support calculation of base_price applying to all items of a same slice
parent
fb899455
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
2 deletions
+18
-2
bt5/erp5_pdm/WorkflowTemplateItem/portal_workflow/supply_line_interaction_workflow/scripts/SupplyLine_updateBasePriceCellRange.py
...n_workflow/scripts/SupplyLine_updateBasePriceCellRange.py
+7
-0
bt5/erp5_pdm/WorkflowTemplateItem/portal_workflow/supply_line_interaction_workflow/scripts/SupplyLine_updateBasePricePerSlice.py
...on_workflow/scripts/SupplyLine_updateBasePricePerSlice.py
+11
-2
No files found.
bt5/erp5_pdm/WorkflowTemplateItem/portal_workflow/supply_line_interaction_workflow/scripts/SupplyLine_updateBasePriceCellRange.py
View file @
0a6664a2
supply_line
=
state_change
[
'object'
]
# Currently state_change.kwargs['workflow_method_args'] contains
# a list of string, so this script is called every time.
# As it is not the intent, let's return early if nothing changes
if
[
float
(
x
)
for
x
in
sorted
(
state_change
.
kwargs
[
'workflow_method_args'
][
0
],
key
=
lambda
x
:
float
(
x
))]
==
sorted
(
supply_line
.
getQuantityStepList
()):
return
if
supply_line
.
isBasePricePerSlice
():
price_parameter
=
'slice_base_price'
else
:
...
...
bt5/erp5_pdm/WorkflowTemplateItem/portal_workflow/supply_line_interaction_workflow/scripts/SupplyLine_updateBasePricePerSlice.py
View file @
0a6664a2
supply_line
=
state_change
[
'object'
]
base_id
=
'path'
supply_line
.
updateCellSliceParameterList
(
base_id
=
base_id
)
to_delete_cell_list
=
[
cell
for
cell
in
supply_line
.
getCellIdList
(
base_id
=
'path'
)
if
hasattr
(
supply_line
,
cell
)
]
supply_line
.
manage_delObjects
(
ids
=
to_delete_cell_list
)
if
state_change
.
kwargs
[
'workflow_method_args'
][
0
]:
price_parameter
=
'slice_base_price'
else
:
price_parameter
=
'base_price'
supply_line
.
updateQuantityPredicate
(
price_parameter
)
supply_line
.
updateCellRange
(
base_id
=
'path'
)
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