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
f8969f64
Commit
f8969f64
authored
Nov 20, 2024
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_mrp_quality_assurance: support fast quality control post
using gadget
parent
dec83150
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1236 additions
and
3 deletions
+1236
-3
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_css.css
...eb_page_module/gadget_post_ok_for_quality_control_css.css
+45
-0
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_css.xml
...eb_page_module/gadget_post_ok_for_quality_control_css.xml
+352
-0
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_html.html
..._page_module/gadget_post_ok_for_quality_control_html.html
+22
-0
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_html.xml
...b_page_module/gadget_post_ok_for_quality_control_html.xml
+350
-0
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
+92
-0
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
+352
-0
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.py
...ty_assurance/QualityControl_postQualityAssuranceResult.py
+19
-1
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.xml
...y_assurance/QualityControl_postQualityAssuranceResult.xml
+1
-1
bt5/erp5_mrp_quality_assurance/bt/template_keep_last_workflow_history_only_path_list
...nce/bt/template_keep_last_workflow_history_only_path_list
+1
-0
bt5/erp5_mrp_quality_assurance/bt/template_path_list
bt5/erp5_mrp_quality_assurance/bt/template_path_list
+2
-1
No files found.
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_css.css
0 → 100644
View file @
f8969f64
div
.dialog_in_listbox
input
[
type
=
'submit'
]
{
margin-top
:
0pt
;
margin-right
:
0pt
;
}
.document_table
tbody
tr
td
form
div
.dialog_in_listbox
{
width
:
max-content
;
position
:
relative
;
}
.ui-visibility-hidden
{
visibility
:
hidden
;
}
div
.dialog_in_listbox
.ui-icon-spinner
{
position
:
absolute
;
top
:
50%
;
left
:
18%
;
transform
:
translate
(
-50%
,
-50%
);
}
input
[
type
=
'submit'
]
.error
{
cursor
:
default
;
pointer-events
:
none
;
}
input
[
type
=
'submit'
]
.success
{
background-color
:
#37A419
;
border-color
:
#37A419
;
cursor
:
default
;
pointer-events
:
none
;
}
input
[
type
=
'submit'
]
.success
:hover
,
input
[
type
=
'submit'
]
.success
:focus
{
background-color
:
#37A419
;
}
form
.dialog_form_center_in_listbox
{
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
}
\ No newline at end of file
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_css.xml
0 → 100644
View file @
f8969f64
This diff is collapsed.
Click to expand it.
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_html.html
0 → 100644
View file @
f8969f64
<!DOCTYPE html>
<html>
<head>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
/>
<meta
name=
"viewport"
content=
"width=device-width,height=device-height,initial-scale=1"
/>
<title>
Post Ok for quality control gadget
</title>
<script
src=
"rsvp.js"
type=
"text/javascript"
></script>
<script
src=
"renderjs.js"
type=
"text/javascript"
></script>
<script
src=
"jio.js"
type=
"text/javascript"
></script>
<link
rel=
"stylesheet"
href=
"gadget_post_ok_for_quality_control.css"
>
<script
src=
"gadget_post_ok_for_quality_control.js"
type=
"text/javascript"
></script>
</head>
<body>
<form
class=
"dialog_form_center_in_listbox"
>
<div
class=
"dialog_button_container dialog_in_listbox"
>
<input
name=
"action_confirm"
class=
"dialogconfirm"
type=
"submit"
value=
"Mark OK"
>
<span
class=
"ui-icon-spinner ui-btn-icon-notext ui-visibility-hidden"
></span>
</div>
</form>
</body>
</html>
\ No newline at end of file
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_html.xml
0 → 100644
View file @
f8969f64
This diff is collapsed.
Click to expand it.
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.js
0 → 100644
View file @
f8969f64
/*global window, rJS, RSVP, jIO */
/*jslint nomen: true, maxlen:180, indent:2*/
(
function
(
rJS
,
jIO
,
RSVP
,
window
)
{
"
use strict
"
;
rJS
(
window
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareMethod
(
'
render
'
,
function
(
options
)
{
var
gadget
=
this
;
return
gadget
.
getSetting
(
"
hateoas_url
"
)
.
push
(
function
(
hateoas_url
)
{
options
.
hateoas_url
=
hateoas_url
;
options
.
submit_state
=
'
initial
'
;
options
.
input_value
=
'
Mark OK
'
;
return
gadget
.
changeState
(
options
);
});
})
.
onStateChange
(
function
(
modification_dict
)
{
var
gadget
=
this
,
button_container
=
gadget
.
element
.
querySelector
(
'
.dialog_button_container
'
),
submit_input
=
button_container
.
querySelector
(
'
input
'
),
spinner
=
button_container
.
querySelector
(
'
.ui-icon-spinner
'
);
if
(
modification_dict
.
hasOwnProperty
(
'
input_value
'
))
{
submit_input
.
value
=
modification_dict
.
input_value
;
}
if
(
modification_dict
.
hasOwnProperty
(
'
submit_state
'
))
{
switch
(
gadget
.
state
.
submit_state
)
{
case
'
initial
'
:
submit_input
.
disabled
=
false
;
spinner
.
classList
.
add
(
'
ui-visibility-hidden
'
);
submit_input
.
classList
.
remove
(
'
success
'
);
submit_input
.
classList
.
remove
(
'
error
'
);
break
;
case
'
sending
'
:
submit_input
.
disabled
=
true
;
spinner
.
classList
.
remove
(
'
ui-visibility-hidden
'
);
submit_input
.
classList
.
remove
(
'
success
'
);
submit_input
.
classList
.
remove
(
'
error
'
);
break
;
case
'
success
'
:
submit_input
.
disabled
=
true
;
spinner
.
classList
.
add
(
'
ui-visibility-hidden
'
);
submit_input
.
classList
.
add
(
'
success
'
);
submit_input
.
classList
.
remove
(
'
error
'
);
break
;
case
'
error
'
:
submit_input
.
disabled
=
true
;
spinner
.
classList
.
add
(
'
ui-visibility-hidden
'
);
submit_input
.
classList
.
remove
(
'
success
'
);
submit_input
.
classList
.
add
(
'
error
'
);
break
;
}
}
})
.
onEvent
(
'
submit
'
,
function
submit
()
{
var
gadget
=
this
;
return
new
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
changeState
({
'
submit_state
'
:
'
sending
'
,
'
input_value
'
:
'
Posting
'
}),
gadget
.
jio_putAttachment
(
gadget
.
state
.
quality_control
,
// it's ugly, we should generate url in server side,
// but it doesn't work well to get hateoas_url in server side
// romain will check it in generic code
gadget
.
state
.
hateoas_url
+
gadget
.
state
.
post_url
,
{
'
result
'
:
gadget
.
state
.
value
,
'
fast_post
'
:
true
}
)
]);
})
.
push
(
function
(
result_list
)
{
return
jIO
.
util
.
readBlobAsText
(
result_list
[
1
].
target
.
response
);
})
.
push
(
function
(
response
)
{
var
result
=
JSON
.
parse
(
response
.
target
.
result
);
return
gadget
.
changeState
({
'
submit_state
'
:
result
.
status
,
'
input_value
'
:
result
.
value
});
});
});
}(
rJS
,
jIO
,
RSVP
,
window
));
\ No newline at end of file
bt5/erp5_mrp_quality_assurance/PathTemplateItem/web_page_module/gadget_post_ok_for_quality_control_js.xml
0 → 100644
View file @
f8969f64
This diff is collapsed.
Click to expand it.
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.py
View file @
f8969f64
from
DateTime
import
DateTime
import
json
now
=
DateTime
()
user_value
=
context
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
result
==
'ok'
:
context
.
edit
(
destination_decision_value
=
user_value
,
...
...
@@ -12,6 +12,11 @@ if result == 'ok':
effective_date
=
now
)
elif
result
==
'nok'
:
if
fast_post
:
return
json
.
dumps
({
'status'
:
'error'
,
'value'
:
'Only OK is allow'
})
if
not
context
.
getCausalityRelatedValue
(
portal_type
=
'Defect Item'
)
and
redirect_to_defect_dialog
:
return
context
.
Base_redirect
(
form_id
=
'declare_defect'
,
keep_items
=
{
'post_quality_control'
:
True
,
...
...
@@ -37,6 +42,11 @@ 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
)
me_line
=
context
.
getAggregateRelatedValue
(
portal_type
=
'Manufacturing Execution Line'
)
...
...
@@ -48,7 +58,15 @@ if me_line:
context
.
post
()
if
batch
:
return
context
if
fast_post
:
return
json
.
dumps
({
'status'
:
'success'
,
'value'
:
'OK'
})
ME
=
context
.
getCausalityValue
(
portal_type
=
'Manufacturing Execution'
)
return
ME
.
Base_redirect
(
'view'
,
keep_items
=
{
...
...
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/QualityControl_postQualityAssuranceResult.xml
View file @
f8969f64
...
...
@@ -50,7 +50,7 @@
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
result, redirect_to_defect_dialog = True, batch=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>
...
...
bt5/erp5_mrp_quality_assurance/bt/template_keep_last_workflow_history_only_path_list
0 → 100644
View file @
f8969f64
web_page_module/gadget_post_ok_for_quality_control**
\ No newline at end of file
bt5/erp5_mrp_quality_assurance/bt/template_path_list
View file @
f8969f64
portal_alarms/psa_quality_assurance_builder_alarm
web_page_module/gadget_post_ok_for_quality_control**
\ No newline at end of file
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