Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I have this code and works fine, but i need get default value to wpartner_id when the form is open to create a new record.
'wpartner_id': fields.related('incidencia_id', 'partner_id', type="many2one", relation="res.partner", string="Cliente Incidencia", store=True),
How can i do it ?
_get_default_wpartner is a function that returns default wpartner.
def _get_default_wpartner(self, cr, uid, context=None): your code your condition #Something like Following domain =  # condition res = self.pool.get('res.partner').search(cr, uid, domain, limit=1) return res and res or False
Hope it work for you.
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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 6/25/13, 6:20 AM|
|Seen: 5239 times|
|Last updated: 3/16/15, 8:10 AM|