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
0f88b96c
Commit
0f88b96c
authored
Nov 29, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改问题
parent
910b7ac4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
jzjx_project/controllers/inherit_product_task.py
+42
-0
No files found.
jzjx_project/controllers/inherit_product_task.py
View file @
0f88b96c
from
odoo
import
models
,
fields
,
api
,
http
,
SUPERUSER_ID
,
_
from
odoo
import
models
,
fields
,
api
,
http
,
SUPERUSER_ID
,
_
from
odoo.addons.roke_workstation_api.controllers.product_task
import
RokeWorkstationProductionTask
from
odoo.addons.roke_workstation_api.controllers.product_task
import
RokeWorkstationProductionTask
from
odoo.addons.roke_workstation_api.controllers.product_task
import
RokeWorkstationTaskDispatch
import
logging
import
logging
import
math
import
math
...
@@ -142,3 +143,44 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
...
@@ -142,3 +143,44 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
continue
continue
data
.
append
(
work_data
)
data
.
append
(
work_data
)
return
{
"code"
:
0
,
"message"
:
"获取成功!"
,
"data"
:
data
,
"process_ids"
:
process_list
,
"count"
:
task_count
}
return
{
"code"
:
0
,
"message"
:
"获取成功!"
,
"data"
:
data
,
"process_ids"
:
process_list
,
"count"
:
task_count
}
class
InheritRokeWorkstationTaskDispatch
(
RokeWorkstationTaskDispatch
):
@http.route
(
'/roke/workstation/product_task/get_document_list'
,
type
=
'json'
,
auth
=
'none'
,
csrf
=
False
,
cors
=
"*"
)
def
product_task_get_document_list
(
self
):
_self
=
http
.
request
work_order_id
=
_self
.
jsonrequest
.
get
(
"work_order_id"
,
False
)
if
not
work_order_id
:
return
{
"code"
:
1
,
"message"
:
f
"入参错误!工单ID为必传数据。!"
,
"data"
:
[]}
work_order
=
_self
.
env
[
"roke.work.order"
]
.
sudo
()
.
search
([(
"id"
,
"="
,
work_order_id
)])
if
not
work_order
:
res
=
super
(
InheritRokeWorkstationTaskDispatch
,
self
)
.
product_task_get_document_list
()
return
res
if
work_order
.
type
==
"返修"
:
repair_order_line
=
_self
.
env
[
"roke.repair.order.line"
]
.
sudo
()
.
search
([
(
"repair_work_order_id"
,
"="
,
work_order
.
id
)
],
limit
=
1
)
if
not
repair_order_line
:
res
=
super
(
InheritRokeWorkstationTaskDispatch
,
self
)
.
product_task_get_document_list
()
return
res
_self
.
jsonrequest
[
"work_order_id"
]
=
work_order
.
repair_wr_id
.
work_order_id
.
ids
elif
work_order
.
type
==
"补件"
:
scrap_order_line
=
_self
.
env
[
"roke.scrap.order.line"
]
.
sudo
()
.
search
([
(
"scrap_work_order_ids"
,
"="
,
work_order
.
id
)
],
limit
=
1
)
if
not
scrap_order_line
:
res
=
super
(
InheritRokeWorkstationTaskDispatch
,
self
)
.
product_task_get_document_list
()
return
res
task_id
=
scrap_order_line
.
order_id
.
wr_id
.
work_order_id
.
task_id
or
\
scrap_order_line
.
order_id
.
wr_id
.
work_order_id
.
repair_task_id
work_order_ids
=
task_id
.
work_order_ids
new_work_order_id
=
0
for
v
in
work_order_ids
:
if
work_order
.
process_id
.
id
!=
v
.
process_id
.
id
:
continue
new_work_order_id
=
v
.
id
break
_self
.
jsonrequest
[
"work_order_id"
]
=
new_work_order_id
res
=
super
(
InheritRokeWorkstationTaskDispatch
,
self
)
.
product_task_get_document_list
()
return
res
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