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 dont know how to change many2one field in onchange method.
What i need to do is: when someone is creating a new invoice and changing currency, bank account changing in the same time. I'm using exception to have a look at the value of partner_bank_account.
raise except_orm(('Warning!'), (self.partner_bank_id))
You may try like this, if you use single partner bank account for one currency:
bank_account_rec = self.env['res.partner.bank'].search(['currency_id','=',self.currency_id.id])
self.partner_bank_id = bank_account_rec.id
Hope this helps!
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: 5/9/16, 4:42 AM|
|Seen: 695 times|
|Last updated: 5/9/16, 7:26 AM|