Skip to content

Commit 06eb664

Browse files
committed
[IMP] point_of_sale: child pos_category should not inherit its color
- When creating/updating a `pos_category`, we don't want it anymore to inherit from its parent color, as it could be confusing. closes odoo#218162 Task-id: 4932860 Signed-off-by: Stéphane Vanmeerhaeghe (stva) <[email protected]>
1 parent d4c950e commit 06eb664

File tree

1 file changed

+0
-16
lines changed

1 file changed

+0
-16
lines changed

addons/point_of_sale/models/pos_category.py

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,22 +69,6 @@ def _compute_has_image(self):
6969
for category in self:
7070
category.has_image = bool(category.image_128)
7171

72-
@api.model_create_multi
73-
def create(self, vals_list):
74-
for vals in vals_list:
75-
if vals.get("parent_id"):
76-
vals["color"] = self.search_read([("id", "=", vals["parent_id"])])[0][
77-
"color"
78-
]
79-
return super().create(vals_list)
80-
81-
def write(self, vals):
82-
if vals.get('parent_id') and not ("color" in vals):
83-
vals["color"] = self.search_read([("id", "=", vals["parent_id"])])[0][
84-
"color"
85-
]
86-
return super().write(vals)
87-
8872
def _get_descendants(self):
8973
available_categories = self
9074
for child in self.child_ids:

0 commit comments

Comments
 (0)