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
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
5a8ceb20
Commit
5a8ceb20
authored
Sep 27, 2024
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_mrp_quality_assurance: show vin if serial number is already used
parent
fcc1d17d
Pipeline
#37126
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
17 deletions
+15
-17
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/ManufacturingExecution_processTraceabilityData.py
...surance/ManufacturingExecution_processTraceabilityData.py
+15
-17
No files found.
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/ManufacturingExecution_processTraceabilityData.py
View file @
5a8ceb20
...
...
@@ -16,8 +16,7 @@ for traceability_input in context.Base_getExpectedTraceabilityInputList():
data_dict
=
context
.
Base_generateValideTraceabilityDataDict
(
traceability_data
)
unprocess_data_list
=
[]
processed_data_list
=
[]
already_used_list
=
[]
ME_vin
=
context
.
getAggregateValue
(
portal_type
=
'VIN'
)
already_used_dict
=
{}
for
product_reference
,
serial_number_list
in
data_dict
.
iteritems
():
if
product_reference
in
traceability_input_dict
:
...
...
@@ -40,11 +39,7 @@ for product_reference, serial_number_list in data_dict.iteritems():
if
part_product
and
part_product
.
getProductLine
()
==
'part/radio'
:
is_for_radio
=
True
if
affected_vin
and
(
not
is_for_radio
):
# same serial number affected to same VIN
if
affected_vin
==
ME_vin
:
already_used_list
.
append
(
serial_number
)
else
:
unprocess_data_list
=
unprocess_data_list
+
[
serial_number
]
already_used_dict
[
serial_number
]
=
affected_vin
.
getReference
()
continue
else
:
serial_item
=
context
.
quality_assurance_module
.
newContent
(
...
...
@@ -83,8 +78,8 @@ for product_reference, serial_number_list in data_dict.iteritems():
else
:
for
unprocess_number
in
serial_number_list
:
unprocess_number_value
=
getattr
(
context
.
quality_assurance_module
,
unprocess_number
,
None
)
if
unprocess_number_value
and
(
unprocess_number_value
.
getAggregateValue
(
portal_type
=
'VIN'
)
==
ME_vin
):
already_used_
list
.
append
(
unprocess_number
)
if
unprocess_number_value
and
unprocess_number_value
.
getAggregateReference
(
portal_type
=
'VIN'
):
already_used_
dict
[
unprocess_number
]
=
unprocess_number_value
.
getAggregateReference
(
portal_type
=
'VIN'
)
else
:
unprocess_data_list
.
append
(
unprocess_number
)
...
...
@@ -92,15 +87,18 @@ if unprocess_data_list:
unprocess_data_list
=
list
(
set
(
unprocess_data_list
))
unprocess_data_list
=
[
x
for
x
in
unprocess_data_list
if
x
not
in
processed_data_list
]
if
unprocess_data_list
or
already_used_
lis
t
:
if
unprocess_data_list
or
already_used_
dic
t
:
msg
=
''
if
unprocess_data_list
:
msg
=
msg
+
translateString
(
"Those data are not processed"
)
if
already_used_list
:
msg
=
msg
+
translateString
(
"Data already processed : ${already_processed}"
,
if
already_used_dict
:
msg
=
msg
+
'
\
n
'
+
translateString
(
"Already used:"
)
for
serial_number
,
vin
in
already_used_dict
.
iteritems
():
msg
=
msg
+
'
\
n
'
+
translateString
(
"${serial_number}: ${vin}"
,
mapping
=
{
'already_processed'
:
'
\
n
'
.
join
(
already_used_list
)
'serial_number'
:
serial_number
,
'vin'
:
vin
}
)
return
context
.
Base_redirect
(
'view_traceability_input'
,
keep_items
=
{
...
...
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