Openerp optimization patch