Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chris
repanier
Commits
9ac7016c
Commit
9ac7016c
authored
Mar 27, 2017
by
Patrick
Browse files
Clearer ordering of products
parent
e1d0ddd9
Changes
2
Hide whitespace changes
Inline
Side-by-side
repanier/admin/producer.py
View file @
9ac7016c
...
...
@@ -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"
)
...
...
repanier/xlsx/xlsx_offer.py
View file @
9ac7016c
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment