diff --git a/addons/procurement/procurement_view.xml b/addons/procurement/procurement_view.xml
index e2cd8990bd2..be2ed8fc097 100644
--- a/addons/procurement/procurement_view.xml
+++ b/addons/procurement/procurement_view.xml
@@ -30,13 +30,13 @@
-
+
-
+
@@ -49,6 +49,7 @@
+
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index c1525a70f6f..ff9f95fd2ce 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -658,7 +658,9 @@ class sale_order(osv.osv):
procurement_obj = self.pool.get('procurement.order')
for order in self.browse(cr, uid, ids, context=context):
proc_ids = []
- group_id = self.pool.get("procurement.group").create(cr, uid, {'name': order.name}, context=context)
+ group_id = self.pool.get("procurement.group").create(cr, uid, {
+ 'name': order.name, 'partner_id': order.partner_shipping_id.id
+ }, context=context)
order.write({'procurement_group_id': group_id}, context=context)
for line in order.order_line:
if (line.state == 'done') or not line.product_id:
diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py
index 7cf905bdcfa..12d8a059db9 100644
--- a/addons/stock/procurement.py
+++ b/addons/stock/procurement.py
@@ -84,6 +84,7 @@ class procurement_order(osv.osv):
'move_dest_id': procurement.move_dest_id and procurement.move_dest_id.id or False,
'procurement_id': procurement.id,
'rule_id': procurement.rule_id.id,
+ 'origin': procurement.origin,
'picking_type_id': procurement.rule_id.picking_type_id.id,
}
@@ -94,7 +95,9 @@ class procurement_order(osv.osv):
return False
move_obj = self.pool.get('stock.move')
move_dict = self._run_move_create(cr, uid, procurement, context=context)
+ print '***', move_dict
move_id = move_obj.create(cr, uid, move_dict, context=context)
+ print '***', move_id, move_dict
move_obj.action_confirm(cr, uid, [move_id], context=context)
return move_id
return super(procurement_order, self)._run(cr, uid, procurement, context)
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 494393a3943..9d1599f22ac 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -942,7 +942,7 @@ class stock_move(osv.osv):
'company_id': fields.many2one('res.company', 'Company', required=True, select=True),
'backorder_id': fields.related('picking_id','backorder_id',type='many2one', relation="stock.picking", string="Back Order of", select=True),
- 'origin': fields.related('picking_id','origin',type='char', size=64, relation="stock.picking", string="Source", store=True),
+ 'origin': fields.char("Source"),
'procure_method': fields.selection([('make_to_stock','Make to Stock'),('make_to_order','Make to Order')], 'Procurement Method', required=True, help="Make to Stock: When needed, the product is taken from the stock or we wait for replenishment. \nMake to Order: When needed, the product is purchased or produced."),
# used for colors in tree views:
@@ -1164,7 +1164,7 @@ class stock_move(osv.osv):
'origin': move.origin,
'company_id': move.company_id and move.company_id.id or False,
'move_type': move.group_id and move.group_id.move_type or 'one',
- 'partner_id': move.partner_id and move.partner_id.id or False,
+ 'partner_id': move.group_id and move.group_id.partner_id and move.group_id.partner_id.id or False,
'date_done': move.date_expected,
'state': 'confirmed',
'group_id': move.group_id and move.group_id.id or False,
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index f9d6f104e82..88b7325d325 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -566,12 +566,12 @@
-
+
-
+