[FIX] Fix to get purchase suggest work without the need to patch (#24)

* Fix to get it work without the need to patch
This commit is contained in:
Levent Karakaş
2016-11-22 11:45:03 +03:00
committed by Alexis de Lattre
parent b9e07ea986
commit 891c64bb1f
2 changed files with 11 additions and 13 deletions

View File

@@ -20,10 +20,20 @@
#
##############################################################################
from openerp import models, fields
from openerp import models, fields, api
class StockWarehouseOrderpoint(models.Model):
_inherit = 'stock.warehouse.orderpoint'
suggest = fields.Boolean(string='Suggest', default=True)
class ProcurementOrder(models.Model):
_inherit = 'procurement.order'
@api.model
def _product_virtual_get(self, order_point):
if order_point.suggest:
return None
return super(ProcurementOrder, self)._product_virtual_get(order_point)