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
fa35b8bb
Commit
fa35b8bb
authored
Nov 13, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 返修单生产工单产品问题
parent
c4f7b918
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
6 deletions
+15
-6
jzjx_project/controllers/inherit_product_task.py
+4
-4
jzjx_project/controllers/inherit_production.py
+9
-0
jzjx_project/wizard/inherit_roke_create_work_record_wizard.py
+2
-2
No files found.
jzjx_project/controllers/inherit_product_task.py
View file @
fa35b8bb
...
...
@@ -42,11 +42,11 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
sql
=
f
"""
SELECT id, type, create_date
FROM (
SELECT roke_production_task.id, 'task' as "type", roke_production_task.create_date
{f'''
SELECT roke_production_task.id, 'task' as "type", roke_production_task.create_date
FROM roke_production_task LEFT JOIN roke_work_order on roke_work_order.task_id = roke_production_task.id
WHERE roke_work_order.id in ({" , ".join([f"{v}" for v in work_order.ids])})
and roke_production_task.state in ('未完工', '暂停')
union all
union all
''' if work_order.ids else ""}
SELECT id, 'work' as "type", create_date
FROM roke_work_order
WHERE type = '返修'
...
...
@@ -63,11 +63,11 @@ class JzjxInheritRokeWorkstationProductionTask(RokeWorkstationProductionTask):
count_sql
=
f
"""
SELECT count(id)
FROM (
SELECT roke_production_task.id
{f'''SELECT roke_production_task.id, 'task' as "type", roke_production_task.create_date
FROM roke_production_task LEFT JOIN roke_work_order on roke_work_order.task_id = roke_production_task.id
WHERE roke_work_order.id in ({" , ".join([f"{v}" for v in work_order.ids])})
and roke_production_task.state in ('未完工', '暂停')
union all
union all
''' if work_order.ids else ""}
SELECT id
FROM roke_work_order
WHERE type = '返修'
...
...
jzjx_project/controllers/inherit_production.py
View file @
fa35b8bb
...
...
@@ -24,3 +24,12 @@ class JzjxInheritProduction(InheritProduction):
if
repair_process_id
:
res
.
update
({
"repair_process_id"
:
repair_process_id
})
return
res
class
JzjxRokeRefixAutoWorkOrder
(
http
.
Controller
):
@http.route
(
'/roke/config/get_refix_auto_work_order'
,
type
=
'json'
,
auth
=
'none'
,
csrf
=
False
,
cors
=
"*"
)
def
get_refix_auto_work_order
(
self
):
_self
=
http
.
request
refix_params
=
_self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
"refix_auto_work_order"
)
return
{
"code"
:
0
,
"message"
:
"成功!"
,
"state"
:
refix_params
==
"True"
or
refix_params
is
True
}
jzjx_project/wizard/inherit_roke_create_work_record_wizard.py
View file @
fa35b8bb
...
...
@@ -26,8 +26,8 @@ class InheritRokeCreateWorkRecordWizard(models.TransientModel):
"product_id"
:
new_record
.
work_order_id
.
product_id
.
id
,
"plan_qty"
:
v
.
qty
,
"sequence"
:
1
,
"planned_start_time"
:
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d
%
H:
%
M:
%
S'
)
,
"plan_date"
:
datetime
.
datetime
.
now
()
.
strftime
(
'
%
Y-
%
m-
%
d'
)
+
" 23:59:59"
,
"planned_start_time"
:
new_record
.
work_order_id
.
planned_start_time
,
"plan_date"
:
new_record
.
work_order_id
.
plan_date
,
"repair_task_id"
:
new_record
.
pt_id
.
id
or
repair
.
wo_id
.
repair_task_id
.
id
,
"type"
:
"返修"
})
...
...
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