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
03f27621
Commit
03f27621
authored
Nov 28, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 继承父级获取工单信息接口,添加返修单/补件单获取上级报工工单的所有工艺信息数据和工艺详情信息数据
parent
1c3fec83
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
jzjx_project/controllers/roke_work_order.py
+42
-0
No files found.
jzjx_project/controllers/roke_work_order.py
View file @
03f27621
...
@@ -6,6 +6,7 @@ from jinja2 import FileSystemLoader, Environment
...
@@ -6,6 +6,7 @@ from jinja2 import FileSystemLoader, Environment
import
pytz
import
pytz
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.data_analysis
import
reduce_pytz_conversion
,
pytz_conversion
from
odoo.addons.roke_workstation_api.controllers.data_analysis
import
reduce_pytz_conversion
,
pytz_conversion
from
odoo.addons.roke_workstation_api.controllers.work_order
import
RokeWorkstationWorkOrder
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
...
@@ -16,6 +17,47 @@ templateloader = FileSystemLoader(searchpath=BASE_DIR + "/static")
...
@@ -16,6 +17,47 @@ templateloader = FileSystemLoader(searchpath=BASE_DIR + "/static")
env
=
Environment
(
loader
=
templateloader
)
env
=
Environment
(
loader
=
templateloader
)
class
InheritRokeWorkstationWorkOrder
(
RokeWorkstationWorkOrder
):
@http.route
(
'/roke/workstation/work_order/workstation_work_order'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
def
workstation_work_order
(
self
):
"""
继承父级获取工单信息接口,添加返修单/补件单获取上级报工工单的所有工艺信息数据和工艺详情信息数据
"""
_self
=
http
.
request
work_order_id
=
_self
.
jsonrequest
.
get
(
"work_order_id"
,
0
)
res
=
super
(
InheritRokeWorkstationWorkOrder
,
self
)
.
workstation_work_order
()
work_order
=
_self
.
env
[
"roke.work.order"
]
.
search
([(
"id"
,
"="
,
work_order_id
)])
if
not
work_order_id
or
not
work_order
:
return
res
if
work_order
.
type
==
"返修"
:
repair_order_line
=
_self
.
env
[
"roke.repair.order.line"
]
.
search
([
(
"repair_work_order_id"
,
"="
,
work_order
.
id
)
],
limit
=
1
)
if
not
repair_order_line
:
return
res
res
.
get
(
"data"
,
{})
.
update
({
"routing_id"
:
repair_order_line
.
order_id
.
wr_id
.
work_order_id
.
task_id
.
routing_id
.
id
,
"routing_line_id"
:
repair_order_line
.
order_id
.
wr_id
.
work_order_id
.
routing_line_id
.
id
})
elif
work_order
.
type
==
"补件"
:
scrap_order_line
=
_self
.
env
[
"roke.scrap.order.line"
]
.
search
([(
"scrap_work_order_ids"
,
"="
,
work_order
.
id
)],
limit
=
1
)
if
not
scrap_order_line
:
return
res
routing_id
=
scrap_order_line
.
order_id
.
wr_id
.
work_order_id
.
task_id
.
routing_id
line_id
=
0
for
v
in
routing_id
.
line_ids
:
if
work_order
.
process_id
.
id
!=
v
.
process_id
.
id
:
continue
line_id
=
v
.
id
break
res
.
get
(
"data"
,
{})
.
update
({
"routing_id"
:
routing_id
.
id
,
"routing_line_id"
:
line_id
})
return
res
class
RokeWorkstationWorkOrderModel
(
http
.
Controller
):
class
RokeWorkstationWorkOrderModel
(
http
.
Controller
):
@http.route
(
'/roke/craft_design/index'
,
type
=
'http'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
@http.route
(
'/roke/craft_design/index'
,
type
=
'http'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
...
...
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