Repository: saleor/saleor

Issue:
Add more units to numeric fields
Expand metric units to support more types of products.

Add metric units:

Metric -> Distance -> mm
Metric -> Distance -> dm
Metric -> Area -> mm2
Metric -> Area -> dm2


Discussion:
Hello, @timuric 
Can I Take on the Issue? Need more info on its status and details. 

Resolving patch:
diff --git a/saleor/attribute/migrations/0029_alter_attribute_unit.py b/saleor/attribute/migrations/0029_alter_attribute_unit.py
new file mode 100644
--- /dev/null
+++ b/saleor/attribute/migrations/0029_alter_attribute_unit.py
@@ -0,0 +1,57 @@
+# Generated by Django 3.2.19 on 2023-06-07 14:48
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+    dependencies = [
+        ("attribute", "0028_attribute_attribute_gin"),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="attribute",
+            name="unit",
+            field=models.CharField(
+                blank=True,
+                choices=[
+                    ("mm", "mm"),
+                    ("cm", "cm"),
+                    ("dm", "dm"),
+                    ("m", "m"),
+                    ("km", "km"),
+                    ("ft", "ft"),
+                    ("yd", "yd"),
+                    ("inch", "inch"),
+                    ("sq_mm", "sq_mm"),
+                    ("sq_cm", "sq_cm"),
+                    ("sq_dm", "sq_dm"),
+                    ("sq_m", "sq_m"),
+                    ("sq_km", "sq_km"),
+                    ("sq_ft", "sq_ft"),
+                    ("sq_yd", "sq_yd"),
+                    ("sq_inch", "sq_inch"),
+                    ("cubic_millimeter", "cubic_millimeter"),
+                    ("cubic_centimeter", "cubic_centimeter"),
+                    ("cubic_decimeter", "cubic_decimeter"),
+                    ("cubic_meter", "cubic_meter"),
+                    ("liter", "liter"),
+                    ("cubic_foot", "cubic_foot"),
+                    ("cubic_inch", "cubic_inch"),
+                    ("cubic_yard", "cubic_yard"),
+                    ("qt", "qt"),
+                    ("pint", "pint"),
+                    ("fl_oz", "fl_oz"),
+                    ("acre_in", "acre_in"),
+                    ("acre_ft", "acre_ft"),
+                    ("g", "g"),
+                    ("lb", "lb"),
+                    ("oz", "oz"),
+                    ("kg", "kg"),
+                    ("tonne", "tonne"),
+                ],
+                max_length=100,
+                null=True,
+            ),
+        ),
+    ]
diff --git a/saleor/core/units.py b/saleor/core/units.py
--- a/saleor/core/units.py
+++ b/saleor/core/units.py
@@ -1,5 +1,7 @@
 class DistanceUnits:
+    MM = "mm"
     CM = "cm"
+    DM = "dm"
     M = "m"
     KM = "km"
     FT = "ft"
@@ -7,7 +9,9 @@ class DistanceUnits:
     INCH = "inch"
 
     CHOICES = [
+        (MM, "Millimeter"),
         (CM, "Centimeter"),
+        (DM, "Decimeter"),
         (M, "Meter"),
         (KM, "Kilometers"),
         (FT, "Feet"),
@@ -17,7 +21,9 @@ class DistanceUnits:
 
 
 class AreaUnits:
+    SQ_MM = "sq_mm"
     SQ_CM = "sq_cm"
+    SQ_DM = "sq_dm"
     SQ_M = "sq_m"
     SQ_KM = "sq_km"
     SQ_FT = "sq_ft"
@@ -25,7 +31,9 @@ class AreaUnits:
     SQ_INCH = "sq_inch"
 
     CHOICES = [
+        (SQ_MM, "Square millimeter"),
         (SQ_CM, "Square centimeters"),
+        (SQ_DM, "Square decimeter"),
         (SQ_M, "Square meters"),
         (SQ_KM, "Square kilometers"),
         (SQ_FT, "Square feet"),


Test patch: