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
f4b7f800
Commit
f4b7f800
authored
Apr 11, 2025
by
赵言乐
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
委外发料问题处理
parent
30835ea0
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
57 additions
and
3 deletions
+57
-3
sdddl_project/__manifest__.py
+1
-0
sdddl_project/models/inherit_roke_product.py
+2
-0
sdddl_project/models/roke_entrust_issue_record.py
+3
-0
sdddl_project/views/inherit_roke_product.xml
+6
-0
sdddl_project/views/roke_entrust_issue_record_view.xml
+2
-0
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
+8
-2
sdddl_project/wizard/inherit_transportation_product_info_wizard.py
+19
-1
sdddl_project/wizard/inherit_transportation_product_info_wizard_views.xml
+16
-0
No files found.
sdddl_project/__manifest__.py
View file @
f4b7f800
...
...
@@ -22,6 +22,7 @@
'views/roke_entrust_issue_record_view.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
'wizard/product_import_wizard_view.xml'
,
'wizard/inherit_transportation_product_info_wizard_views.xml'
],
'qweb'
:
[
"static/src/xml/roke_craft_design.xml"
,
...
...
sdddl_project/models/inherit_roke_product.py
View file @
f4b7f800
...
...
@@ -9,6 +9,8 @@ class InheritProductionTask(models.Model):
standard_hours
=
fields
.
Float
(
string
=
'标准工时'
,
help
=
'产品的标准工时(小时)'
)
mnemonic_aid_code
=
fields
.
Char
(
string
=
"助记码"
)
material
=
fields
.
Char
(
string
=
"材质"
)
hardness_requirements
=
fields
.
Char
(
string
=
"硬度要求"
)
@api.model
def
_name_search
(
self
,
name
,
args
=
None
,
operator
=
'ilike'
,
limit
=
100
,
name_get_uid
=
None
):
...
...
sdddl_project/models/roke_entrust_issue_record.py
View file @
f4b7f800
...
...
@@ -19,3 +19,6 @@ class InheritRokeSendMaterialRecordModel(models.Model):
process_id
=
fields
.
Many2one
(
related
=
"material_id.process_id"
,
string
=
"工序"
,
store
=
True
)
entrust_customer
=
fields
.
Many2one
(
related
=
"material_id.entrust_customer"
,
string
=
"委外客户"
,
store
=
True
)
material
=
fields
.
Char
(
related
=
"product_id.material"
,
string
=
"材质"
,
store
=
True
)
hardness_requirements
=
fields
.
Char
(
related
=
"product_id.hardness_requirements"
,
string
=
"硬度要求"
,
store
=
True
)
sdddl_project/views/inherit_roke_product.xml
View file @
f4b7f800
...
...
@@ -6,6 +6,12 @@
<field
name=
"model"
>
roke.product
</field>
<field
name=
"inherit_id"
ref=
"roke_workstation_api.capacity_inherit_view_roke_product_form"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='gross_profit_rate']"
position=
"after"
>
<field
name=
"material"
/>
</xpath>
<xpath
expr=
"//field[@name='uom_id']"
position=
"after"
>
<field
name=
"hardness_requirements"
/>
</xpath>
<xpath
expr=
"//field[@name='capacity']"
position=
"after"
>
<field
name=
"standard_hours"
/>
</xpath>
...
...
sdddl_project/views/roke_entrust_issue_record_view.xml
View file @
f4b7f800
...
...
@@ -49,6 +49,8 @@
<field
name=
"finish_qty"
invisible=
"1"
/>
<field
name=
"employed"
/>
<field
name=
"note"
/>
<field
name=
"material"
/>
<field
name=
"hardness_requirements"
/>
</tree>
</field>
</page>
...
...
sdddl_project/wizard/inherit_result_put_warehose_wizard.py
View file @
f4b7f800
...
...
@@ -18,6 +18,12 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
return
super
(
InheritRokeResultPutWarehouseWizard
,
self
)
.
default_get
(
field_names
)
_logger
.
info
(
f
"数据: {self.env.context.get('active_ids')}: {self.env._context.get('active_ids')}"
)
results
=
self
.
env
[
'roke.production.result'
]
.
browse
(
self
.
env
.
_context
.
get
(
'active_ids'
))
new_results
=
[]
# 增加过滤
for
result
in
results
:
if
result
.
pt_id
.
task_type
==
"main"
:
continue
new_results
.
append
(
result
)
self
.
env
.
_context
=
None
system_id
=
self
.
env
.
ref
(
"roke_workstation_sync_ps.roke_workstation_sync_ps_integrate_system"
)
sync_address
=
system_id
.
sync_address
...
...
@@ -31,7 +37,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
except
Exception
as
e
:
_logger
.
info
(
"数据库链接失败,请检查数据库链接参数"
)
raise
ValidationError
(
"数据库链接失败,请检查数据库链接参数"
)
ids_str
=
[
f
"'{v.id}'"
for
v
in
results
]
ids_str
=
[
f
"'{v.id}'"
for
v
in
new_
results
]
if
not
ids_str
:
_logger
.
info
(
"数据不需要同步"
)
return
super
(
InheritRokeResultPutWarehouseWizard
,
self
)
.
default_get
(
field_names
)
...
...
@@ -60,7 +66,7 @@ class InheritRokeResultPutWarehouseWizard(models.TransientModel):
em
=
self
.
env
[
"roke.employee"
]
.
search
([(
"user_id"
,
"="
,
self
.
env
.
uid
)],
limit
=
1
)
insert_sql_data
=
[]
_uuid
=
uuid
.
uuid1
()
for
v
in
results
:
for
v
in
new_
results
:
if
v
.
id
in
insert_id
:
continue
insert_sql_data
.
append
(
f
"""
...
...
sdddl_project/wizard/inherit_transportation_product_info_wizard.py
View file @
f4b7f800
...
...
@@ -58,4 +58,21 @@ class InheritTransportationProductInfoWizard(models.TransientModel):
'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
)]})
record
=
self
.
env
[
"roke.entrust.issue.record"
]
.
sudo
()
.
create
({
"material_ids"
:
[(
6
,
0
,
material_ids
)]})
return
{
'name'
:
"委外发料记录"
,
'type'
:
'ir.actions.act_window'
,
'res_model'
:
'roke.entrust.issue.record'
,
'view_mode'
:
'tree'
,
'target'
:
'current'
,
'context'
:
{},
'domain'
:
[(
'id'
,
'in'
,
record
.
id
)]
}
class
InheritStockMoveInfoLine
(
models
.
TransientModel
):
_inherit
=
"stock.move.info.line"
material
=
fields
.
Char
(
related
=
"product_id.material"
,
string
=
"材质"
,
store
=
True
)
hardness_requirements
=
fields
.
Char
(
related
=
"product_id.hardness_requirements"
,
string
=
"硬度要求"
,
store
=
True
)
\ No newline at end of file
sdddl_project/wizard/inherit_transportation_product_info_wizard_views.xml
0 → 100644
View file @
f4b7f800
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record
id=
"view_transportation_product_info_wizard_form"
model=
"ir.ui.view"
>
<field
name=
"name"
>
view.transportation.product.info.wizard.form
</field>
<field
name=
"model"
>
transportation.product.info.wizard
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_entrust_order.transportation_product_info_wizard_form"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//notebook//page//field[@name='move_line_ids']//tree//field[@name='origin_work_id']"
position=
"after"
>
<field
name=
"material"
/>
<field
name=
"hardness_requirements"
/>
</xpath>
</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