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
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
Carlos Ramos Carreño
erp5
Commits
d1a3c855
Commit
d1a3c855
authored
Apr 05, 2022
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Plain Diff
project task fast input
fix internal API mis-use and other small fixes See merge request
!1583
parents
940f40ce
b84bea2c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
16 deletions
+10
-16
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project_trade/Delivery_updateTaskFastInputDialog.py
.../erp5_project_trade/Delivery_updateTaskFastInputDialog.py
+10
-16
No files found.
bt5/erp5_project/SkinTemplateItem/portal_skins/erp5_project_trade/Delivery_updateTaskFastInputDialog.py
View file @
d1a3c855
"""At first call, this script prefill values for all tasks that are
going to be created. If values are already there, this script check
if
information
s are
correct.
"""At first call, this script prefill
s
values for all tasks that are
going to be created. If values are already there, this script check
that
information
is
correct.
"""
context
.
log
(
'source_project_title'
,
source_project_title
)
portal
=
context
.
getPortalObject
()
line_portal_type
=
"Sale Order Line"
request
=
context
.
REQUEST
from
string
import
zfill
from
Products.
ERP5Type.Document
import
newTempBase
from
Products.
PythonScripts.standard
import
Object
from
Products.ERP5Type.Message
import
translateString
context
.
log
(
'original listbox'
,
listbox
)
initial_value_dict
=
{}
for
line
in
(
listbox
or
[]):
initial_value_dict
[
line
[
'listbox_key'
]]
=
line
...
...
@@ -19,7 +17,7 @@ listbox = []
validation_errors
=
{}
def
getRecursiveLineList
(
current
,
line_list
):
# We parse recursively all delivery line and we keep only ones
# without child
s
# without child
sub_line_list
=
current
.
objectValues
(
portal_type
=
line_portal_type
)
if
len
(
sub_line_list
)
==
0
:
if
current
.
getPortalType
()
==
line_portal_type
:
...
...
@@ -29,13 +27,10 @@ def getRecursiveLineList(current, line_list):
getRecursiveLineList
(
sub_line
,
line_list
)
line_list
=
[]
getRecursiveLineList
(
context
,
line_list
)
context
.
log
(
"line_list"
,
line_list
)
i
=
1
project_search_dict
=
{}
portal
=
context
.
getPortalObject
()
for
line
in
line_list
:
line_dict
=
{}
#line_dict['listbox_key'] = "%s" % line_id
key
=
zfill
(
i
,
3
)
for
property_name
in
(
'title'
,
'quantity_unit_title'
,
'quantity'
,
'resource_title'
,
'total_price'
,
'price'
,
...
...
@@ -65,13 +60,13 @@ for line in line_list:
else
:
line_dict
[
'source_project_relative_url'
]
=
result
[
0
].
getRelativeUrl
()
if
error_message
:
error
=
newTempBase
(
context
,
key
)
error
.
edit
(
error_text
=
error_message
)
validation_errors
[
'listbox_source_project_title_new_%s'
%
key
]
=
error
validation_errors
[
'listbox_source_project_title_new_%s'
%
key
]
=
Object
(
field_id
=
'listbox_source_project_title_new_%s'
%
key
,
getMessage
=
lambda
translateString
,
message
=
error_message
:
translateString
(
message
),
)
listbox
.
append
(
line_dict
)
i
+=
1
context
.
log
(
'listbox'
,
listbox
)
context
.
Base_updateDialogForm
(
listbox
=
listbox
,
update
=
1
,
kw
=
kw
)
if
len
(
validation_errors
):
...
...
@@ -101,6 +96,5 @@ if create and len(validation_errors) == 0:
destination_section
=
delivery_line
.
getDestinationSection
(),
destination_decision
=
delivery_line
.
getDestinationDecision
())
return
context
.
Base_redirect
(
form_id
,
keep_items
=
dict
(
portal_status_message
=
translateString
(
'%s Tasks Created.'
%
(
len
(
listbox
),))))
portal_status_message
=
translateString
(
'${task_count} Tasks Created.'
,
mapping
=
{
'task_count'
:
len
(
listbox
)})))
return
context
.
Delivery_viewTaskFastInputDialog
(
listbox
=
listbox
,
**
kw
)
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