Logging-in with basket products may cause order lines to have incorrect partner / stock record
st8st8 opened this issue · comments
Found a bug? Please fill out the sections below.
Issue Summary
When logging in to Oscar with products in your basket, if that causes the Partner Strategy to change then the basket price updates, but the partner and stock record does not. This is turn is reflected in the resulting Order record.
Steps to Reproduce
- Set up a shop where certain users have a different strategy / partner to the anonymous user for a given product
- Visit the shop without logging in
- Add the product to your basket
- Log in to oscar
- Check out and complete the order
Now the lines in the frozen basket and resultant order will have the correct price, but the wrong partner and stock record. It would be helpful if this was correct as I'm now auditing past purchases based on the partner and stock record.
Technical details
Any python/Djange version, Oscar 3.2
Hi,
I understand.
Could you please create a test for this on a branch maybe that shows this unwanted behaviour?
And would you be willing to work on this issue yourself? I can point you to the right way of going about fixing it.
Yeah, i can look at this. Leave it with me for now.
OK, I've added a couple of tests in a branch, along with a potential fix:
https://github.com/st8st8/django-oscar/tree/partner_basket
I'll give this a run out in my shops for a bit and see what happens.