[base_sale_multichannel] export inventory, the stock of each product are exported repeatedly

Bug #579542 reported by Sébastien BEAU - http://www.akretion.com
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Magento OpenERP Connector
Fix Released
High
Raphaël Valyi - http://www.akretion.com

Bug Description

When you export the inventory, the stock of each product will be exported severals time.
And in some time it's look like the synchronization is infinite, because the same product will be export 10, 100 times or mores...
This bug is due to the fact that the products_ids come from the move in the inventory so if a product will be sold 2 times you get 2 moves and so you will have in the product_ids a double and so you will synchronize twice the stock of this products.

So before synchronize, this code " product_ids = [x for x in set(product_ids)] " is needed to delete all double

=================== line 171
else:
recent_move_ids = self.pool.get('stock.move').search(cr, uid, [('product_id', 'in', product_ids)])
product_ids = [move.product_id.id for move in self.pool.get('stock.move').browse(cr, uid, recent_move_ids)]
product_ids = [x for x in set(product_ids)] #HERE
res = self.pool.get('product.product').export_inventory(cr, uid, product_ids, '', ctx) 16:56

====================

Changed in magentoerpconnect:
assignee: nobody → Raphaël Valyi - http://www.akretion.com (rvalyi)
importance: Undecided → High
Revision history for this message
Raphaël Valyi - http://www.akretion.com (rvalyi) wrote :

Ok, this has been fixed now.

Changed in magentoerpconnect:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.