-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Distinguish OrderLine product name and variant name #4702
Distinguish OrderLine product name and variant name #4702
Conversation
ab47cc3
to
054cf7f
Compare
Here is the report for 53b09ef (mirumee/saleor @ 4624/Distinguish_product_and_varinat_name_in_OrderLine) No differences were found. (click me)
# api.benchmark checkout
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
add billing address to checkout 34 34 20
add shipping to checkout 7 7 0
checkout payment charge 14 14 0
complete checkout 6 6 0
create checkout 48 48 24
# api.benchmark homepage
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
retrieve main menu 5 5 0
retrieve product list 4 4 0
retrieve secondary menu 5 5 0
retrieve shop 2 2 0
# api.benchmark product
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
product details 13 13 3
# api.benchmark variant
test name left count right count duplicate count
------------------------------------ ----------- ----------- ---------------
retrieve variant list 15 15 8 |
Codecov Report
@@ Coverage Diff @@
## master #4702 +/- ##
=========================================
- Coverage 91.62% 91.6% -0.03%
=========================================
Files 307 308 +1
Lines 18412 18438 +26
Branches 1825 1827 +2
=========================================
+ Hits 16870 16890 +20
- Misses 1036 1040 +4
- Partials 506 508 +2
Continue to review full report at Codecov.
|
054cf7f
to
ce4d3b9
Compare
@@ -360,7 +360,9 @@ class OrderLine(models.Model): | |||
) | |||
# max_length is as produced by ProductVariant's display_product method |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this comment obsolete?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think yes. This comment explains why product_name
have max_length=386
. We can't change max length because we can't get new product_name
for order lines with removed products or variants.
@@ -25,7 +25,7 @@ def test_get_order_payloads(order_with_lines): | |||
for i, line in enumerate(order): | |||
item = data[i + 1] | |||
assert item["ti"] == order.pk | |||
assert item["in"] == line.product_name | |||
assert item["in"] == line.variant.display_product() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be str(line.variant)
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And what about rest of calls of .display_product()
? As @maarcingebala said, Do we need it at all? Maybe we can remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- No, because str(line.variant) is
variant.name
orvariant.sku
anddisplay_product
isproduct.name (variant.name)
. We need both names in analytics. - I think we shouldn't remove it because google merchant uses it.
f559f8a
to
f50c217
Compare
f50c217
to
53b09ef
Compare
I want to merge this change because resolve #4624
Screenshots
Pull Request Checklist