You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)**.
69
76
70
-
2. Extend "product.profile" model to add fields from product.template, either in normal mode or default mode (see note section below). These fields should be identical to their original fields **(especially "required" field attribute)**.
77
+
.. code:: python
71
78
72
-
.. code-block:: python
79
+
classProductProfile(models.Model):
80
+
""" Require dependency on sale, purchase and point_of_sale modules
81
+
"""
73
82
74
-
classProductProfile(models.Model):
75
-
""" Require dependency on sale, purchase and point_of_sale modules
76
-
"""
83
+
_inherit ="product.profile"
77
84
78
-
_inherit ="product.profile"
85
+
def_get_types(self):
86
+
return [("product", "Stockable Product"),
87
+
("consu", 'Consumable'),
88
+
("service", "Service")]
79
89
80
-
def_get_types(self):
81
-
return [("product", "Stockable Product"),
82
-
("consu", 'Consumable'),
83
-
("service", "Service")]
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()
84
96
85
-
sale_ok = fields.Boolean(
86
-
string="Can be Sold",
87
-
help="Specify if the product can be selected in a sales order line.")
88
-
purchase_ok = fields.Boolean(
89
-
string="Can be Purchased")
90
-
available_in_pos = fields.Boolean()
97
+
3. Insert data (xml or csv) and define values for each field defined
98
+
above for each configuration scenario
91
99
92
-
3. Insert data (xml or csv) and define values for each field defined above
93
-
for each configuration scenario
100
+
Note : You might want to declare profile fields as defaults. To do this,
101
+
just prefix the field with "profile_default".
94
102
95
-
Note :
96
-
You might want to declare profile fields as defaults. To do this, just prefix the field with "profile_default".
103
+
.. code:: python
97
104
98
-
.. code-block:: python
105
+
classProductProfile(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
+
)
99
114
100
-
classProductProfile(models.Model):
101
-
profile_default_categ_id = fields.Many2one(
102
-
"product.category",
103
-
string="Default category",
104
-
)
105
-
profile_default_tag_ids = fields.Many2many(
106
-
comodel_name="product.template.tag",
107
-
string="Tags",
108
-
)
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
109
119
110
-
Default fields only influence the records the first time they are set.
111
-
- if the profile is modified, changes are not propagated to all the records that have this profile
112
-
- if the record previously had another profile, changing profile will not influence default values
0 commit comments