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
1
Merge Requests
1
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
ea82a21b
Commit
ea82a21b
authored
Jan 09, 2025
by
夏超
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/sdddl_project' into sdddl_project
parents
0e44b988
aee1da2b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
21 deletions
+23
-21
sdddl_project/controllers/roke_work_order.py
+23
-21
No files found.
sdddl_project/controllers/roke_work_order.py
View file @
ea82a21b
...
@@ -30,27 +30,29 @@ class InheritEntrustOrderMain(Main):
...
@@ -30,27 +30,29 @@ class InheritEntrustOrderMain(Main):
})
})
return
res
return
res
@http.route
(
'/entrust/send/product'
,
type
=
'json'
,
method
=
[
"POST"
,
"OPTIONS"
],
auth
=
'user'
,
cors
=
'*'
,
csrf
=
False
)
# @http.route('/entrust/send/product', type='json', method=["POST", "OPTIONS"], auth='user', cors='*', csrf=False)
def
entrust_send_product
(
self
):
# def entrust_send_product(self):
res
=
super
(
InheritEntrustOrderMain
,
self
)
.
entrust_send_product
()
# res = super(InheritEntrustOrderMain, self).entrust_send_product()
work_id
=
http
.
request
.
jsonrequest
.
get
(
'work_id'
)
# work_id = http.request.jsonrequest.get('work_id')
if
work_id
:
# if work_id:
work_order
=
http
.
request
.
env
[
'roke.work.order'
]
.
search
([(
'id'
,
'='
,
int
(
work_id
))])
# work_order = http.request.env['roke.work.order'].search([('id', '=', int(work_id))])
product_list
=
self
.
_prepare_entrust_send_product_from_process
(
work_order
.
process_id
,
work_order
)
# default_routing = work_order.product_id.routing_id
res
.
update
({
"info"
:
product_list
})
# bom_line = default_routing.line_ids.filtered(lambda r: r.process_id == work_order.process_id)
return
res
# product_list = self._prepare_entrust_send_product_from_process(bom_line, work_order)
# res.update({"info": product_list})
def
_prepare_entrust_send_product_from_process
(
self
,
process
,
work_order
):
# return res
"""准备接口/entrust/send/product中的product_list数据"""
#
product_list
=
[]
# def _prepare_entrust_send_product_from_process(self, bom_line, work_order):
for
i
in
process
.
p_bom_ids
:
# """准备接口/entrust/send/product中的product_list数据"""
product_list
.
append
({
# product_list = []
"product_id"
:
i
.
product_id
.
id
,
# for i in bom_line.p_bom_ids:
"product_name"
:
i
.
product_id
.
name
,
# product_list.append({
"qty"
:
i
.
qty
*
work_order
.
plan_qty
,
# "product_id": i.product_id.id,
"note"
:
i
.
note
if
i
.
note
!=
False
else
''
# "product_name": i.product_id.name,
})
# "qty": i.qty * work_order.plan_qty,
return
product_list
# "note": i.note if i.note != False else ''
# })
# return product_list
def
_prepare_entrust_info_data
(
self
,
entrust_orders
):
def
_prepare_entrust_info_data
(
self
,
entrust_orders
):
info
=
[]
info
=
[]
...
...
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