Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Setting a default destination location when manufacturing

By
Fabien M
on 7/6/16, 5:43 AM 268 views

Hello, 

I would like to know how to set the default destination location of my products when they are manufactured. Currently the default location is "stock" and it would be easier to set the provision location by default in my case. How can I do it ? Thank you.

1
Nikunj Antala
On 7/6/16, 6:42 AM

Hello Fabien,

Odoo set by default stock location in in MRP.

That stock location odoo get from this method if you want then you need change in this method. Or you can override 'location_dest_id' field and set default appropriate value.

def _dest_id_default(self, cr, uid, ids, context=None):

    try:

       location_model, location_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'stock', 'stock_location_stock')

       self.pool.get('stock.location').check_access_rule(cr, uid, [location_id], 'read', context=context)

    except (orm.except_orm, ValueError):

       location_id = False

    return location_id


Hope this help.



Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 7/6/16, 5:43 AM
Seen: 268 times
Last updated: 7/6/16, 6:42 AM