Skip to Content
Menu
This question has been flagged
1 Reply
5831 Views

odoo 10


Hi,


I have multiple warehouses and locations and need to be able to specify the source location for each sale. Currently when I set the delivery for a sale, odoo selects the source location automatically. How can I manually set the source location?


Apparently there was a module for this in odoo 7 (stock_picking_location). Any solution for odoo 10?


Thanks

Avatar
Discard
Best Answer

Hi odoor,

You can specify source location when stock move create from sale order.

so you need to call super method of create and you can add source location.

also need find there which location you want to set.

stock move have picking_type_id and warehouse_id based on that field, you can set source location in SO.

for example:

class StockMove(models.Model):

 _inherit='stock.move'

@api.model

def create(self,vals):

    stock_picking_data = self.env['stock.picking.type'].browse(vals.get('picking_type_id'))

    if stock_picking_data.code == 'incoming':

         warehouse_data = self.env['stock.warehouse'].browse(vals.get('warehouse_id'))

         if warehouse_data:

            your condition here which location you want to set.

    return super(StockMove,self).create(vals)

Hope this help you.

Best Thanks,

Ankit H Gandhi.

Avatar
Discard