8
0
Fork 0
mirror of https://gitlab.federez.net/re2o/re2o synced 2024-05-02 23:53:22 +00:00

Add address on dormitory

This commit is contained in:
Romain Mussard 2020-09-13 21:32:02 +02:00 committed by Gabriel Detraz
parent 2176ad973b
commit 081c99a7f2
4 changed files with 43 additions and 2 deletions

View file

@ -73,7 +73,7 @@
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} l r}
{\bf Pour :} {{recipient_name|safe}} & {\bf Date :} {{DATE}} \\
{\bf Adresse :} {% if address is None %}Aucune adresse renseignée{% else %}{{address}}{% endif %} & \\
{\bf Adresse :} {% if address is None %}Aucune adresse renseignée{% else %}{{addresse1 \\ addresse2 \\addresse3 \\ addresse4}}{% endif %} & \\
{% if fid is not None %}
{% if is_estimate %}
{\bf Devis n\textsuperscript{o} :} {{ fid }} & \\

View file

@ -315,7 +315,6 @@ def facture_pdf(request, facture, **_kwargs):
"fid": facture.id,
"DATE": facture.date,
"recipient_name": "{} {}".format(facture.user.name, facture.user.surname),
"address": facture.user.room,
"article": purchases_info,
"total": facture.prix_total(),
"asso_name": AssoOption.get_cached_value("name"),

View file

@ -0,0 +1,35 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-09-13 19:30
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('topologie', '0074_auto_20200419_1640'),
]
operations = [
migrations.AddField(
model_name='dormitory',
name='city',
field=models.CharField(blank=True, max_length=64, null=True),
),
migrations.AddField(
model_name='dormitory',
name='country',
field=models.CharField(blank=True, max_length=64, null=True),
),
migrations.AddField(
model_name='dormitory',
name='street',
field=models.CharField(blank=True, max_length=64, null=True),
),
migrations.AddField(
model_name='dormitory',
name='zipcode',
field=models.CharField(blank=True, max_length=64, null=True),
),
]

View file

@ -713,6 +713,10 @@ class Dormitory(AclMixin, RevMixin, models.Model):
"""
name = models.CharField(max_length=255)
street = models.CharField(max_length=64, blank=True, null=True)
city = models.CharField(max_length=64, blank=True, null=True)
zipcode = models.CharField(max_length=64, blank=True, null=True)
country = models.CharField(max_length=64, blank=True, null=True)
class Meta:
permissions = (("view_dormitory", _("Can view a dormitory object")),)
@ -947,6 +951,9 @@ class Room(AclMixin, RevMixin, models.Model):
def __str__(self):
return self.building.cached_name + " " + self.name
def full_address(self):
return "Appartement " + self.name + ", Batiment " + self.building.name + ", " + "Residence " + self.building.dormitory.name + ", " + str(self.building.dormitory.address)
class PortProfile(AclMixin, RevMixin, models.Model):
"""Port profile.