fix: create organizations from form uploads
All checks were successful
CI/CD Pipeline / Code Quality Checks (push) Successful in 1m36s
CI/CD Pipeline / Run Tests (push) Successful in 2m12s
CI/CD Pipeline / Build and Push Dev Images (push) Successful in 37s
CI/CD Pipeline / Deploy Dev via Compose (push) Successful in 24s

This commit is contained in:
2026-06-02 00:28:09 +02:00
parent 943abb16ce
commit d112d1715f
17 changed files with 372 additions and 14 deletions

View File

@@ -366,7 +366,13 @@ class FormF2Parser(ReportingPeriodParserMixin, BaseExcelParser[FormF2Record]):
"""Создать запись формы Ф-2."""
row_data = self._normalize_row_data(row_data)
batch_id = batch_id or getattr(self, "load_batch", self.get_next_batch_id())
org = OrganizationService.get_required_by_inn(row_data.inn)
org = OrganizationService.get_or_create_from_form_identifiers(
name=row_data.organization_name,
inn=row_data.inn,
ogrn=row_data.ogrn,
kpp=row_data.kpp,
okpo=row_data.okpo,
)
record = FormF2Service.create_versioned_record(
organization=org,