Open Max84 opened 2 years ago
In order to help anybody with have some problem with inconsistent data, into webservice for example, or with performances, you can delete unused lines like this:
DELETE FROM
ps_stock_availableWHERE id_shop = XXXX
Just replace XXXX by the id which should be deleted, it should be "0" if you have just disabled stock sharing. Backup your database before!
Hello @Max84 ,
I dont have the exact same result as you :
I create my product ID = 20 in my shop id = 3. So it means that only the first line should be in the database, not the 2 others ?
Could you share how you create your different shops/ group shops ?
In my case, I have 1 group with 3 shops.
Thanks!
Hi @florine2623,
It's not really the same step to reproduce:
Do you get it?
Best regards,
Changing stock sharing parameter is the way to reproduce it. If you don't update stock sharing, you don't get this bug.
Hi @Max84
Thank to have given us more details, I tried to reproduce your issue witth all your details, but I currently can't reproduce it, I follow your step as you can see in this video :
did I missed a details ?
Waiting for your feedback
Hi @AureRita , @florine2623
I'm sorry, I think I've forgotten a step (updating product). Please, check my video (tested with the latest: 1.7.8.6):
https://user-images.githubusercontent.com/6622400/175035065-87f9e384-a169-485a-a3f7-a345e21bad1c.mp4
maybe a better video: https://drive.google.com/file/d/1-TGDG3m2OO1lfwZxZ4snzCZEXDOojZno/view?usp=sharing
hello @Max84,
Thank you for your last screenrecord.
I reproduce the issue with PrestaShop version 1.7.7.8 & 1.7.8.6. I'll add this to the backlog so it can be fixed.
Please be aware that some issues might take a very long time to be resolved.
If you fix the issue on your end, please contribute it back to the project. Remember that the more people contribute, the better PrestaShop becomes for everyone.
Thank you
Prerequisites
Describe the bug and add screenshots
In a multishop context, if you change the share stock parameter into backoffice, old stock_avalaible lines are still in database. These lines aren't used anymore, I suggest deleting them onto stock parameter update in order to improve performance and keep database consistent.
I'll gibe an example just after.
Expected behavior
Unused stock_avalaible lines should be deleted.
Steps to reproduce
PrestaShop version(s) where the bug happened
1.7.8.7, 1.7.7.8
PHP version(s) where the bug happened
No response
If your bug is related to a module, specify its name and its version
No response