diff --git a/contracts/admin.py b/contracts/admin.py index d117abe5f4a0b6c9258fe3dbbdd7c8b2dc607ea5..662e444f7e335709d4664c06e8823b7ff58df17b 100644 --- a/contracts/admin.py +++ b/contracts/admin.py @@ -131,7 +131,7 @@ class ContractAdmin(MarkdownxGuardedModelAdmin): if request.user.is_superuser or request.user.has_perm("approve", self): fieldsets.insert( - 0, + 1, ( "Schválení", { diff --git a/contracts/migrations/0007_alter_contract_approval_state_and_more.py b/contracts/migrations/0007_alter_contract_approval_state_and_more.py new file mode 100644 index 0000000000000000000000000000000000000000..a06596b7a80d016b5dd22f478a9b98f4e5709248 --- /dev/null +++ b/contracts/migrations/0007_alter_contract_approval_state_and_more.py @@ -0,0 +1,38 @@ +# Generated by Django 4.1.4 on 2023-03-06 14:20 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('contracts', '0006_alter_contract_approval_state_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='contract', + name='approval_state', + field=models.CharField(blank=True, choices=[('no', 'Neschválená'), ('yes', 'Schválená')], help_text='Může měnit jen schvalovatel. Pokud je smlouva veřejná, se stavem "Schválená" se vypustí ven.', max_length=7, null=True, verbose_name='Stav schválení'), + ), + migrations.AlterField( + model_name='contractee', + name='address_country', + field=models.CharField(default='Česká Republika', max_length=256, verbose_name='Země'), + ), + migrations.AlterField( + model_name='signee', + name='address_country', + field=models.CharField(default='Česká Republika', max_length=256, verbose_name='Země'), + ), + migrations.AlterField( + model_name='signee', + name='entity_type', + field=models.CharField(choices=[('natural_person', 'Fyzická osoba'), ('legal_entity', 'Právnická osoba'), ('business_natural_person', 'Podnikající fyzická osoba'), ('other', 'Jiné')], help_text='Důležité označit správně! Fyzickým osobám nepublikujeme adresu.', max_length=23, verbose_name='Typ'), + ), + migrations.AlterField( + model_name='signee', + name='ico_number', + field=models.CharField(blank=True, help_text='Vyplněním můžeš automaticky načíst data z ARES.', max_length=16, null=True, verbose_name='IČO'), + ), + ] diff --git a/contracts/migrations/0008_alter_signee_entity_type.py b/contracts/migrations/0008_alter_signee_entity_type.py new file mode 100644 index 0000000000000000000000000000000000000000..269aa8e64b039d23cf0ea574974ca49bf0aecd77 --- /dev/null +++ b/contracts/migrations/0008_alter_signee_entity_type.py @@ -0,0 +1,18 @@ +# Generated by Django 4.1.4 on 2023-03-06 22:27 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('contracts', '0007_alter_contract_approval_state_and_more'), + ] + + operations = [ + migrations.AlterField( + model_name='signee', + name='entity_type', + field=models.CharField(choices=[('natural_person', 'Fyzická osoba'), ('legal_entity', 'Právnická osoba'), ('business_natural_person', 'Podnikající fyzická osoba'), ('other', 'Jiné')], default='legal_entity', help_text='Důležité označit správně! Fyzickým osobám nepublikujeme adresu.', max_length=23, verbose_name='Typ'), + ), + ] diff --git a/contracts/models.py b/contracts/models.py index 55cfefb899a317f9e6f8c58ecf8fe6aed4636a36..e780429ffd42ac56862df54b801eff45cebfe128 100644 --- a/contracts/models.py +++ b/contracts/models.py @@ -41,6 +41,7 @@ class Signee(models.Model): entity_type = models.CharField( max_length=23, choices=EntityTypes.choices, + default=EntityTypes.LEGAL_ENTITY, verbose_name="Typ", help_text="Důležité označit správně! Fyzickým osobám nepublikujeme adresu.", ) @@ -495,9 +496,9 @@ class Contract(models.Model): def __str__(self) -> str: result = "" - if self.public_state == Contract.PublicStates.YES: + if self.approval_state == Contract.ApprovalStates.YES: result += "SCHVÁLENÁ - " - elif self.public_state == Contract.PublicStates.NO: + elif self.approval_state == Contract.ApprovalStates.NO: result += "NESCHVÁLENÁ - " else: result += "KE ZPRACOVÁNÍ - " diff --git a/contracts/templates/contracts/view_contract.html b/contracts/templates/contracts/view_contract.html index 26974eb57355ca31a2f79a0ab612af60ef95df7b..ab29a18084b936860d68e2a16f41ad1d5e24e5c6 100644 --- a/contracts/templates/contracts/view_contract.html +++ b/contracts/templates/contracts/view_contract.html @@ -103,7 +103,7 @@ <tbody> <tr> <td colspan="2" class="text-lg font-bold"> - <i class="ico--file-pdf mr-3"></i>Fyzický dokument + <i class="ico--folder-open mr-3"></i>Fyzický dokument </td> </tr>