diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index 39641033bcc..e8a693bb37a 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -77,7 +77,7 @@ class procurement_rule(osv.osv): help="This field will fill the packing origin and the name of its moves"), 'group_id': fields.many2one('procurement.group', 'Procurement Group'), 'action': fields.selection(selection=lambda s, cr, uid, context=None: s._get_action(cr, uid, context=context), - string='Action', required=True) + string='Action', required=True), } diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py index 6b68fdf0d69..f5557b21e00 100644 --- a/addons/stock/procurement.py +++ b/addons/stock/procurement.py @@ -55,11 +55,11 @@ class procurement_order(osv.osv): return self.pool.get('procurement.rule').search(cr, uid, domain, context=context) def _find_suitable_rule(self, cr, uid, procurement, context=None): - res = super(procurement_order, self)._find_suitable_rule(cr, uid, procurement, context=context) + rule_id = super(procurement_order, self)._find_suitable_rule(cr, uid, procurement, context=context) if not res: - res = self._search_suitable_rule(cr, uid, procurement, [('action', '=', 'move'), ('location_id', '=', procurement.location_id.id)], context=context) - res = res and res[0] or False - return res + rule_id = self._search_suitable_rule(cr, uid, procurement, [('action', '=', 'move'), ('location_id', '=', procurement.location_id.id)], context=context) + rule_id = rule_id and rule_id[0] or False + return rule_id def _run_move_create(self, cr, uid, procurement, context=None): return { diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7f06c56acfa..c49fc6c978b 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -2514,7 +2514,7 @@ class product_template(osv.osv): _inherit = "product.template" _columns = { 'type': fields.selection([('product', 'Stockable Product'), ('consu', 'Consumable'), ('service', 'Service')], 'Product Type', required=True, help="Consumable: Will not imply stock management for this product. \nStockable product: Will imply stock management for this product."), - 'supply_method': fields.selection([('produce', 'Manufacture'), ('buy', 'Buy')], 'Supply Method', required=True, help="Manufacture: When procuring the product, a manufacturing order or a task will be generated, depending on the product type. \nBuy: When procuring the product, a purchase order will be generated."), + 'supply_method': fields.selection([('produce', 'Manufacture'), ('buy', 'Buy'), ('wait', 'None')], 'Supply Method', required=True, help="Manufacture: When procuring the product, a manufacturing order or a task will be generated, depending on the product type. \nBuy: When procuring the product, a purchase order will be generated."), } _defaults = { 'supply_method': 'buy',