diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py index 495a3b7821c..c1268902d96 100644 --- a/addons/stock/procurement.py +++ b/addons/stock/procurement.py @@ -38,20 +38,22 @@ class procurement_rule(osv.osv): def _get_action(self, cr, uid, context=context): result = super(procurement_rule, self)._get_action(cr, uid, context=context) return result + [('move','Move From Another Location')] - -class procurement_order(osv.osv): - _inherit = "procurement.order" _columns = { - 'location_id': fields.many2one('stock.location', 'Source Location') - 'move_id': fields.many2one('stock.move', 'Move') - 'move_dest_id': fields.many2one('stock.move', 'Destination Move') + 'location_id': fields.many2one('stock.location', 'Destination Location') 'location_src_id': fields.many2one('stock.location', 'Source Location', help="Source location is action=move") } +class procurement_order(osv.osv): + _inherit = "procurement.order" + _columns = { + 'move_id': fields.many2one('stock.move', 'Move') + 'move_dest_id': fields.many2one('stock.move', 'Destination Move') + } + def _run(self, cr, uid, procurement, context=None): if procurement.rule_id and procurement.rule_id.action == 'move': - if not procurement.location_src_id: + if not procurement.rule_id.location_src_id: self.message_post(cr, uid, [procurement.id], body=_('No source location defined!'), context=context) return False move_obj = self.pool.get('stock.move') @@ -68,8 +70,8 @@ class procurement_order(osv.osv): or procurement.product_uom.id, 'partner_id': procurement.group_id and procurement.group_id.partner_id and \ procurement.group_id.partner_id.id or False, - 'location_id': procurement.location_src_id.id, - 'location_dest_id': procurement.location_id.id, + 'location_id': procurement.rule_id.location_src_id.id, + 'location_dest_id': procurement.rule_id.location_id.id, 'move_dest_id': procurement.move_dest_id and procurement.move_dest_id.id or False, 'cancel_cascade': procurement.rule_id and procurement.rule_id.cancel_cascade or False, 'group_id': procurement.group_id and procurement.group_id.id or False, diff --git a/addons/stock/product_view.xml b/addons/stock/product_view.xml index 986e07eb73d..2ea5fda1b68 100644 --- a/addons/stock/product_view.xml +++ b/addons/stock/product_view.xml @@ -30,7 +30,7 @@ - + @@ -40,15 +40,15 @@ product.template - - - - - + + + + + - - + + @@ -182,7 +182,7 @@

- Click to register a reception for this product. + Click to register a reception for this product.

Here you will find the history of all receptions related to this product, as well as all future receptions you are waiting @@ -235,5 +235,47 @@ + + product.product.procurement + product.product + + + +