Commit 9ac7016c authored by Patrick's avatar Patrick

Clearer ordering of products

parent e1d0ddd9
......@@ -246,8 +246,8 @@ class ProducerAdmin(ImportExportMixin, admin.ModelAdmin):
]
return my_urls + urls
def export_xlsx_customer_prices(self, request, queryset):
return xlsx_product.admin_export(request, queryset, producer_prices=False)
def export_xlsx_customer_prices(self, request, producer_qs):
return xlsx_product.admin_export_customer_prices(producer_qs, producer_prices=False)
export_xlsx_customer_prices.short_description = _(
"Export products of selected producer(s) as XSLX file at customer's prices")
......
......@@ -25,7 +25,7 @@ def export_offer(permanence, wb=None):
is_box=False,
translations__language_code=translation.get_language()).order_by(
"producer__short_profile_name",
"department_for_customer__tree_id",
"department_for_customer",
"translations__long_name",
"order_average_weight"):
row_num = export_offer_row(product, row_num, ws)
......@@ -41,11 +41,13 @@ def export_offer(permanence, wb=None):
elif permanence.status == PERMANENCE_OPENED:
for offer_item in OfferItem.objects.prefetch_related(
"producer", "department_for_customer").filter(permanence_id=permanence.id, is_active=True,
product__translations__language_code=translation.get_language()).order_by(
'producer__short_profile_name',
'department_for_customer',
'product__translations__long_name'):
"producer", "department_for_customer"
).filter(
permanence_id=permanence.id,
is_active=True,
product__translations__language_code=translation.get_language()).order_by(
'translations__order_sort_order',
):
row_num = export_offer_row(offer_item, row_num, ws)
return wb
......
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