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.
When loading a register with a computed field (example, a new sale margin field computed out of price and cost), I see that it is not populated with the value. Why? and how can I make the value being displayed?
It is properly stored in database.
To write a on_change method in .py file like this,
def on_change_emp_dept(self, cr, uid, ids, employee_id, context=None):
dept_id = False
emp_pool = self.pool.get("hr.employee")
emp_obj = emp_pool.browse(cr, uid, employee_id, context=context)
dept_id = emp_obj and emp_obj.department_id.id or False
Invoke method in .xml file write like this,
<field name="employee_id" on_change="on_change_emp_dept(employee_id)" />
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: 2/7/16, 10:04 AM|
|Seen: 745 times|
|Last updated: 2/8/16, 1:40 AM|