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
646009c7
Commit
646009c7
authored
Jan 08, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[add] 增加工单指派工位
parent
290b08ea
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
79 additions
and
5 deletions
+79
-5
sdddl_project/__init__.py
+1
-0
sdddl_project/__manifest__.py
+2
-1
sdddl_project/models/inherit_roke_work_order.py
+16
-0
sdddl_project/views/inherit_roke_production_task.xml
+0
-3
sdddl_project/views/iniherit_work_order_view.xml
+16
-1
sdddl_project/wizard/__init__.py
+1
-0
sdddl_project/wizard/assign_workcenter_wizard.py
+18
-0
sdddl_project/wizard/assign_workcenter_wizard_view.xml
+25
-0
No files found.
sdddl_project/__init__.py
View file @
646009c7
# -*- coding: utf-8 -*-
from
.
import
models
from
.
import
controllers
from
.
import
wizard
sdddl_project/__manifest__.py
View file @
646009c7
...
...
@@ -16,7 +16,8 @@
'views/button_js.xml'
,
'views/iniherit_work_order_view.xml'
,
'views/inherit_roke_product.xml'
,
'views/inherit_roke_routing_line.xml'
'views/inherit_roke_routing_line.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
],
'qweb'
:
[
"static/src/xml/roke_craft_design.xml"
,
...
...
sdddl_project/models/inherit_roke_work_order.py
View file @
646009c7
...
...
@@ -7,6 +7,7 @@ class InheritWorkOrder(models.Model):
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
special_process
=
fields
.
Selection
(
related
=
"routing_line_id.special_process"
)
next_wo_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"下道工单"
,
store
=
True
,
compute
=
"_compute_next_work_order"
)
...
...
@@ -30,3 +31,18 @@ class InheritWorkOrder(models.Model):
v
.
next_wo_id
=
v
.
repair_wr_id
.
work_order_id
.
id
else
:
v
.
next_wo_id
=
next_wo
[
0
]
.
id
def
action_assign_work_center
(
self
):
self
.
ensure_one
()
# 检查是否是特殊工序
# 打开指派向导
return
{
'name'
:
'指派工作中心'
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'assign.work.center.wizard'
,
'view_mode'
:
'form'
,
'target'
:
'new'
,
'context'
:
{
'default_work_order_id'
:
self
.
id
,
}
}
sdddl_project/views/inherit_roke_production_task.xml
View file @
646009c7
...
...
@@ -18,6 +18,3 @@
</field>
</record>
</odoo>
sdddl_project/views/iniherit_work_order_view.xml
View file @
646009c7
...
...
@@ -5,11 +5,26 @@
<field
name=
"model"
>
roke.work.order
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_production.view_roke_work_order_form"
/>
<field
name=
"arch"
type=
"xml"
>
<!-- <xpath expr="//page/group[@name='attachment']" position="before">-->
<xpath
expr=
"//page/group[@name='attachment']"
position=
"after"
>
<field
name=
"task_file_ids"
widget=
"many2many_pic_preview"
/>
</xpath>
</field>
</record>
<record
id=
"inherit_view_roke_work_order_edit_tree"
model=
"ir.ui.view"
>
<field
name=
"name"
>
inherit.roke.work.order.edit_tree.view
</field>
<field
name=
"model"
>
roke.work.order
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_production.view_roke_work_order_edit_tree"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='routing_line_id']"
position=
"after"
>
<field
name=
"special_process"
invisible=
"1"
/>
</xpath>
<xpath
expr=
"//button[@name='multi_create_work_record']"
position=
"after"
>
<button
name=
"action_assign_work_center"
type=
"object"
class=
"oe_highlight oe_read_only"
string=
"指派"
attrs=
"{'invisible': [('special_process', '!=', '是')]}"
/>
</xpath>
</field>
</record>
</odoo>
sdddl_project/wizard/__init__.py
0 → 100644
View file @
646009c7
from
.
import
assign_workcenter_wizard
sdddl_project/wizard/assign_workcenter_wizard.py
0 → 100644
View file @
646009c7
from
odoo
import
models
,
fields
,
api
class
AssignWorkcenterWizard
(
models
.
TransientModel
):
_name
=
'assign.work.center.wizard'
_description
=
'指派工作中心向导'
workshop_id
=
fields
.
Many2one
(
'roke.workshop'
,
string
=
'产线'
)
work_center_id
=
fields
.
Many2one
(
'roke.work.center'
,
string
=
'工位'
)
work_order_id
=
fields
.
Many2one
(
'roke.work.order'
,
string
=
'工单'
)
def
action_confirm
(
self
):
self
.
ensure_one
()
if
self
.
work_order_id
and
self
.
work_center_id
:
self
.
work_order_id
.
write
({
'work_center_id'
:
self
.
work_center_id
.
id
})
return
{
'type'
:
'ir.actions.act_window_close'
}
sdddl_project/wizard/assign_workcenter_wizard_view.xml
0 → 100644
View file @
646009c7
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record
id=
"view_assign_work_center_wizard_form"
model=
"ir.ui.view"
>
<field
name=
"name"
>
assign.work.center.wizard.form
</field>
<field
name=
"model"
>
assign.work.center.wizard
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"指派工作中心"
>
<group>
<group>
<field
name=
"workshop_id"
/>
<field
name=
"work_order_id"
invisible=
"1"
/>
</group>
<group>
<field
name=
"work_center_id"
domain=
"[('workshop_id', '=', workshop_id)]"
/>
</group>
</group>
<footer>
<button
string=
"确认"
name=
"action_confirm"
type=
"object"
class=
"btn-primary"
/>
<button
string=
"取消"
class=
"btn-secondary"
special=
"cancel"
/>
</footer>
</form>
</field>
</record>
</odoo>
\ No newline at end of file
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