Commit 1efacb47 authored by Patrick's avatar Patrick
Browse files

The invoices must be displayed without the cms_toolbar

parent c5625a93
...@@ -139,6 +139,7 @@ class Permanence(TranslatableModel): ...@@ -139,6 +139,7 @@ class Permanence(TranslatableModel):
changelist_url = send_offeritem_changelist_url changelist_url = send_offeritem_changelist_url
pi = invoice.ProducerInvoice.objects.filter(producer_id=p.id, permanence_id=self.id) \ pi = invoice.ProducerInvoice.objects.filter(producer_id=p.id, permanence_id=self.id) \
.order_by('?').first() .order_by('?').first()
# Important : no target="_blank"
if pi is not None: if pi is not None:
label = '%s (%s) %s' % (p.short_profile_name, pi.get_total_price_with_tax(), LOCK_UNICODE) label = '%s (%s) %s' % (p.short_profile_name, pi.get_total_price_with_tax(), LOCK_UNICODE)
link.append( link.append(
...@@ -160,6 +161,8 @@ class Permanence(TranslatableModel): ...@@ -160,6 +161,8 @@ class Permanence(TranslatableModel):
pi.producer.short_profile_name, pi.producer.short_profile_name,
pi.get_total_price_with_tax() pi.get_total_price_with_tax()
) )
# Important : target="_blank" because the invoices must be displayed without the cms_toolbar
# Such that they can be accessed by the producer and by the staff
link.append( link.append(
'<a href="%s?producer=%d" target="_blank">%s</a>' '<a href="%s?producer=%d" target="_blank">%s</a>'
% ( % (
...@@ -214,8 +217,9 @@ class Permanence(TranslatableModel): ...@@ -214,8 +217,9 @@ class Permanence(TranslatableModel):
label = '%s (%s) %s' % ( label = '%s (%s) %s' % (
ci.customer.short_basket_name, ci.total_price_with_tax, ci.customer.short_basket_name, ci.total_price_with_tax,
ci.get_is_order_confirm_send_display()) ci.get_is_order_confirm_send_display())
# Important : no target="_blank"
link.append( link.append(
'<a href="%s?permanence=%d&customer=%d" target="_blank">%s</a>' '<a href="%s?permanence=%d&customer=%d">%s</a>'
% (changelist_url, self.id, ci.customer_id, label.replace(' ', '&nbsp;'))) % (changelist_url, self.id, ci.customer_id, label.replace(' ', '&nbsp;')))
customers = ", ".join(link) customers = ", ".join(link)
elif self.status == PERMANENCE_DONE: elif self.status == PERMANENCE_DONE:
...@@ -227,6 +231,8 @@ class Permanence(TranslatableModel): ...@@ -227,6 +231,8 @@ class Permanence(TranslatableModel):
ci.get_total_price_with_tax(customer_who_pays=True), ci.get_total_price_with_tax(customer_who_pays=True),
ci.get_is_order_confirm_send_display() ci.get_is_order_confirm_send_display()
) )
# Important : target="_blank" because the invoices must be displayed without the cms_toolbar
# Such that they can be accessed by the customer and by the staff
link.append( link.append(
'<a href="%s?customer=%d" target="_blank">%s</a>' '<a href="%s?customer=%d" target="_blank">%s</a>'
% ( % (
......
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