Is it possible to have a Many2One field equal a default value? I am trying to have a Many2One field return a certain value from the menu I selected if a checkbox is true.
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
This question has been flagged
Hello Doug,
You just need to create the computed fields and put the condition on the function as per your requirements.
Feel free to ask if you still have any doubt.
Thanks
Anisha Bahukhandi
Hi,
For Many2one you can set a default value in different ways, like you can call a default function and set the default value for it, or you can make the field as computed function or you can achieve the same by passing default values in the context.
If you are looking to filter the values in the many2one field, based on the another field in the same form, you can return domain for the many2one field from the onchange of the first Field, you can see a example here: https://www.youtube.com/watch?v=IpXXYCsK2ow
And if you are looking to set the value of the Many2one field while changing a field value, you can write a onchange function for the first field, see: https://www.youtube.com/watch?v=qyRhjyp1MeE&list=PLqRRLx0cl0hoJhjFWkFYowveq2Zn55dhM&index=39
Thanks
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
Hope this tips will helps: https://www.scoop.it/t/learn-openerp