diff --git a/stock_move_location/wizard/stock_move_location.py b/stock_move_location/wizard/stock_move_location.py
index ae8ee7c48..cc64a9b02 100644
--- a/stock_move_location/wizard/stock_move_location.py
+++ b/stock_move_location/wizard/stock_move_location.py
@@ -11,6 +11,14 @@ class StockMoveLocationWizard(models.TransientModel):
_name = "wiz.stock.move.location"
_description = 'Wizard move location'
+ @api.multi
+ def _get_default_picking_type_id(self):
+ company_id = self.env.context.get('company_id') or \
+ self.env.user.company_id.id
+ return self.env['stock.picking.type'].search(
+ [('code', '=', 'internal'),
+ ('warehouse_id.company_id', '=', company_id)], limit=1).id
+
origin_location_disable = fields.Boolean(
compute='_compute_readonly_locations')
origin_location_id = fields.Many2one(
@@ -32,7 +40,8 @@ class StockMoveLocationWizard(models.TransientModel):
comodel_name="wiz.stock.move.location.line",
)
picking_type_id = fields.Many2one(
- comodel_name='stock.picking.type'
+ comodel_name='stock.picking.type',
+ default=_get_default_picking_type_id,
)
picking_id = fields.Many2one(
string="Connected Picking",
@@ -88,8 +97,7 @@ class StockMoveLocationWizard(models.TransientModel):
def _create_picking(self):
return self.env['stock.picking'].create({
- 'picking_type_id': self.picking_type_id.id or
- self.env.ref('stock.picking_type_internal').id,
+ 'picking_type_id': self.picking_type_id.id,
'location_id': self.origin_location_id.id,
'location_dest_id': self.destination_location_id.id,
})
diff --git a/stock_move_location/wizard/stock_move_location.xml b/stock_move_location/wizard/stock_move_location.xml
index 9b864ab5f..1463380db 100755
--- a/stock_move_location/wizard/stock_move_location.xml
+++ b/stock_move_location/wizard/stock_move_location.xml
@@ -14,6 +14,9 @@
+
+
+