diff --git a/contracts/models.py b/contracts/models.py index 57c98b20f1..c7f7d46982 100644 --- a/contracts/models.py +++ b/contracts/models.py @@ -1,5 +1,6 @@ import calendar import datetime +import uuid from decimal import Decimal from django.db import models @@ -33,6 +34,7 @@ class PriceName(models.Model): external_performer = models.BooleanField(default=False, blank=True, help_text='Прайс внешний исполнитель', db_index=True) subcontract = models.BooleanField(default=False, blank=True, help_text='Прайс субподряд', db_index=True) symbol_code = models.CharField(max_length=55, unique=True, blank=True, null=True, default=None, help_text='Код прайса', db_index=True) + uuid = models.UUIDField(default=uuid.uuid4, editable=False, help_text="UUID, генерируется автоматически", db_index=True) def __str__(self): return "{}".format(self.title) @@ -63,7 +65,7 @@ def as_json(price): else: company_title = "" company_id = "" - json_data = {"id": price.id, "title": price.title, "start": price.date_start, "end": price.date_end, "company": company_id, "companyTitle": company_title} + json_data = {"id": price.id, "title": price.title, "start": price.date_start, "end": price.date_end, "company": company_id, "companyTitle": company_title, "uuid": str(price.uuid)} return json_data @staticmethod @@ -146,6 +148,7 @@ class Company(models.Model): bik = models.CharField(max_length=9, default='', blank=True) contract = models.ForeignKey(Contract, blank=True, null=True, db_index=True, on_delete=models.CASCADE) email = models.CharField(max_length=128, blank=True, default='', help_text="email") + uuid = models.UUIDField(default=uuid.uuid4, editable=False, help_text="UUID, генерируется автоматически", db_index=True) def __str__(self): return "{}".format(self.title) diff --git a/l2-frontend/src/construct/ConstructPrice.vue b/l2-frontend/src/construct/ConstructPrice.vue index 4951751a51..8fb30b100c 100644 --- a/l2-frontend/src/construct/ConstructPrice.vue +++ b/l2-frontend/src/construct/ConstructPrice.vue @@ -1,8 +1,5 @@