[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:
committed by
Alexis de Lattre
parent
b9e07ea986
commit
891c64bb1f
@@ -1,12 +0,0 @@
|
|||||||
diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py
|
|
||||||
index 7b067ed..98857e6 100644
|
|
||||||
--- a/addons/stock/procurement.py
|
|
||||||
+++ b/addons/stock/procurement.py
|
|
||||||
@@ -342,6 +342,7 @@ class procurement_order(osv.osv):
|
|
||||||
|
|
||||||
procurement_obj = self.pool.get('procurement.order')
|
|
||||||
dom = company_id and [('company_id', '=', company_id)] or []
|
|
||||||
+ dom.append(('suggest', '=', False))
|
|
||||||
orderpoint_ids = orderpoint_obj.search(cr, uid, dom)
|
|
||||||
prev_ids = []
|
|
||||||
while orderpoint_ids:
|
|
||||||
@@ -20,10 +20,20 @@
|
|||||||
#
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
from openerp import models, fields
|
from openerp import models, fields, api
|
||||||
|
|
||||||
|
|
||||||
class StockWarehouseOrderpoint(models.Model):
|
class StockWarehouseOrderpoint(models.Model):
|
||||||
_inherit = 'stock.warehouse.orderpoint'
|
_inherit = 'stock.warehouse.orderpoint'
|
||||||
|
|
||||||
suggest = fields.Boolean(string='Suggest', default=True)
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user