Commit 9b4185bf authored by Patrick's avatar Patrick

Send to low order to the staff

parent 8e2b25a9
...@@ -158,10 +158,10 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr ...@@ -158,10 +158,10 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
).only("total_price_with_tax").order_by('?').first() ).only("total_price_with_tax").order_by('?').first()
if producer_invoice is not None \ if producer_invoice is not None \
and producer_invoice.total_price_with_tax < producer.minimum_order_value: and producer_invoice.total_price_with_tax < producer.minimum_order_value:
to = cc_email_staff to_email_producer = cc_email_staff
html_content = \ html_content = \
order_producer_mail_subject + '<br/><br/>' + html_content order_producer_mail_subject + '<br/><br/>' + html_content
cc = [] cc_email_staff = []
order_producer_mail_subject = _( order_producer_mail_subject = _(
'/!\ Mail not send to our producer %s because the minimum order value has not been reached.') % long_profile_name '/!\ Mail not send to our producer %s because the minimum order value has not been reached.') % long_profile_name
else: else:
...@@ -172,13 +172,12 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr ...@@ -172,13 +172,12 @@ def email_order(permanence_id, all_producers=True, closed_deliveries_id=None, pr
to_email_producer.append(producer.email2) to_email_producer.append(producer.email2)
if producer.email3: if producer.email3:
to_email_producer.append(producer.email3) to_email_producer.append(producer.email3)
cc = cc_email_staff
email = EmailMultiAlternatives( email = EmailMultiAlternatives(
order_producer_mail_subject, order_producer_mail_subject,
strip_tags(html_content), strip_tags(html_content),
from_email=sender_email, from_email=sender_email,
to=to_email_producer, to=to_email_producer,
cc=cc cc=cc_email_staff
) )
if REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_PRODUCER and wb is not None: if REPANIER_SETTINGS_SEND_ORDER_MAIL_TO_PRODUCER and wb is not None:
if REPANIER_SETTINGS_SEND_ABSTRACT_ORDER_MAIL_TO_PRODUCER: if REPANIER_SETTINGS_SEND_ABSTRACT_ORDER_MAIL_TO_PRODUCER:
......
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