mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[IMP] Synchronize Picking Type and Warehouse
[IMP] User write()
This commit is contained in:
committed by
Reed Hayashikawa
parent
f41c3afd20
commit
b423e73ec4
@@ -19,3 +19,12 @@ class StockRequestOrder(models.Model):
|
||||
picking_type_id = fields.Many2one(
|
||||
'stock.picking.type', 'Operation Type',
|
||||
default=_get_default_picking_type, required=True)
|
||||
|
||||
@api.onchange('warehouse_id')
|
||||
def onchange_warehouse_picking_id(self):
|
||||
if self.warehouse_id:
|
||||
picking_type_id = self.env['stock.picking.type'].\
|
||||
search([('code', '=', 'stock_request_order'),
|
||||
('warehouse_id', '=', self.warehouse_id.id)], limit=1)
|
||||
if picking_type_id:
|
||||
self._origin.write({'picking_type_id': picking_type_id.id})
|
||||
|
||||
Reference in New Issue
Block a user