From 20532b23629f7d5cd40c98e01fb9ff092440b4e2 Mon Sep 17 00:00:00 2001
From: Denis Roussel
Date: Mon, 1 Jul 2024 11:16:44 +0200
Subject: [PATCH] [IMP] stock_package_type_category: Add a color on categories
---
stock_package_type_category/README.rst | 4 ++--
.../models/stock_package_type_category.py | 1 +
stock_package_type_category/readme/CONFIGURE.md | 2 +-
stock_package_type_category/static/description/index.html | 4 ++--
.../views/stock_package_type_category.xml | 2 ++
5 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/stock_package_type_category/README.rst b/stock_package_type_category/README.rst
index e54228c27..5f6e6682d 100644
--- a/stock_package_type_category/README.rst
+++ b/stock_package_type_category/README.rst
@@ -47,8 +47,8 @@ Configuration
- You should have activated the 'Packages' configuration in Inventory >
Configuration > Settings > Operations.
- Go to Inventory > Configuration > Delivery > Package Type Categories.
-- Add as many categories you need by filling in a name and a code
- (unique).
+- Add as many categories you need by filling in a name, a code (unique)
+ and a color(if needed).
- Then, fill in the category on package type that need it.
Bug Tracker
diff --git a/stock_package_type_category/models/stock_package_type_category.py b/stock_package_type_category/models/stock_package_type_category.py
index 17552b961..07a8c2e2d 100644
--- a/stock_package_type_category/models/stock_package_type_category.py
+++ b/stock_package_type_category/models/stock_package_type_category.py
@@ -11,6 +11,7 @@ class StockPackageTypeCategory(models.Model):
name = fields.Char(translate=True, required=True)
code = fields.Char(required=True)
+ color = fields.Integer(default=0)
_sql_constraints = [
(
diff --git a/stock_package_type_category/readme/CONFIGURE.md b/stock_package_type_category/readme/CONFIGURE.md
index fda7496af..7f705d91c 100644
--- a/stock_package_type_category/readme/CONFIGURE.md
+++ b/stock_package_type_category/readme/CONFIGURE.md
@@ -1,4 +1,4 @@
- You should have activated the 'Packages' configuration in Inventory > Configuration > Settings > Operations.
- Go to Inventory > Configuration > Delivery > Package Type Categories.
-- Add as many categories you need by filling in a name and a code (unique).
+- Add as many categories you need by filling in a name, a code (unique) and a color(if needed).
- Then, fill in the category on package type that need it.
diff --git a/stock_package_type_category/static/description/index.html b/stock_package_type_category/static/description/index.html
index 6356921f0..3b494cb7f 100644
--- a/stock_package_type_category/static/description/index.html
+++ b/stock_package_type_category/static/description/index.html
@@ -395,8 +395,8 @@ want to sort them per category in order to easy their operations.
You should have activated the ‘Packages’ configuration in Inventory >
Configuration > Settings > Operations.
Go to Inventory > Configuration > Delivery > Package Type Categories.
-Add as many categories you need by filling in a name and a code
-(unique).
+Add as many categories you need by filling in a name, a code (unique)
+and a color(if needed).
Then, fill in the category on package type that need it.
diff --git a/stock_package_type_category/views/stock_package_type_category.xml b/stock_package_type_category/views/stock_package_type_category.xml
index 989b03297..cc07294f3 100644
--- a/stock_package_type_category/views/stock_package_type_category.xml
+++ b/stock_package_type_category/views/stock_package_type_category.xml
@@ -14,6 +14,7 @@
+
@@ -41,6 +42,7 @@
+