Skip to content

Commit d7d9486

Browse files
committed
Merge PR #1731 into 17.0
Signed-off-by yvaucher
2 parents f60c1ae + c3deb6e commit d7d9486

32 files changed

+3133
-0
lines changed

product_profile/README.rst

Lines changed: 200 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
===============
2+
Product Profile
3+
===============
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:f04f87cc48c1940f6a787ce702e91fbe42ce1cf2e9a1d585b34b17b966fc1dcb
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Production/Stable
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github
20+
:target: https://github.com/OCA/product-attribute/tree/17.0/product_profile
21+
:alt: OCA/product-attribute
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/product-attribute-17-0/product-attribute-17-0-product_profile
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/product-attribute&target_branch=17.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
This module provides easier products configuration (in one click). It
32+
allows to configure a product template with only one field.
33+
34+
|image1|
35+
36+
**Main use case**: a lot of modules are installed (mrp, purchase, sale,
37+
pos) and products configuration becomes harder for end users: too many
38+
fields to take care of.
39+
40+
You are concerned that at any time a product might be not configured
41+
correctly: this module is your friend.
42+
43+
Thanks to this module, a lot of complexity becomes hidden (default
44+
behavior) to the end user and usability is optimal.
45+
46+
It eases as well the data migration by only specifying the profile field
47+
instead of all fields which depend on it.
48+
49+
Note: This module is meant to be used by skilled people in database
50+
fields creation within the ERP framework.
51+
52+
Additional feature: a default value can be attached to a profile (see §
53+
Configuration, part 3)
54+
55+
.. |image1| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_profile/static/img/field.png
56+
57+
**Table of contents**
58+
59+
.. contents::
60+
:local:
61+
62+
Configuration
63+
=============
64+
65+
1. Create your own profile here: Sales > Configuration > Product >
66+
Product Profiles
67+
68+
|image2|
69+
70+
|image3|
71+
72+
2. Extend "product.profile" model to add fields from product.template,
73+
either in normal mode or default mode (see note section below). These
74+
fields should be identical to their original fields **(especially
75+
"required" field attribute)**.
76+
77+
.. code:: python
78+
79+
class ProductProfile(models.Model):
80+
""" Require dependency on sale, purchase and point_of_sale modules
81+
"""
82+
83+
_inherit = "product.profile"
84+
85+
def _get_types(self):
86+
return [("product", "Stockable Product"),
87+
("consu", 'Consumable'),
88+
("service", "Service")]
89+
90+
sale_ok = fields.Boolean(
91+
string="Can be Sold",
92+
help="Specify if the product can be selected in a sales order line.")
93+
purchase_ok = fields.Boolean(
94+
string="Can be Purchased")
95+
available_in_pos = fields.Boolean()
96+
97+
3. Insert data (xml or csv) and define values for each field defined
98+
above for each configuration scenario
99+
100+
Note : You might want to declare profile fields as defaults. To do this,
101+
just prefix the field with "profile_default".
102+
103+
.. code:: python
104+
105+
class ProductProfile(models.Model):
106+
profile_default_categ_id = fields.Many2one(
107+
"product.category",
108+
string="Default category",
109+
)
110+
profile_default_tag_ids = fields.Many2many(
111+
comodel_name="product.template.tag",
112+
string="Tags",
113+
)
114+
115+
Default fields only influence the records the first time they are set. -
116+
if the profile is modified, changes are not propagated to all the
117+
records that have this profile - if the record previously had another
118+
profile, changing profile will not influence default values
119+
120+
.. |image2| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_profile/static/img/list.png
121+
.. |image3| image:: https://raw.githubusercontent.com/OCA/product-attribute/17.0/product_profile/static/img/create.png
122+
123+
124+
Usage
125+
=====
126+
127+
Assign a value to the profile field in the product template form. Then,
128+
all fields which depend on this profile will be set to the right value
129+
at once.
130+
131+
If you deselect the profile value, all these fields keep the same value
132+
and you can change them manually (back to standard behavior).
133+
134+
Profiles are also defined as search filter and group.
135+
136+
Known issues / Roadmap
137+
======================
138+
139+
- Streamlined behaviour of default/nondefault fields in every situation
140+
- More robust/less error-prone functionality for required fields or
141+
fields implicated in workflows
142+
- More flexible/configurable behaviour for profile fields (instead of
143+
only default/nondefault fields)
144+
145+
Bug Tracker
146+
===========
147+
148+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/product-attribute/issues>`_.
149+
In case of trouble, please check there if your issue has already been reported.
150+
If you spotted it first, help us to smash it by providing a detailed and welcomed
151+
`feedback <https://github.com/OCA/product-attribute/issues/new?body=module:%20product_profile%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
152+
153+
Do not contact contributors directly about support or help with technical issues.
154+
155+
Credits
156+
=======
157+
158+
Authors
159+
-------
160+
161+
* Akretion
162+
163+
Contributors
164+
------------
165+
166+
- David BEAL <david.beal@akretion.com>
167+
- Sébastien BEAU <sebastien.beau@akretion.com>
168+
- Abdessamad HILALI <abdessamad.hilali@akretion.com>
169+
- Kevin Khao <kevin.khao@akretion.com>
170+
171+
Maintainers
172+
-----------
173+
174+
This module is maintained by the OCA.
175+
176+
.. image:: https://odoo-community.org/logo.png
177+
:alt: Odoo Community Association
178+
:target: https://odoo-community.org
179+
180+
OCA, or the Odoo Community Association, is a nonprofit organization whose
181+
mission is to support the collaborative development of Odoo features and
182+
promote its widespread use.
183+
184+
.. |maintainer-bealdav| image:: https://github.com/bealdav.png?size=40px
185+
:target: https://github.com/bealdav
186+
:alt: bealdav
187+
.. |maintainer-sebastienbeau| image:: https://github.com/sebastienbeau.png?size=40px
188+
:target: https://github.com/sebastienbeau
189+
:alt: sebastienbeau
190+
.. |maintainer-kevinkhao| image:: https://github.com/kevinkhao.png?size=40px
191+
:target: https://github.com/kevinkhao
192+
:alt: kevinkhao
193+
194+
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
195+
196+
|maintainer-bealdav| |maintainer-sebastienbeau| |maintainer-kevinkhao|
197+
198+
This module is part of the `OCA/product-attribute <https://github.com/OCA/product-attribute/tree/17.0/product_profile>`_ project on GitHub.
199+
200+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

product_profile/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# © 2015 David BEAL @ Akretion
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
from . import models

product_profile/__manifest__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# © 2015 David BEAL @ Akretion
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
4+
{
5+
"name": "Product Profile",
6+
"version": "17.0.1.0.0",
7+
"author": "Akretion, Odoo Community Association (OCA)",
8+
"summary": "Allow to configure a product in 1 click",
9+
"category": "product",
10+
"development_status": "Production/Stable",
11+
"depends": ["sale_management"],
12+
"website": "https://github.com/OCA/product-attribute",
13+
"data": [
14+
"security/group.xml",
15+
"views/product_view.xml",
16+
"views/config_view.xml",
17+
"security/ir.model.access.csv",
18+
],
19+
"demo": ["demo/profile_demo.xml"],
20+
"installable": True,
21+
"license": "AGPL-3",
22+
"maintainers": ["bealdav", "sebastienbeau", "kevinkhao"],
23+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<odoo>
3+
4+
<record id="my_own_consumable" model="product.profile">
5+
<field name="name">My Own Type Consumable</field>
6+
<field name="explanation">My Own Type, Consumable</field>
7+
<field name="detailed_type">consu</field>
8+
</record>
9+
10+
<record id="stockable_lot_sale_pur" model="product.profile">
11+
<field name="name">Service Product Profile Example</field>
12+
<field
13+
name="explanation"
14+
>Minimal example of service product profile, extend this to your own needs</field>
15+
<field name="detailed_type">service</field>
16+
</record>
17+
18+
</odoo>

0 commit comments

Comments
 (0)