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
7a97a33e
Commit
7a97a33e
authored
Jan 20, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 新增工序特殊产品计薪批量导入
parent
ce80781f
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
67 additions
and
0 deletions
+67
-0
sdddl_project/__manifest__.py
+2
-0
sdddl_project/models/__init__.py
+1
-0
sdddl_project/models/inherit_roke_process.py
+16
-0
sdddl_project/views/inherit_view_roke_process_form.xml
+15
-0
sdddl_project/wizard/__init__.py
+1
-0
sdddl_project/wizard/product_import_wizard.py
+12
-0
sdddl_project/wizard/product_import_wizard_view.xml
+20
-0
No files found.
sdddl_project/__manifest__.py
View file @
7a97a33e
...
@@ -17,7 +17,9 @@
...
@@ -17,7 +17,9 @@
'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'
,
'views/inherit_roke_routing_line.xml'
,
'views/inherit_view_roke_process_form.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
'wizard/assign_workcenter_wizard_view.xml'
,
'wizard/product_import_wizard_view.xml'
,
],
],
'qweb'
:
[
'qweb'
:
[
"static/src/xml/roke_craft_design.xml"
,
"static/src/xml/roke_craft_design.xml"
,
...
...
sdddl_project/models/__init__.py
View file @
7a97a33e
...
@@ -2,3 +2,4 @@ from . import inherit_roke_work_order
...
@@ -2,3 +2,4 @@ from . import inherit_roke_work_order
from
.
import
inherit_production_task
from
.
import
inherit_production_task
from
.
import
inherit_roke_routing
from
.
import
inherit_roke_routing
from
.
import
inherit_roke_product
from
.
import
inherit_roke_product
from
.
import
inherit_roke_process
sdddl_project/models/inherit_roke_process.py
0 → 100644
View file @
7a97a33e
from
odoo
import
models
,
fields
,
api
class
InheritRokeProcess
(
models
.
Model
):
_inherit
=
'roke.process'
def
action_import_products
(
self
):
# 这里实现批量导入逻辑
# 例如,打开一个向导来选择产品
return
{
'type'
:
'ir.actions.act_window'
,
'name'
:
'批量导入产品'
,
'res_model'
:
'product.import.wizard'
,
'view_mode'
:
'form'
,
'target'
:
'new'
,
}
sdddl_project/views/inherit_view_roke_process_form.xml
0 → 100644
View file @
7a97a33e
<odoo>
<data>
<record
id=
"inherit_view_roke_process_form"
model=
"ir.ui.view"
>
<field
name=
"name"
>
inherit.view.roke.process.form
</field>
<field
name=
"model"
>
roke.process
</field>
<field
name=
"inherit_id"
ref=
"roke_mes_salary.view_roke_salary_inherit_process_form_view"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='product_salary_ids']"
position=
"before"
>
<button
name=
"action_import_products"
type=
"object"
string=
"批量导入"
class=
"oe_highlight"
/>
</xpath>
</field>
</record>
</data>
</odoo>
\ No newline at end of file
sdddl_project/wizard/__init__.py
View file @
7a97a33e
from
.
import
assign_workcenter_wizard
from
.
import
assign_workcenter_wizard
from
.
import
product_import_wizard
sdddl_project/wizard/product_import_wizard.py
0 → 100644
View file @
7a97a33e
from
odoo
import
models
,
fields
,
api
class
ProductImportWizard
(
models
.
TransientModel
):
_name
=
'product.import.wizard'
_description
=
'产品导入向导'
product_ids
=
fields
.
Many2many
(
'roke.product'
,
string
=
'选择产品'
)
def
import_products
(
self
):
active_id
=
self
.
env
.
context
.
get
(
'active_id'
)
process
=
self
.
env
[
'roke.process'
]
.
browse
(
active_id
)
process
.
product_salary_ids
=
[(
0
,
0
,
{
"product_id"
:
v
})
for
v
in
self
.
product_ids
.
ids
]
sdddl_project/wizard/product_import_wizard_view.xml
0 → 100644
View file @
7a97a33e
<odoo>
<data>
<record
id=
"view_product_import_wizard_form"
model=
"ir.ui.view"
>
<field
name=
"name"
>
product.import.wizard.form
</field>
<field
name=
"model"
>
product.import.wizard
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"批量导入产品"
>
<sheet>
<field
name=
"product_ids"
widget=
"many2many_tags"
/>
<footer>
<button
string=
"导入"
type=
"object"
name=
"import_products"
class=
"oe_highlight"
/>
<button
string=
"取消"
class=
"oe_link"
special=
"cancel"
/>
</footer>
</sheet>
</form>
</field>
</record>
</data>
</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