~unifield-team/unifield-addons/us-926-addons

« back to all changes in this revision

Viewing changes to product/product.py

  • Committer: jf
  • Date: 2016-01-25 10:54:56 UTC
  • mfrom: (4676.4.6 unifield-addons)
  • Revision ID: jfb@tempo-consulting.fr-20160125105456-35g7y8bqwe5aisj2
SP-223 [IMP] Improve sync execution time
lp:~fabien-morin/unifield-addons/fm-sp-223

Show diffs side-by-side

added added

removed removed

Lines of Context:
487
487
        for product in self.browse(cr, uid, ids, context=context):
488
488
            tmpl_id = product.product_tmpl_id.id
489
489
            # Check if the product is last product of this template
490
 
            other_product_ids = self.search(cr, uid, [('product_tmpl_id', '=', tmpl_id), ('id', '!=', product.id)], context=context)
 
490
            other_product_ids = self.search(cr, uid, [('product_tmpl_id', '=',
 
491
                tmpl_id), ('id', '!=', product.id)], limit=1, order='NO_ORDER',
 
492
                context=context)
491
493
            if not other_product_ids:
492
494
                 unlink_product_tmpl_ids.append(tmpl_id)
493
495
            unlink_ids.append(product.id)
772
774
                price = currency_pool.compute(cr, uid, pricelist_pool.browse(cr, uid, pricelist_id).currency_id.id, currency_id, price)
773
775
 
774
776
            # Compute price from supplier pricelist which are in Supplier Information
775
 
            supplier_info_ids = self.search(cr, uid, [('name','=',supplier.id),('product_id','=',product_id)])
 
777
            supplier_info_ids = self.search(cr, uid,
 
778
                    [('name','=',supplier.id),('product_id','=',product_id)],
 
779
                    order='NO_ORDER')
776
780
            if supplier_info_ids:
777
781
                cr.execute('SELECT * ' \
778
782
                    'FROM pricelist_partnerinfo ' \