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
86b27971
Commit
86b27971
authored
Nov 22, 2024
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 修改问题
parent
7dac4689
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
2 deletions
+23
-2
jzjx_project/models/inheirt_roke_repair_order.py
+3
-1
jzjx_project/models/inherit_roke_scrap_order.py
+1
-1
jzjx_project/models/inherit_roke_work_order.py
+19
-0
No files found.
jzjx_project/models/inheirt_roke_repair_order.py
View file @
86b27971
...
@@ -13,5 +13,7 @@ class JzjxInheritRepairOrder(models.Model):
...
@@ -13,5 +13,7 @@ class JzjxInheritRepairOrder(models.Model):
class
JzjxInheritRepairOrderLine
(
models
.
Model
):
class
JzjxInheritRepairOrderLine
(
models
.
Model
):
_inherit
=
"roke.repair.order.line"
_inherit
=
"roke.repair.order.line"
repair_work_order_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"返修工单"
)
repair_work_order_id
=
fields
.
Many2one
(
"roke.work.order"
,
string
=
"返修工单"
,
ondelete
=
'cascade'
)
is_refix_auto_work_order
=
fields
.
Boolean
(
string
=
"是否自动生产返修单"
)
is_refix_auto_work_order
=
fields
.
Boolean
(
string
=
"是否自动生产返修单"
)
reason_id
=
fields
.
Many2one
(
"roke.scrap.reason"
,
string
=
"报废原因"
,
ondelete
=
'restrict'
)
jzjx_project/models/inherit_roke_scrap_order.py
View file @
86b27971
...
@@ -13,5 +13,5 @@ class JzjxInheritScrapOrder(models.Model):
...
@@ -13,5 +13,5 @@ class JzjxInheritScrapOrder(models.Model):
class
JzjxInheritScrapOrderLine
(
models
.
Model
):
class
JzjxInheritScrapOrderLine
(
models
.
Model
):
_inherit
=
"roke.scrap.order.line"
_inherit
=
"roke.scrap.order.line"
scrap_work_order_ids
=
fields
.
Many2many
(
"roke.work.order"
,
string
=
"
返修工单"
)
scrap_work_order_ids
=
fields
.
Many2many
(
"roke.work.order"
,
string
=
"
补件工单"
,
ondelete
=
'cascade'
)
is_rfe
=
fields
.
Boolean
(
string
=
"是否工单补件"
)
is_rfe
=
fields
.
Boolean
(
string
=
"是否工单补件"
)
jzjx_project/models/inherit_roke_work_order.py
View file @
86b27971
from
odoo
import
models
,
fields
,
api
,
_
from
odoo
import
models
,
fields
,
api
,
_
from
odoo.exceptions
import
ValidationError
class
InheritWorkOrder
(
models
.
Model
):
class
InheritWorkOrder
(
models
.
Model
):
...
@@ -88,3 +89,21 @@ class InheritWorkOrder(models.Model):
...
@@ -88,3 +89,21 @@ class InheritWorkOrder(models.Model):
else
:
else
:
previous_multiple
=
previous
.
routing_line_id
.
multiple
previous_multiple
=
previous
.
routing_line_id
.
multiple
return
(
multiple
/
previous_multiple
)
if
previous_multiple
else
0
return
(
multiple
/
previous_multiple
)
if
previous_multiple
else
0
class
InheritRokeWorkRecordModel
(
models
.
Model
):
_inherit
=
"roke.work.record"
def
withdraw
(
self
):
"""
撤回报工
:return:
"""
for
v
in
self
:
for
repair
in
v
.
repair_line_ids
:
if
repair
.
repair_work_order_id
.
record_ids
:
raise
ValidationError
(
"返修明细中的返修工单已报工,无法撤销报工!"
)
for
scrap
in
v
.
scrap_line_ids
:
if
scrap
.
scrap_work_order_ids
.
record_ids
:
raise
ValidationError
(
"返修明细中的返修工单已报工,无法撤销报工!"
)
super
(
InheritRokeWorkRecordModel
,
self
)
.
withdraw
()
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