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
3422c83e
Commit
3422c83e
authored
Jun 26, 2024
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_mrp_quality_assurance: constraint
parent
932ee3d1
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
318 additions
and
0 deletions
+318
-0
bt5/erp5_mrp_quality_assurance/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
...rtalTypePropertySheetTemplateItem/property_sheet_list.xml
+3
-0
bt5/erp5_mrp_quality_assurance/PropertySheetTemplateItem/portal_property_sheets/DeliveryLine_qualityAssuranceConstraint.xml
...operty_sheets/DeliveryLine_qualityAssuranceConstraint.xml
+66
-0
bt5/erp5_mrp_quality_assurance/PropertySheetTemplateItem/portal_property_sheets/DeliveryLine_qualityAssuranceConstraint/quality_assurance_element_constraint.xml
...uranceConstraint/quality_assurance_element_constraint.xml
+80
-0
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/DeliveryLine_checkQualityAssuranceElement.py
...ty_assurance/DeliveryLine_checkQualityAssuranceElement.py
+105
-0
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/DeliveryLine_checkQualityAssuranceElement.xml
...y_assurance/DeliveryLine_checkQualityAssuranceElement.xml
+62
-0
bt5/erp5_mrp_quality_assurance/bt/template_portal_type_property_sheet_list
...ity_assurance/bt/template_portal_type_property_sheet_list
+1
-0
bt5/erp5_mrp_quality_assurance/bt/template_property_sheet_id_list
..._mrp_quality_assurance/bt/template_property_sheet_id_list
+1
-0
No files found.
bt5/erp5_mrp_quality_assurance/PortalTypePropertySheetTemplateItem/property_sheet_list.xml
View file @
3422c83e
...
...
@@ -11,6 +11,9 @@
<portal_type
id=
"Gate"
>
<item>
SortIndex
</item>
</portal_type>
<portal_type
id=
"Manufacturing Execution Line"
>
<item>
DeliveryLine_qualityAssuranceConstraint
</item>
</portal_type>
<portal_type
id=
"Quality Control"
>
<item>
SortIndex
</item>
</portal_type>
...
...
bt5/erp5_mrp_quality_assurance/PropertySheetTemplateItem/portal_property_sheets/DeliveryLine_qualityAssuranceConstraint.xml
0 → 100644
View file @
3422c83e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Property Sheet"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
DeliveryLine_qualityAssuranceConstraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Property Sheet
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
bt5/erp5_mrp_quality_assurance/PropertySheetTemplateItem/portal_property_sheets/DeliveryLine_qualityAssuranceConstraint/quality_assurance_element_constraint.xml
0 → 100644
View file @
3422c83e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Script Constraint"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_identity_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_range_criterion
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
constraint_type/default
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
quality_assurance_element_constraint
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Script Constraint
</string>
</value>
</item>
<item>
<key>
<string>
script_id
</string>
</key>
<value>
<string>
DeliveryLine_checkQualityAssuranceElement
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/DeliveryLine_checkQualityAssuranceElement.py
0 → 100644
View file @
3422c83e
from
DateTime
import
DateTime
ledger
=
context
.
getLedger
()
if
ledger
not
in
(
"manufacturing/quality_insurance"
,
"manufacturing/electronic_insurance"
):
return
[]
if
context
.
getQuantity
()
>
0
:
return
[]
if
ledger
==
"manufacturing/quality_insurance"
:
publication_section
=
"quality_insurance"
else
:
publication_section
=
"electronic_insurance"
resource_value
=
context
.
getResourceValue
()
if
not
resource_value
:
return
[]
resource_use
=
resource_value
.
getUse
()
use_dict
=
{
"manufacturing/defect_notification"
:
""
,
"manufacturing/quality_insurance"
:
""
,
"manufacturing/gate"
:
"Gate"
,
"manufacturing/traceability"
:
"Traceability"
,
"manufacturing/quality_control"
:
"Quality Control"
,
"manufacturing/smon"
:
"SMON"
,
"manufacturing/acom"
:
"ACOM"
}
if
resource_use
not
in
use_dict
:
return
[
'resource use: %s not in use dict: %s'
%
(
resource_use
,
use_dict
.
keys
())]
if
resource_use
in
(
"manufacturing/quality_insurance"
,
"manufacturing/defect_notification"
):
return
[]
portal_type
=
use_dict
[
resource_use
]
ME_insurance
=
context
.
getParentValue
()
production_order
=
ME_insurance
.
getCausalityValue
(
portal_type
=
'Production Order'
)
for
me
in
production_order
.
getCausalityRelatedValueList
(
portal_type
=
'Manufacturing Execution'
):
if
me
.
getLedger
()
==
'manufacturing/execution'
:
ME_execution
=
me
break
vin
=
ME_execution
.
getAggregateValue
(
portal_type
=
'VIN'
)
if
portal_type
==
"Traceability"
:
if
not
context
.
getAggregateValue
(
portal_type
=
portal_type
):
if
not
fixit
:
return
[
'No quality assurance element found'
]
if
ME_insurance
.
getLedger
()
==
"manufacturing/quality_insurance"
:
product_reference
=
resource_value
.
getReference
().
split
(
'-'
)[
-
1
]
else
:
product_reference
=
resource_value
.
getReference
()
document_title
=
resource_value
.
getTitle
()
assurance_document
=
context
.
quality_assurance_module
.
newContent
(
portal_type
=
portal_type
,
title
=
document_title
,
reference
=
product_reference
,
int_index
=
context
.
getIntIndex
(),
description
=
resource_value
.
getDescription
(),
causality_value
=
ME_execution
,
aggregate_value
=
vin
,
effective_date
=
DateTime
(),
publication_section
=
publication_section
)
if
ME_insurance
.
getLedger
()
==
"manufacturing/quality_insurance"
:
# check if really in BOM
real_line
=
ME_execution
.
searchFolder
(
portal_type
=
'Manufacturing Execution Line'
,
limit
=
1
,
strict_resource_reference
=
product_reference
)
if
real_line
:
assurance_document
.
edit
(
follow_up_value
=
real_line
[
0
])
context
.
setAggregateValue
(
assurance_document
,
portal_type
=
portal_type
)
assurance_document
.
plan
()
return
[]
else
:
if
not
context
.
getAggregateValue
(
portal_type
=
portal_type
):
if
not
fixit
:
return
[
'No quality assurance element found'
]
assurance_document
=
context
.
quality_assurance_module
.
newContent
(
portal_type
=
portal_type
,
title
=
resource_value
.
getTitle
(),
reference
=
resource_value
.
getReference
(),
int_index
=
context
.
getIntIndex
(),
description
=
resource_value
.
getDescription
(),
causality_value
=
ME_execution
,
aggregate_value
=
vin
,
publication_section
=
publication_section
,
effective_date
=
DateTime
()
)
context
.
setAggregateValue
(
assurance_document
,
portal_type
=
portal_type
)
assurance_document
.
plan
()
return
[]
bt5/erp5_mrp_quality_assurance/SkinTemplateItem/portal_skins/erp5_mrp_quality_assurance/DeliveryLine_checkQualityAssuranceElement.xml
0 → 100644
View file @
3422c83e
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
fixit=False, **kw
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
DeliveryLine_checkQualityAssuranceElement
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_mrp_quality_assurance/bt/template_portal_type_property_sheet_list
View file @
3422c83e
...
...
@@ -2,6 +2,7 @@ ACOM | SortIndex
Defect Correction | SortIndex
Defect Declaration | SortIndex
Gate | SortIndex
Manufacturing Execution Line | DeliveryLine_qualityAssuranceConstraint
Quality Control | SortIndex
SMON | SortIndex
Traceability | SortIndex
\ No newline at end of file
bt5/erp5_mrp_quality_assurance/bt/template_property_sheet_id_list
0 → 100644
View file @
3422c83e
DeliveryLine_qualityAssuranceConstraint
\ 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