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
296a591e
Commit
296a591e
authored
Nov 26, 2024
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_mrp_quality_assurance: check more before post control and improve message
parent
658eee9c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
42 additions
and
20 deletions
+42
-20
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.js
.../web_page_module/gadget_post_ok_for_quality_control_js.js
+2
-2
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.xml
...web_page_module/gadget_post_ok_for_quality_control_js.xml
+2
-2
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.py
...ty_assurance/QualityControl_postQualityAssuranceResult.py
+37
-15
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.xml
...y_assurance/QualityControl_postQualityAssuranceResult.xml
+1
-1
No files found.
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.js
View file @
296a591e
...
...
@@ -82,8 +82,8 @@
.
push
(
function
(
response
)
{
var
result
=
JSON
.
parse
(
response
.
target
.
result
);
return
gadget
.
changeState
({
'
submit_state
'
:
result
.
status
,
'
input_value
'
:
result
.
valu
e
'
submit_state
'
:
result
.
portal_status_level
,
'
input_value
'
:
result
.
portal_status_messag
e
});
});
});
...
...
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.xml
View file @
296a591e
...
...
@@ -250,7 +250,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
1020.
54828.58036.3959
4
</string>
</value>
<value>
<string>
1020.
63511.22654.90
4
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -270,7 +270,7 @@
</tuple>
<state>
<tuple>
<float>
1732
268943.18
</float>
<float>
1732
789903.27
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.py
View file @
296a591e
from
DateTime
import
DateTime
import
json
now
=
DateTime
()
user_value
=
context
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
portal
=
context
.
getPortalObject
()
translateString
=
portal
.
Base_translateString
if
not
portal
.
portal_membership
.
checkPermission
(
'Modify portal content'
,
context
):
result_dict
=
{
'portal_status_message'
:
translateString
(
"No Permission"
),
'portal_status_level'
:
'error'
}
if
batch
or
fast_post
:
return
json
.
dumps
(
result_dict
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
result_dict
)
if
not
portal
.
portal_workflow
.
isTransitionPossible
(
context
,
'post'
):
result_dict
=
{
'portal_status_message'
:
translateString
(
"Quality Control is already in ${state} state"
,
mapping
=
{
"state"
:
context
.
getValidationState
()}),
'portal_status_level'
:
'error'
}
if
batch
or
fast_post
:
return
json
.
dumps
(
result_dict
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
result_dict
)
user_value
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
result
==
'ok'
:
context
.
edit
(
...
...
@@ -14,8 +37,8 @@ if result == 'ok':
elif
result
==
'nok'
:
if
fast_post
:
return
json
.
dumps
({
'
status'
:
'error'
,
'
value'
:
'Only OK is allow
'
'
portal_status_message'
:
translateString
(
"Only OK is allowed"
)
,
'
portal_status_level'
:
'error
'
})
if
not
context
.
getCausalityRelatedValue
(
portal_type
=
'Defect Item'
)
and
redirect_to_defect_dialog
:
return
context
.
Base_redirect
(
form_id
=
'declare_defect'
,
keep_items
=
{
...
...
@@ -42,12 +65,13 @@ elif result == 'nok':
effective_date
=
now
)
else
:
if
fast_post
:
return
json
.
dumps
({
'status'
:
'error'
,
'value'
:
'Only OK is allow'
})
raise
ValueError
(
'unknown result: %s'
%
result
)
result_dict
=
{
'portal_status_message'
:
translateString
(
"Unknown Value: ${result}"
,
mapping
=
{
'result'
:
result
}),
'portal_status_level'
:
'error'
}
if
batch
or
fast_post
:
return
json
.
dumps
(
result_dict
)
return
context
.
Base_redirect
(
'view'
,
keep_items
=
result_dict
)
me_line
=
context
.
getAggregateRelatedValue
(
portal_type
=
'Manufacturing Execution Line'
)
if
me_line
:
...
...
@@ -56,13 +80,11 @@ if me_line:
stop_date
=
now
)
context
.
post
()
if
batch
:
return
context
if
fast_post
:
if
batch
or
fast_post
:
return
json
.
dumps
({
'
status'
:
'success
'
,
'
value'
:
'OK
'
'
portal_status_message'
:
'OK
'
,
'
portal_status_level'
:
'success
'
})
ME
=
context
.
getCausalityValue
(
portal_type
=
'Manufacturing Execution'
)
...
...
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.xml
View file @
296a591e
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
result, redirect_to_defect_dialog = True, batch
=False,
fast_post = False, **kw
</string>
</value>
<value>
<string>
result, redirect_to_defect_dialog = True, batch
= False,
fast_post = False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
...
...
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