Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
rex wu
odoo
Commits
4890b850
Commit
4890b850
authored
1 year ago
by
rex wu
Browse files
Options
Download
Plain Diff
Merge branch '15.0' into 'deploy'
15.0 See merge request
!25
parents
98f8b3cb
4245f833
15.0
deploy
feat-bom2topurchase
feat-cost_chart
feat-requisition
fix-quotation_xlsx_field
project
revert-b4974a92
2 merge requests
!39
feat(deploy): remove all files that are not needed in the deployment stage and...
,
!25
15.0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
extra-addons/kci-mrp/models/product.py
+19
-18
extra-addons/kci-mrp/models/product.py
extra-addons/kci-mrp/views/mrp_product_views.xml
+1
-1
extra-addons/kci-mrp/views/mrp_product_views.xml
extra-addons/kci-mrp/views/mrp_views_menu.xml
+46
-5
extra-addons/kci-mrp/views/mrp_views_menu.xml
extra-addons/kci-purchase/models/internal_purchase.py
+3
-0
extra-addons/kci-purchase/models/internal_purchase.py
with
69 additions
and
24 deletions
+69
-24
extra-addons/kci-mrp/models/product.py
+
19
-
18
View file @
4890b850
...
...
@@ -7,31 +7,32 @@ class Product(models.Model):
_inherit
=
"product.product"
product_type
=
fields
.
Selection
([
(
'project'
,
'
Project
'
),
(
'component'
,
'
Component
'
)],
default
=
'component'
)
(
'project'
,
'
專案
'
),
(
'component'
,
'
物料
'
)],
default
=
'component'
,
string
=
'產品類型'
)
component_type
=
fields
.
Selection
([
(
'none'
,
'
None
'
),
(
'product'
,
'
Product
'
),
(
'processed'
,
'
Processed Part
'
),
(
'3d'
,
'3D
Printing
'
),
(
'consumable'
,
'
Consumable
'
),
(
'cb'
,
'
Control Box
'
),
(
'ec'
,
'
Electric Component
'
)],
default
=
lambda
self
:
'product'
if
self
.
product_type
==
'component'
else
'none'
)
(
'none'
,
'
未選擇
'
),
(
'product'
,
'
成品
'
),
(
'processed'
,
'
加工件
'
),
(
'3d'
,
'3D
列印件
'
),
(
'consumable'
,
'
消耗品
'
),
(
'cb'
,
'
電控箱
'
),
(
'ec'
,
'
電子材料
'
)],
default
=
lambda
self
:
'product'
if
self
.
product_type
==
'component'
else
'none'
,
string
=
'物料類型'
)
class
ProductTemplate
(
models
.
Model
):
_inherit
=
"product.template"
product_type
=
fields
.
Selection
([
(
'project'
,
'
Project
'
),
(
'component'
,
'
Component
'
)],
default
=
'component'
)
(
'project'
,
'
專案
'
),
(
'component'
,
'
物料
'
)],
default
=
'component'
,
string
=
'產品類型'
)
component_type
=
fields
.
Selection
([
(
'none'
,
'None'
),
(
'product'
,
'Product'
),
(
'processed'
,
'Processed Part'
),
(
'3d'
,
'3D Printing'
),
(
'consumable'
,
'Consumable'
),
(
'cb'
,
'Control Box'
),
(
'ec'
,
'Electric Component'
)],
default
=
lambda
self
:
'product'
if
self
.
product_type
==
'component'
else
'none'
)
(
'none'
,
'未選擇'
),
(
'product'
,
'成品'
),
(
'processed'
,
'加工件'
),
(
'3d'
,
'3D 列印件'
),
(
'consumable'
,
'消耗品'
),
(
'cb'
,
'電控箱'
),
(
'ec'
,
'電子材料'
)],
default
=
lambda
self
:
'product'
if
self
.
product_type
==
'component'
else
'none'
,
string
=
'物料類型'
)
This diff is collapsed.
Click to expand it.
extra-addons/kci-mrp/views/mrp_product_views.xml
+
1
-
1
View file @
4890b850
...
...
@@ -6,7 +6,7 @@
<field
name=
"inherit_id"
ref=
"product.product_template_form_view"
/>
<field
name=
"arch"
type=
"xml"
>
<xpath
expr=
"//field[@name='detailed_type']"
position=
"before"
>
<field
name=
"product_type"
/>
<field
name=
"product_type"
readonly=
"1"
/>
<field
name=
"component_type"
/>
</xpath>
</field>
...
...
This diff is collapsed.
Click to expand it.
extra-addons/kci-mrp/views/mrp_views_menu.xml
+
46
-
5
View file @
4890b850
...
...
@@ -23,11 +23,52 @@
<field
name=
"groups_id"
eval=
"[(6,0,[ref('make_invisible')])]"
/>
</record>
<menuitem
action=
"mrp.product_template_action"
id=
"root_menu_mrp_product_form"
name=
"產品"
parent=
"mrp.menu_mrp_root"
sequence=
"13"
/>
<record
id=
"project_template_action"
model=
"ir.actions.act_window"
>
<field
name=
"name"
>
專案
</field>
<field
name=
"res_model"
>
product.template
</field>
<field
name=
"search_view_id"
ref=
"mrp.mrp_product_template_search_view"
/>
<field
name=
"view_mode"
>
kanban,tree,form
</field>
<field
name=
"context"
>
{"search_default_consumable": 1, 'default_detailed_type': 'product'}
</field>
<field
name=
"domain"
>
[('product_type', '=', 'project')]
</field>
<field
name=
"help"
type=
"html"
>
<p
class=
"o_view_nocontent_smiling_face"
>
No product found. Let's create one!
</p><p>
Define the components and finished products you wish to use in
bill of materials and manufacturing orders.
</p>
</field>
</record>
<menuitem
action=
"project_template_action"
id=
"root_menu_mrp_project_form"
name=
"專案"
parent=
"mrp.menu_mrp_bom"
sequence=
"1"
/>
<record
id=
"component_template_action"
model=
"ir.actions.act_window"
>
<field
name=
"name"
>
物料
</field>
<field
name=
"res_model"
>
product.template
</field>
<field
name=
"search_view_id"
ref=
"mrp.mrp_product_template_search_view"
/>
<field
name=
"view_mode"
>
kanban,tree,form
</field>
<field
name=
"context"
>
{"search_default_consumable": 1, 'default_detailed_type': 'product'}
</field>
<field
name=
"domain"
>
[('product_type', '=', 'component')]
</field>
<field
name=
"help"
type=
"html"
>
<p
class=
"o_view_nocontent_smiling_face"
>
No product found. Let's create one!
</p><p>
Define the components and finished products you wish to use in
bill of materials and manufacturing orders.
</p>
</field>
</record>
<menuitem
action=
"component_template_action"
id=
"root_menu_mrp_component_form"
name=
"物料"
parent=
"mrp.menu_mrp_bom"
sequence=
"2"
/>
<!-- <menuitem id="root_menu_mrp_bom_form_action"-->
<!-- action="mrp.mrp_bom_form_action"-->
...
...
This diff is collapsed.
Click to expand it.
extra-addons/kci-purchase/models/internal_purchase.py
+
3
-
0
View file @
4890b850
...
...
@@ -23,6 +23,9 @@ class InternalPurchaseOrder(models.Model):
This function create a bom-1 for estimate a case.
'''
product
=
self
.
env
[
'product.product'
].
create
({
'name'
:
self
.
inquiry_id
[
'name'
],
'product_type'
:
'project'
})
product
.
product_tmpl_id
.
update
({
'product_type'
:
'project'
,
})
if
self
.
inquiry_id
[
'type'
]
==
'project'
:
bom
=
self
.
env
[
'mrp.bom'
].
create
({
'product_tmpl_id'
:
product
.
product_tmpl_id
.
id
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
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
Menu
Projects
Groups
Snippets
Help