Skip to content

Commit

Permalink
[MIG][12.0] product_profile_example: Migration to 12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinkhao authored and bosd committed Jan 18, 2025
1 parent b16d227 commit 2374237
Show file tree
Hide file tree
Showing 11 changed files with 251 additions and 97 deletions.
3 changes: 2 additions & 1 deletion product_profile_example/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See its description.
Configuration
=============

Optionnaly:
Optionally:

* Settings > Configuration > General Settings: check 'Display fields in Profile' and apply
(only if you want display hidden fields set by profile git )
Expand All @@ -39,6 +39,7 @@ Contributors
------------

* David BEAL <[email protected]>
* Kevin KHAO <[email protected]>

Maintainer
----------
Expand Down
10 changes: 5 additions & 5 deletions product_profile_example/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

{
"license": "AGPL-3",
"name": "Product Profile Example",
"summary": "Product Profile Use Case",
"version": "10.0.1.0.1",
"version": "12.0.1.0.0",
"author": "Akretion, Odoo Community Association (OCA)",
"category": "product",
"depends": ["product_profile", "purchase", "point_of_sale", "mrp",],
"website": "http://www.akretion.com/",
"demo": ["demo/product.profile.csv", "demo/product_product_demo.xml",],
"depends": ["product_profile", "purchase_stock", "point_of_sale", "mrp"],
"website": "https://github.com/oca/product-attribute",
"demo": ["demo/product_profile.xml", "demo/product_product.xml"],
"installable": True,
"license": "AGPL-3",
}
20 changes: 0 additions & 20 deletions product_profile_example/demo/product.profile.csv

This file was deleted.

12 changes: 12 additions & 0 deletions product_profile_example/demo/product_product.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<odoo noupdate="1">

<record id="mrp.product_product_computer_desk_bolt" model="product.product">
<field name="profile_id" ref="profile_consu"/>
</record>

<record id="product.product_product_3" model="product.product">
<field name="profile_id" ref="profile_manuf"/>
</record>

</odoo>
22 changes: 0 additions & 22 deletions product_profile_example/demo/product_product_demo.xml

This file was deleted.

57 changes: 57 additions & 0 deletions product_profile_example/demo/product_profile.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?xml version="1.0"?>
<odoo>

<record id="profile_own" model="product.profile">
<field name="name">My Own Type Saleable</field>
<field name="type">product</field>
<field name="sale_ok">True</field>
<field name="purchase_ok">False</field>
<field name="profile_default_categ_id" ref="product.product_category_all"/>
<field name="available_in_pos">True</field>
<field name="profile_default_route_ids" eval="[(6, 0, [ref('purchase_stock.route_warehouse0_buy')])]"/>
<field name="explanation">- My own type
- Saleable product
- Not purchasable</field>
</record>

<record id="profile_complete" model="product.profile">
<field name="name">Complete Profile</field>
<field name="type">product</field>
<field name="sale_ok">True</field>
<field name="purchase_ok">True</field>
<field name="profile_default_categ_id" ref="product.product_category_all"/>
<field name="available_in_pos">True</field>
<field name="profile_default_route_ids" eval="[(6, 0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto'),ref('purchase_stock.route_warehouse0_buy')])]"/>
<field name="explanation">- Stockable product
- Saleable
- Purchasable
- Available in POS
- MTO
- Manufacturable</field>
</record>

<record id="profile_manuf" model="product.profile">
<field name="name">Manufacturing TO</field>
<field name="type">product</field>
<field name="sale_ok">True</field>
<field name="purchase_ok">False</field>
<field name="profile_default_categ_id" ref="product.product_category_5"/>
<field name="available_in_pos">True</field>
<field name="profile_default_route_ids" eval="[(6, 0, [ref('mrp.route_warehouse0_manufacture'),ref('stock.route_warehouse0_mto')])]"/>
<field name="explanation">- Manufacturing Product
- Make to order product
- Display on POS</field>
</record>

<record id="profile_consu" model="product.profile">
<field name="name">Consumable</field>
<field name="type">consu</field>
<field name="sale_ok">True</field>
<field name="purchase_ok">False</field>
<field name="profile_default_categ_id" ref="product.product_category_all"/>
<field name="available_in_pos">False</field>
<field name="explanation">Consumable</field>
</record>


</odoo>
2 changes: 1 addition & 1 deletion product_profile_example/models/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# © 2015 David BEAL @ Akretion
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from . import profile
from . import product_profile
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ class ProductProfile(models.Model):
"whether it will be bought, manufactured, MTO/MTS,...",
)
profile_default_categ_id = fields.Many2one(
"product.category", string="Default category"
"product.category", string="Default category", required=True
)
Binary file modified product_profile_example/static/description/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 2374237

Please sign in to comment.