$collection = Mage::getResourceModel($this->_getCollectionClass());
		//join field from order
		$collection->getSelect()->join('sales_flat_order', 'main_table.entity_id = sales_flat_order.entity_id',array('is_partner'));
        // baypass ambigous column in where clause
        $collection->addFilterToMap('is_virtual', 'main_table.is_virtual');
        $collection->addFilterToMap('status', 'main_table.status');
        $collection->addFilterToMap('created_at', 'main_table.created_at');
        $collection->addFilterToMap('base_grand_total', 'main_table.base_grand_total');
        $collection->addFilterToMap('grand_total', 'main_table.grand_total');
        $collection->addFilterToMap('increment_id', 'main_table.increment_id');

Leave a reply

Your email address will not be published.