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
0bbda3f9
Commit
0bbda3f9
authored
Mar 18, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 东联委外记录功能记录
parent
9a7897b0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
167 additions
and
4 deletions
+167
-4
sdddl_project/__manifest__.py
+2
-0
sdddl_project/datas/sequence_data.xml
+13
-0
sdddl_project/models/__init__.py
+1
-0
sdddl_project/models/inherit_roke_work_order.py
+5
-2
sdddl_project/models/roke_entrust_issue_record.py
+13
-0
sdddl_project/security/ir.model.access.csv
+2
-2
sdddl_project/views/roke_entrust_issue_record_view.xml
+69
-0
sdddl_project/wizard/__init__.py
+1
-0
sdddl_project/wizard/inherit_transportation_product_info_wizard.py
+61
-0
No files found.
sdddl_project/__manifest__.py
View file @
0bbda3f9
...
...
@@ -12,12 +12,14 @@
"""
,
'data'
:
[
'security/ir.model.access.csv'
,
'datas/sequence_data.xml'
,
'views/inherit_roke_production_task.xml'
,
'views/button_js.xml'
,
'views/iniherit_work_order_view.xml'
,
'views/inherit_roke_product.xml'
,
'views/inherit_roke_routing_line.xml'
,
'views/inherit_view_roke_process_form.xml'
,
'views/roke_entrust_issue_record_view.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
'wizard/product_import_wizard_view.xml'
,
],
...
...
sdddl_project/datas/sequence_data.xml
0 → 100644
View file @
0bbda3f9
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data
noupdate=
"1"
>
<record
id=
"roek_entrust_issue_record_code_sequence"
model=
"ir.sequence"
>
<field
name=
"name"
>
委外发料记录编号
</field>
<field
name=
"code"
>
roke.entrust.issue.record.code
</field>
<field
name=
"prefix"
>
EI%(y)s%(month)s%(day)s
</field>
<field
eval=
"True"
name=
"use_date_range"
/>
<field
name=
"padding"
>
3
</field>
<field
name=
"company_id"
eval=
"False"
/>
</record>
</data>
</odoo>
sdddl_project/models/__init__.py
View file @
0bbda3f9
...
...
@@ -4,3 +4,4 @@ from . import inherit_roke_routing
from
.
import
inherit_roke_product
from
.
import
inherit_roke_process
from
.
import
inherit_roke_pub_interate_model
from
.
import
roke_entrust_issue_record
sdddl_project/models/inherit_roke_work_order.py
View file @
0bbda3f9
...
...
@@ -90,8 +90,11 @@ class InheritWorkOrder(models.Model):
raise
UserError
(
'请前往仓库管理->作业类型,配置标识为 WW/OUT/ 的出库类型的委外出库!'
)
# 数据创建展示
for
record
in
self
:
for
bom
in
record
.
routing_line_id
.
p_bom_ids
:
product_list
.
append
((
0
,
0
,
self
.
_get_bom_transportation_line_vals
(
record
,
bom
)))
if
record
.
routing_line_id
.
p_bom_ids
:
for
bom
in
record
.
routing_line_id
.
p_bom_ids
:
product_list
.
append
((
0
,
0
,
self
.
_get_bom_transportation_line_vals
(
record
,
bom
)))
else
:
product_list
.
append
((
0
,
0
,
self
.
_get_transportation_line_vals
(
record
)))
res
=
self
.
env
[
"transportation.product.info.wizard"
]
.
create
({
"picking_type_id"
:
type_id
.
id
,
"src_location_id"
:
type_id
.
src_location_id
.
id
,
...
...
sdddl_project/models/roke_entrust_issue_record.py
0 → 100644
View file @
0bbda3f9
from
odoo
import
models
,
fields
,
api
,
_
class
RokeEntrustIssueRecordModel
(
models
.
Model
):
_name
=
"roke.entrust.issue.record"
_description
=
"委外发料记录"
_rec_name
=
"code"
code
=
fields
.
Char
(
string
=
"编号"
,
default
=
lambda
self
:
self
.
env
[
'ir.sequence'
]
.
next_by_code
(
'roke.entrust.issue.record.code'
))
material_ids
=
fields
.
Many2many
(
"roke.send.material.record"
,
string
=
"委外发料记录"
)
sdddl_project/security/ir.model.access.csv
View file @
0bbda3f9
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
,,,,,,,
\ No newline at end of file
roke.entrust.issue.record,roke.entrust.issue.record,model_roke_entrust_issue_record,base.group_system,1,1,1,1
\ No newline at end of file
sdddl_project/views/roke_entrust_issue_record_view.xml
0 → 100644
View file @
0bbda3f9
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record
id=
"roke_entrust_issue_record_tree"
model=
"ir.ui.view"
>
<field
name=
"name"
>
roke.entrust.issue.record.tree.view
</field>
<field
name=
"model"
>
roke.entrust.issue.record
</field>
<field
name=
"arch"
type=
"xml"
>
<tree
string=
"委外发料记录"
create=
"0"
edit=
"0"
duplicate=
"0"
>
<field
name=
"code"
/>
<field
name=
"material_ids"
widget=
"many2many_tags"
/>
<field
name=
"create_uid"
string=
"创建人"
/>
<field
name=
"create_date"
string=
"创建时间"
/>
</tree>
</field>
</record>
<record
id=
"roke_entrust_issue_record_form"
model=
"ir.ui.view"
>
<field
name=
"name"
>
roke.entrust.issue.record.form.view
</field>
<field
name=
"model"
>
roke.entrust.issue.record
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"委外发料记录"
create=
"0"
edit=
"0"
duplicate=
"0"
>
<group>
<group>
<group>
<field
name=
"code"
/>
</group>
<group>
<field
name=
"create_uid"
string=
"创建人"
/>
</group>
</group>
<group>
<group>
<field
name=
"create_date"
string=
"创建时间"
/>
</group>
<group>
</group>
</group>
</group>
<notebook>
<page
string=
"发料明细"
>
<field
name=
"material_ids"
options=
"{'no_create': True}"
>
<tree>
<field
name=
"product_id"
/>
<field
name=
"qty"
/>
<field
name=
"consume_qty"
/>
<field
name=
"surplus_qty"
/>
<field
name=
"finish_qty"
/>
<field
name=
"employed"
/>
<field
name=
"note"
/>
</tree>
</field>
</page>
</notebook>
</form>
</field>
</record>
<record
id=
"roke_entrust_issue_record_action"
model=
"ir.actions.act_window"
>
<field
name=
"name"
>
委外发料记录
</field>
<field
name=
"res_model"
>
roke.entrust.issue.record
</field>
<field
name=
"view_mode"
>
tree,form
</field>
<field
name=
"type"
>
ir.actions.act_window
</field>
</record>
<menuitem
id=
"roke_entrust_issue_record_menu"
name=
"委外发料记录"
sequence=
"91"
parent=
"roke_mes_production.roke_production_report_menu"
action=
"roke_entrust_issue_record_action"
groups=
"base.group_system"
/>
</odoo>
\ No newline at end of file
sdddl_project/wizard/__init__.py
View file @
0bbda3f9
...
...
@@ -2,3 +2,4 @@ from . import assign_workcenter_wizard
from
.
import
product_import_wizard
from
.
import
inherit_roke_bom_create_picking_wizard
from
.
import
inherit_result_put_warehose_wizard
from
.
import
inherit_transportation_product_info_wizard
sdddl_project/wizard/inherit_transportation_product_info_wizard.py
0 → 100644
View file @
0bbda3f9
from
odoo
import
models
,
fields
,
api
,
_
from
datetime
import
datetime
from
odoo.exceptions
import
UserError
class
InheritTransportationProductInfoWizard
(
models
.
TransientModel
):
_inherit
=
"transportation.product.info.wizard"
def
confirm
(
self
):
# 是否生成委外调拨单
if
not
self
.
move_line_ids
:
raise
UserError
(
'发料明细为空!'
)
setting
=
self
.
env
[
'ir.config_parameter'
]
.
sudo
()
.
get_param
(
'entrust.stock.type'
,
default
=
'禁止'
)
material_ids
=
[]
if
setting
==
'允许'
:
for
entrust_id
in
self
.
entrust_ids
:
move_ids
=
self
.
move_line_ids
.
filtered
(
lambda
v
:
v
.
origin_work_id
.
id
==
entrust_id
.
id
and
v
.
qty
>
0
)
move_list
=
[]
for
move
in
move_ids
:
# 取出明细
move_list
.
append
((
0
,
0
,
self
.
_get_move_list_vals
(
move
)))
data
=
{
'state'
:
self
.
state
,
'picking_type_id'
:
self
.
picking_type_id
.
id
,
'type'
:
self
.
type
,
'partner_id'
:
move_ids
[
0
]
.
partner_id
.
id
if
move_ids
else
False
,
'src_location_id'
:
self
.
src_location_id
.
id
,
'dest_location_id'
:
self
.
dest_location_id
.
id
,
'picking_date'
:
self
.
picking_date
,
'origin'
:
entrust_id
.
code
,
'employee_id'
:
self
.
employee_id
.
id
,
'note'
:
self
.
note
,
'move_line_ids'
:
move_list
}
# 创建调拨单
picking
=
self
.
env
[
"roke.mes.stock.picking"
]
.
create
(
data
)
entrust_id
.
write
({
'entrust_state'
:
'已发料'
,
'wo_start_state'
:
'已开工'
,
'material_ids'
:
move_list
,
'send_entrust_date'
:
datetime
.
utcnow
(),
'entrust_id'
:
picking
.
id
,
'picking_count'
:
entrust_id
.
picking_count
+
1
})
material_ids
+=
entrust_id
.
material_ids
.
ids
else
:
for
entrust_id
in
self
.
entrust_ids
:
move_ids
=
self
.
move_line_ids
.
filtered
(
lambda
v
:
v
.
origin_work_id
.
id
==
entrust_id
.
id
and
v
.
qty
>
0
)
move_list
=
[]
for
move
in
move_ids
:
# 取出明细
move_list
.
append
((
0
,
0
,
self
.
_get_move_list_vals
(
move
)))
# 写入工单发料记录
entrust_id
.
write
({
'entrust_state'
:
'已发料'
,
'wo_start_state'
:
'已开工'
,
'material_ids'
:
move_list
,
'send_entrust_date'
:
datetime
.
utcnow
()
})
material_ids
+=
entrust_id
.
material_ids
.
ids
self
.
env
[
"roke.entrust.issue.record"
]
.
sudo
()
.
create
({
"material_ids"
:
[(
6
,
0
,
material_ids
)]})
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