Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
945b7867
Commit
945b7867
authored
Dec 04, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 工位机获取工单数据修改,增加补件/返修单的下道工单
parent
25b79c71
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
4 deletions
+16
-4
jzjx_project/controllers/roke_work_order.py
+4
-3
jzjx_project/models/inherit_roke_work_order.py
+12
-1
No files found.
jzjx_project/controllers/roke_work_order.py
View file @
945b7867
...
@@ -27,6 +27,10 @@ class InheritRokeWorkstationWorkOrder(RokeWorkstationWorkOrder):
...
@@ -27,6 +27,10 @@ class InheritRokeWorkstationWorkOrder(RokeWorkstationWorkOrder):
work_order_id
=
_self
.
jsonrequest
.
get
(
"work_order_id"
,
0
)
work_order_id
=
_self
.
jsonrequest
.
get
(
"work_order_id"
,
0
)
res
=
super
(
InheritRokeWorkstationWorkOrder
,
self
)
.
workstation_work_order
()
res
=
super
(
InheritRokeWorkstationWorkOrder
,
self
)
.
workstation_work_order
()
work_order
=
_self
.
env
[
"roke.work.order"
]
.
search
([(
"id"
,
"="
,
work_order_id
)])
work_order
=
_self
.
env
[
"roke.work.order"
]
.
search
([(
"id"
,
"="
,
work_order_id
)])
next_work_order
=
_self
.
env
[
"roke.work.order"
]
.
search
([(
"id"
,
"="
,
res
.
get
(
"data"
,
{})
.
get
(
"id"
,
0
))])
res
.
get
(
"data"
,
{})
.
update
({
"next_wo_code"
:
next_work_order
.
next_wo_id
.
code
or
""
})
if
not
work_order_id
or
not
work_order
:
if
not
work_order_id
or
not
work_order
:
return
res
return
res
if
work_order
.
type
==
"返修"
:
if
work_order
.
type
==
"返修"
:
...
@@ -57,9 +61,6 @@ class InheritRokeWorkstationWorkOrder(RokeWorkstationWorkOrder):
...
@@ -57,9 +61,6 @@ class InheritRokeWorkstationWorkOrder(RokeWorkstationWorkOrder):
"routing_id"
:
routing_id
.
id
,
"routing_id"
:
routing_id
.
id
,
"routing_line_id"
:
line_id
"routing_line_id"
:
line_id
})
})
res
.
get
(
"data"
,
{})
.
update
({
"next_wo_code"
:
work_order
.
next_wo_id
.
code
or
""
})
return
res
return
res
...
...
jzjx_project/models/inherit_roke_work_order.py
View file @
945b7867
...
@@ -8,19 +8,30 @@ class InheritWorkOrder(models.Model):
...
@@ -8,19 +8,30 @@ class InheritWorkOrder(models.Model):
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
repair_task_id
=
fields
.
Many2one
(
'roke.production.task'
,
string
=
"上级任务"
)
repair_task_id
=
fields
.
Many2one
(
'roke.production.task'
,
string
=
"上级任务"
)
repair_wr_id
=
fields
.
Many2one
(
'roke.work.record'
,
string
=
"原始返修报工
工
单"
)
repair_wr_id
=
fields
.
Many2one
(
'roke.work.record'
,
string
=
"原始返修报工单"
)
next_wo_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"下道工单"
,
store
=
True
,
compute
=
"_compute_next_work_order"
)
next_wo_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"下道工单"
,
store
=
True
,
compute
=
"_compute_next_work_order"
)
@api.depends
(
"task_id"
)
@api.depends
(
"task_id"
)
def
_compute_next_work_order
(
self
):
def
_compute_next_work_order
(
self
):
for
v
in
self
:
for
v
in
self
:
if
v
.
type
==
"生产"
:
sequence
=
min
(
v
.
mapped
(
"sequence"
))
sequence
=
min
(
v
.
mapped
(
"sequence"
))
next_wos
=
v
.
task_id
.
work_order_ids
.
filtered
(
lambda
wo
:
wo
.
sequence
>
sequence
)
next_wos
=
v
.
task_id
.
work_order_ids
.
filtered
(
lambda
wo
:
wo
.
sequence
>
sequence
)
next_wo
=
sorted
(
next_wos
,
key
=
lambda
x
:
x
[
'sequence'
],
reverse
=
False
)
next_wo
=
sorted
(
next_wos
,
key
=
lambda
x
:
x
[
'sequence'
],
reverse
=
False
)
if
not
next_wo
:
if
not
next_wo
:
continue
continue
v
.
next_wo_id
=
next_wo
[
0
]
.
id
v
.
next_wo_id
=
next_wo
[
0
]
.
id
elif
v
.
type
==
"返修"
:
v
.
next_wo_id
=
v
.
repair_wr_id
.
work_order_id
.
id
elif
v
.
type
==
"补件"
:
sequence
=
v
.
sequence
next_wos
=
v
.
repair_wr_id
.
scrap_line_ids
.
scrap_work_order_ids
.
filtered
(
lambda
wo
:
wo
.
sequence
>
sequence
)
next_wo
=
sorted
(
next_wos
,
key
=
lambda
x
:
x
[
'sequence'
],
reverse
=
False
)
if
not
next_wo
:
v
.
next_wo_id
=
v
.
repair_wr_id
.
work_order_id
.
id
else
:
v
.
next_wo_id
=
next_wo
[
0
]
.
id
def
write
(
self
,
vals
):
def
write
(
self
,
vals
):
id_dict
=
{}
id_dict
=
{}
...
...
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