Commit ec9ea709 authored by Patrick's avatar Patrick
Browse files

A purchase/order may exists without delivery point

parent 4e7b25e7
......@@ -175,9 +175,9 @@ class Purchase(models.Model):
get_permanence_display.allow_tags = False
def get_delivery_display(self):
if self.customer_invoice is not None:
if self.customer_invoice is not None and self.customer_invoice.delivery is not None:
return self.customer_invoice.delivery.get_delivery_display(admin=True)
return None
return EMPTY_STRING
get_delivery_display.short_description = (_("delivery point"))
get_delivery_display.allow_tags = False
......
......@@ -1221,7 +1221,7 @@ def my_order_confirmation(permanence, customer_invoice, is_basket=False,
if apps.REPANIER_SETTINGS_CUSTOMERS_MUST_CONFIRM_ORDERS:
if is_basket:
if customer_invoice.status == PERMANENCE_OPENED:
if customer_invoice.delivery is None:
if permanence.with_delivery_point and customer_invoice.delivery is None:
btn_disabled = "disabled"
msg_confirmation1 = '<font color="red">%s</font><br/>' % _("An unconfirmed order will be canceled.")
msg_confirmation2 = '<span class="glyphicon glyphicon-floppy-disk"></span>&nbsp;&nbsp;%s' % _("Confirm this order and receive an email containing its summary.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment