def update_product_by_location(self, cr, uid, context=None):
        context = context or self.pool['res.users'].context_get(cr, uid)
        location_ids = self.search(cr, uid, [('update_product_bylocation', '=', True)], context=context)
        location_vals = {}
        start_time = datetime.now()
        date_product_by_location_update = start_time.strftime(DEFAULT_SERVER_DATETIME_FORMAT)

        if location_ids:
            product_obj = self.pool['product.product']
            for location in self.browse(cr, uid, location_ids, context):
                location_vals[location.id] = location.product_related_columns
            product_ids = product_obj.search(cr, uid, [('type', '!=', 'service')], context=context)
            product_context = context.copy()

            product_vals = {}
            for product_id in product_ids:
                product_vals[product_id] = {}

            for location_keys in location_vals.keys():
                product_context['location'] = location_keys
                for product in product_obj.browse(cr, uid, product_ids, product_context):
                    if location_vals[location_keys] and (product[location_vals[location_keys]] != product.qty_available):
                        product_vals[product.id][location_vals[location_keys]] = product.qty_available

            if product_vals:
                for product_id in product_vals.keys():
                    product_val = product_vals[product_id]
                    if product_val:
                        product_val['date_product_by_location_update'] = date_product_by_location_update
                        product_obj.write(cr, uid, product_id, product_val, context)

        end_time = datetime.now()
        duration_seconds = (end_time - start_time)
        duration = '{sec}'.format(sec=duration_seconds)
        _logger.info(u'update_product_by_location get in {duration}'.format(duration=duration))
        return True