#9 feat(Product): add unit_external_id field.
This commit is contained in:
parent
ba9ef039f4
commit
1d3160ae92
@ -0,0 +1,18 @@
|
|||||||
|
# Generated by Django 5.0.6 on 2025-07-19 23:15
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('don_confiao', '0041_product_external_id'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AddField(
|
||||||
|
model_name='product',
|
||||||
|
name='unit_external_id',
|
||||||
|
field=models.CharField(blank=True, max_length=100, null=True),
|
||||||
|
),
|
||||||
|
]
|
@ -42,6 +42,7 @@ class Product(models.Model):
|
|||||||
choices=MeasuringUnits.choices,
|
choices=MeasuringUnits.choices,
|
||||||
default=MeasuringUnits.UNIT
|
default=MeasuringUnits.UNIT
|
||||||
)
|
)
|
||||||
|
unit_external_id = models.CharField(max_length=100, null=True, blank=True)
|
||||||
categories = models.ManyToManyField(ProductCategory)
|
categories = models.ManyToManyField(ProductCategory)
|
||||||
external_id = models.CharField(max_length=100, null=True, blank=True)
|
external_id = models.CharField(max_length=100, null=True, blank=True)
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ class TestProducts(TestCase):
|
|||||||
|
|
||||||
self.assertIsInstance(product, Product)
|
self.assertIsInstance(product, Product)
|
||||||
self.assertIsNone(product.external_id)
|
self.assertIsNone(product.external_id)
|
||||||
|
self.assertIsNone(product.unit_external_id)
|
||||||
|
|
||||||
def test_import_products(self):
|
def test_import_products(self):
|
||||||
self._import_csv()
|
self._import_csv()
|
||||||
|
Loading…
Reference in New Issue
Block a user