I created a different department section for vendors, now I need to display the department in another field. Whenever I select the vendor, only the department related to that particular vendor should be chosen but it shows all the departments in another field. can anyone help me out there?
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
1
Reply
1236
Views
Hi Santosh,
I think by returning domain to your new field in onchange function of the field vendor will solve your issue.
Try this:
@api.onchange('partner_id')
def _onchange_partner_id(self):
self.department_id_field = False
if self.partner_id:
domain = [('vendor_field_in_department', '=', self.partner_id.id)]
return {'domain': domain}
Hope this will work for you
Thank you
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