add custom address field to shop.models.Order and invoice template
This commit is contained in:
parent
09e916571e
commit
8b8191e16d
18
src/shop/migrations/0055_order_customer_address.py
Normal file
18
src/shop/migrations/0055_order_customer_address.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 2.1 on 2018-08-22 13:18
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('shop', '0054_auto_20180415_1159'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='order',
|
||||
name='customer_address',
|
||||
field=models.TextField(blank=True, help_text='The additional customer address for this order'),
|
||||
),
|
||||
]
|
|
@ -87,6 +87,12 @@ class Order(CreatedUpdatedModel):
|
|||
default=True,
|
||||
)
|
||||
|
||||
customer_address = models.TextField(
|
||||
help_text=_('The additional customer address for this order'),
|
||||
blank=True
|
||||
)
|
||||
|
||||
|
||||
CREDIT_CARD = 'credit_card'
|
||||
BLOCKCHAIN = 'blockchain'
|
||||
BANK_TRANSFER = 'bank_transfer'
|
||||
|
|
|
@ -14,7 +14,12 @@
|
|||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% if invoice.order.customer_address %}
|
||||
<h2>CUSTOMER</h2>
|
||||
<p class="lead">{{ invoice.order.customer_address|linebreaks }}</p>
|
||||
{% else %}
|
||||
<h3>Customer: {{ invoice.order.user.email }}</h3>
|
||||
{% endif %}
|
||||
<br>
|
||||
<h2>INVOICE</h2>
|
||||
<table style="width:90%; margin:1em;">
|
||||
|
|
Loading…
Reference in a new issue