[WIP] stock: added supply_method 'None'

bzr revid: qdp-launchpad@openerp.com-20130712163124-w3eac1coevpqfp9q
This commit is contained in:
Quentin (OpenERP)
2013-07-12 18:31:24 +02:00
parent a0318270f5
commit 02b078788c
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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),
}
+4 -4
View File
@@ -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 {
+1 -1
View File
@@ -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',