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
a1da6b9a
Commit
a1da6b9a
authored
Jan 08, 2025
by
liuyongcheng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sdddl_project' of
http://git.rokedata.com/dws/dwsproject
into sdddl_project
parents
bd575efa
646009c7
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
95 additions
and
5 deletions
+95
-5
sdddl_project/__init__.py
+1
-0
sdddl_project/__manifest__.py
+3
-1
sdddl_project/models/inherit_roke_routing_line.py
+1
-0
sdddl_project/models/inherit_roke_work_order.py
+16
-0
sdddl_project/views/inherit_roke_production_task.xml
+0
-3
sdddl_project/views/inherit_roke_routing_line.xml
+14
-0
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 @
a1da6b9a
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
from
.
import
models
from
.
import
models
from
.
import
controllers
from
.
import
controllers
from
.
import
wizard
sdddl_project/__manifest__.py
View file @
a1da6b9a
...
@@ -15,7 +15,9 @@
...
@@ -15,7 +15,9 @@
'views/inherit_roke_production_task.xml'
,
'views/inherit_roke_production_task.xml'
,
'views/button_js.xml'
,
'views/button_js.xml'
,
'views/iniherit_work_order_view.xml'
,
'views/iniherit_work_order_view.xml'
,
'views/inherit_roke_product.xml'
'views/inherit_roke_product.xml'
,
'views/inherit_roke_routing_line.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
],
],
'qweb'
:
[
'qweb'
:
[
"static/src/xml/roke_craft_design.xml"
,
"static/src/xml/roke_craft_design.xml"
,
...
...
sdddl_project/models/inherit_roke_routing_line.py
View file @
a1da6b9a
...
@@ -5,6 +5,7 @@ class InheritRokeRoutingLine(models.Model):
...
@@ -5,6 +5,7 @@ class InheritRokeRoutingLine(models.Model):
_inherit
=
"roke.routing.line"
_inherit
=
"roke.routing.line"
rated_working_hours
=
fields
.
Float
(
string
=
'标准工时'
,
help
=
'工序的标准工时(小时)'
)
rated_working_hours
=
fields
.
Float
(
string
=
'标准工时'
,
help
=
'工序的标准工时(小时)'
)
special_process
=
fields
.
Selection
([(
'是'
,
'是'
),
(
'否'
,
'否'
)],
string
=
"特殊工序"
,
default
=
'否'
)
class
InheritRokeProcess
(
models
.
Model
):
class
InheritRokeProcess
(
models
.
Model
):
...
...
sdddl_project/models/inherit_roke_work_order.py
View file @
a1da6b9a
...
@@ -7,6 +7,7 @@ class InheritWorkOrder(models.Model):
...
@@ -7,6 +7,7 @@ class InheritWorkOrder(models.Model):
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
document_ids
=
fields
.
Many2many
(
related
=
"task_id.document_ids"
,
string
=
"作业指导"
)
task_file_ids
=
fields
.
Many2many
(
related
=
"task_id.file_ids"
)
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"
)
next_wo_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"下道工单"
,
store
=
True
,
compute
=
"_compute_next_work_order"
)
...
@@ -30,3 +31,18 @@ class InheritWorkOrder(models.Model):
...
@@ -30,3 +31,18 @@ class InheritWorkOrder(models.Model):
v
.
next_wo_id
=
v
.
repair_wr_id
.
work_order_id
.
id
v
.
next_wo_id
=
v
.
repair_wr_id
.
work_order_id
.
id
else
:
else
:
v
.
next_wo_id
=
next_wo
[
0
]
.
id
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 @
a1da6b9a
...
@@ -18,6 +18,3 @@
...
@@ -18,6 +18,3 @@
</field>
</field>
</record>
</record>
</odoo>
</odoo>
sdddl_project/views/inherit_roke_routing_line.xml
0 → 100644
View file @
a1da6b9a
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record
id=
"view_roke_routing_line_tree_inherit"
model=
"ir.ui.view"
>
<field
name=
"name"
>
roke.routing.line.tree.inherit
</field>
<field
name=
"model"
>
roke.routing.line
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_base.view_roke_routing_line_editable_tree"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='process_id']"
position=
"after"
>
<field
name=
"special_process"
required=
"1"
/>
</xpath>
</field>
</record>
</odoo>
\ No newline at end of file
sdddl_project/views/iniherit_work_order_view.xml
View file @
a1da6b9a
...
@@ -5,11 +5,26 @@
...
@@ -5,11 +5,26 @@
<field
name=
"model"
>
roke.work.order
</field>
<field
name=
"model"
>
roke.work.order
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_production.view_roke_work_order_form"
/>
<field
name=
"inherit_id"
ref=
"roke_mes_production.view_roke_work_order_form"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"arch"
type=
"xml"
>
<!-- <xpath expr="//page/group[@name='attachment']" position="before">-->
<xpath
expr=
"//page/group[@name='attachment']"
position=
"after"
>
<xpath
expr=
"//page/group[@name='attachment']"
position=
"after"
>
<field
name=
"task_file_ids"
widget=
"many2many_pic_preview"
/>
<field
name=
"task_file_ids"
widget=
"many2many_pic_preview"
/>
</xpath>
</xpath>
</field>
</field>
</record>
</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>
</odoo>
sdddl_project/wizard/__init__.py
0 → 100644
View file @
a1da6b9a
from
.
import
assign_workcenter_wizard
sdddl_project/wizard/assign_workcenter_wizard.py
0 → 100644
View file @
a1da6b9a
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 @
a1da6b9a
<?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