mirror of
https://gitlab2.federez.net/re2o/re2o
synced 2024-12-23 07:23:46 +00:00
Add address on dormitory
This commit is contained in:
parent
2176ad973b
commit
081c99a7f2
4 changed files with 43 additions and 2 deletions
|
@ -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 }} & \\
|
||||
|
|
|
@ -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"),
|
||||
|
|
35
topologie/migrations/0075_auto_20200913_2130.py
Normal file
35
topologie/migrations/0075_auto_20200913_2130.py
Normal 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),
|
||||
),
|
||||
]
|
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue