Odoo Help

2 Answers
Justin Lessard
9/10/15, 12:28 PM

I've found the solution to my problem with the help of Kinner Vachhani.

I simply needed to create a function which will return the domain filter like this:

def _get_domain(self):

    ids = self.env.ref('the_package.the_external_id').ids
return [('product_tmpl_id','=', ids)]

the_field = fields.Many2one('product.product', required=False,   domain = _get_picking_product_domain)
Kinner Vachhani
9/10/15, 11:18 AM

You can get res_id (resource id) by searching ir_model_data. 

imd_obj = self.pool['ir.model.data']
ext_ids = imd_obj._get_id('module_name', 'external_identifier')

Ask a Question
Keep Informed
2 follower(s)
About This Community

This platform 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.

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now