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
5adf5f62
Commit
5adf5f62
authored
Dec 03, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改问题
parent
3fad1394
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
0 deletions
+12
-0
jzjx_project/models/inherit_roke_work_order.py
+12
-0
No files found.
jzjx_project/models/inherit_roke_work_order.py
View file @
5adf5f62
...
...
@@ -10,6 +10,18 @@ class InheritWorkOrder(models.Model):
repair_task_id
=
fields
.
Many2one
(
'roke.production.task'
,
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"
)
@api.depends
(
"task_id"
)
def
_compute_next_work_order
(
self
):
for
v
in
self
:
sequence
=
min
(
v
.
mapped
(
"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
)
if
not
next_wo
:
continue
v
.
next_wo_id
=
next_wo
[
0
]
.
id
def
write
(
self
,
vals
):
id_dict
=
{}
for
v
in
self
:
...
...
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