forked from OCA/connector-prestashop
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX+IMP] connector_prestashop: Several things
* [FIX] Fix export when no location has flag prestashop_synchronized When there is no location with the flag prestashop_synchronized in the location tree, Current behavior: The `location` key in the context is empty then the qty_available is computed for *every* locations/warehouses. Expected behavior: If there is at least one location flagged, use it, otherwise, use all the locations of the tree, starting from the selected location or selected warehouse location. When no location can be found (for instance because user selected a location with a usage different than 'internal'), then it should just fail and not return the stock of all warehouses. Being able to synchronize without activating 'prestashop_synchronized' is important: when used, this feature will trigger an export every time a quant is changed or created, on a large catalog, we might prefer only using the cron to have less frequent updates and less jobs. A second fix is that when a stock_location_id is set on the backend, it should be used, it was only used for the import of stock. * [FIX] Exclude children from qty computation We already pass the children in 'location', if we don't disable 'compute_child', the qty computation will try to get the children of each child and generates query of 1mio chars. * [IMP] Group computation of qty_available Stats with 6700 products: Before: 570s After: 28s * [FIX] Apply filter on locations for variants quantities It was only applied on export of template quantities. * [IMP] Improve performance on prestashop qty recompute The add/union operation between recordsets is slow, aggregate the ids in a set and call the browse only once on the complete set is dramatically faster. See guewen/connector-magento#9
- Loading branch information
1 parent
d096e86
commit 8217f3f
Showing
3 changed files
with
71 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters