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
bd575efa
Commit
bd575efa
authored
Jan 08, 2025
by
liuyongcheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 添加班次默认值
parent
fbbe7417
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
1 deletions
+54
-1
sdddl_project/__manifest__.py
+1
-1
sdddl_project/controllers/roke_work_order.py
+53
-0
No files found.
sdddl_project/__manifest__.py
View file @
bd575efa
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
'version'
:
'14.0'
,
'version'
:
'14.0'
,
'category'
:
'mes'
,
'category'
:
'mes'
,
'depends'
:
[
'roke_mes_purchase'
,
'roke_mes_sale'
,
'roke_mes_documents'
,
'roke_mes_stock'
,
'roke_workstation_api'
,
'depends'
:
[
'roke_mes_purchase'
,
'roke_mes_sale'
,
'roke_mes_documents'
,
'roke_mes_stock'
,
'roke_workstation_api'
,
'roke_mes_workshop_inspect'
,
'roke_mes_quality'
],
'roke_mes_workshop_inspect'
,
'roke_mes_quality'
,
'roke_mes_entrust_order'
],
'author'
:
'www.rokedata.com'
,
'author'
:
'www.rokedata.com'
,
'website'
:
'http://www.rokedata.com'
,
'website'
:
'http://www.rokedata.com'
,
'description'
:
"""
'description'
:
"""
...
...
sdddl_project/controllers/roke_work_order.py
View file @
bd575efa
...
@@ -7,6 +7,7 @@ import pytz
...
@@ -7,6 +7,7 @@ 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
from
odoo.addons.roke_workstation_api.controllers.work_order
import
RokeWorkstationWorkOrder
from
odoo.addons.roke_mes_entrust_order.controller.main
import
Main
_logger
=
logging
.
getLogger
(
__name__
)
_logger
=
logging
.
getLogger
(
__name__
)
...
@@ -16,6 +17,58 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
...
@@ -16,6 +17,58 @@ BASE_DIR = os.path.dirname(os.path.dirname(__file__))
templateloader
=
FileSystemLoader
(
searchpath
=
BASE_DIR
+
"/static"
)
templateloader
=
FileSystemLoader
(
searchpath
=
BASE_DIR
+
"/static"
)
env
=
Environment
(
loader
=
templateloader
)
env
=
Environment
(
loader
=
templateloader
)
class
InheritEntrustOrderMain
(
Main
):
def
_prepare_entrust_send_info_data
(
self
,
line
):
res
=
super
(
InheritEntrustOrderMain
,
self
)
.
_prepare_entrust_send_info_data
(
line
)
previours_work_order
=
line
.
_get_previous_wo
()
plan_qty
=
line
.
plan_qty
-
sum
(
previours_work_order
.
record_ids
.
mapped
(
'unqualified_qty'
))
if
previours_work_order
else
line
.
plan_qty
res
.
update
({
"plan_qty"
:
plan_qty
})
return
res
@http.route
(
'/entrust/send/product'
,
type
=
'json'
,
method
=
[
"POST"
,
"OPTIONS"
],
auth
=
'user'
,
cors
=
'*'
,
csrf
=
False
)
def
entrust_send_product
(
self
):
res
=
super
(
InheritEntrustOrderMain
,
self
)
.
entrust_send_product
()
work_id
=
http
.
request
.
jsonrequest
.
get
(
'work_id'
)
if
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
)
res
.
update
({
"info"
:
product_list
})
return
res
def
_prepare_entrust_send_product_from_process
(
self
,
process
,
work_order
):
"""准备接口/entrust/send/product中的product_list数据"""
product_list
=
[]
for
i
in
process
.
p_bom_ids
:
product_list
.
append
({
"product_id"
:
i
.
product_id
.
id
,
"product_name"
:
i
.
product_id
.
name
,
"qty"
:
i
.
qty
*
work_order
.
plan_qty
,
"note"
:
i
.
note
if
i
.
note
!=
False
else
''
})
return
product_list
def
_prepare_entrust_info_data
(
self
,
entrust_orders
):
info
=
[]
for
i
in
entrust_orders
:
previours_work_order
=
i
.
_get_previous_wo
()
plan_qty
=
i
.
plan_qty
-
sum
(
previours_work_order
.
record_ids
.
mapped
(
'unqualified_qty'
))
if
previours_work_order
else
i
.
plan_qty
info
.
append
({
'work_id'
:
i
.
id
,
'product_id'
:
i
.
product_id
.
id
,
'product'
:
i
.
product_id
.
name
,
'plan_qty'
:
plan_qty
,
'process'
:
i
.
process_id
.
name
,
'entrust_customer'
:
i
.
entrust_customer
.
name
,
'plan_date'
:
i
.
plan_date
,
'entrust_state'
:
i
.
entrust_state
,
'finish_qty'
:
i
.
finish_qty
,
'unqualified_qty'
:
i
.
unqualified_qty
,
'note'
:
i
.
note
if
i
.
note
else
''
})
return
info
class
InheritRokeWorkstationWorkOrder
(
RokeWorkstationWorkOrder
):
class
InheritRokeWorkstationWorkOrder
(
RokeWorkstationWorkOrder
):
@http.route
(
'/roke/workstation/work_order/workstation_work_order'
,
type
=
'json'
,
auth
=
'user'
,
csrf
=
False
,
cors
=
"*"
)
@http.route
(
'/roke/workstation/work_order/workstation_work_order'
,
type
=
'json'
,
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