fix(parsers): widen industrial product code fields
All checks were successful
CI/CD Pipeline / Quality Gate (push) Successful in 31s
CI/CD Pipeline / Build and Push Images (push) Successful in 6s
CI/CD Pipeline / Internal Notify (push) Successful in 1s
CI/CD Pipeline / Deploy Dev in Dokploy (push) Successful in 1s

This commit is contained in:
2026-04-28 23:17:32 +02:00
parent b2355b0e63
commit 738682e496
3 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,31 @@
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("parsers", "0020_merge_20260428_2300"),
]
operations = [
migrations.AlterField(
model_name="industrialproductrecord",
name="okpd2_code",
field=models.CharField(
blank=True,
help_text="Код по ОКПД2",
max_length=255,
verbose_name="код ОКПД2",
),
),
migrations.AlterField(
model_name="industrialproductrecord",
name="tnved_code",
field=models.CharField(
blank=True,
help_text="Код по ТН ВЭД",
max_length=255,
verbose_name="код ТН ВЭД",
),
),
]

View File

@@ -318,13 +318,13 @@ class IndustrialProductRecord(TimestampMixin, models.Model):
) )
okpd2_code = models.CharField( okpd2_code = models.CharField(
_("код ОКПД2"), _("код ОКПД2"),
max_length=20, max_length=255,
blank=True, blank=True,
help_text=_("Код по ОКПД2"), help_text=_("Код по ОКПД2"),
) )
tnved_code = models.CharField( tnved_code = models.CharField(
_("код ТН ВЭД"), _("код ТН ВЭД"),
max_length=20, max_length=255,
blank=True, blank=True,
help_text=_("Код по ТН ВЭД"), help_text=_("Код по ТН ВЭД"),
) )

View File

@@ -199,3 +199,14 @@ class IndustrialProductRecordModelTest(TestCase):
self.assertIsNotNone(product.created_at) self.assertIsNotNone(product.created_at)
self.assertIsNotNone(product.updated_at) self.assertIsNotNone(product.updated_at)
def test_product_codes_allow_source_specific_long_values(self):
"""Test source code fields accept official registry combined values."""
self.assertEqual(
IndustrialProductRecord._meta.get_field("okpd2_code").max_length,
255,
)
self.assertEqual(
IndustrialProductRecord._meta.get_field("tnved_code").max_length,
255,
)