I have a many2one field:
car_name = fields.Many2one('fleet.vehicle', string="Vehicle", help="Vehicle")
I have the cars available now based on the condition on state_id
fleet_available_now = self.env['fleet.vehicle'].search([('state_id', 'in', [1, 2]),
])
I need to assign the 'fleet_available_now' values to 'car_name'
How to achieve this?
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
2
Replies
1182
Views
fleet_available_now = self.env['fleet.vehicle'].search([('state_id', 'in', [1, 2]),
])
if you want to show more than one value in this (car_name) than made that field many2many
Hello Rejini,
I think this not correct approach, because car_name is many2one field and it can be store only one value.
fleet_available_now = self.env['fleet.vehicle'].search([('state_id', 'in', [1, 2])]) this will
give more than one result some times.
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
Nov 24
|
272 | ||
|
1
Oct 24
|
335 | ||
|
4
Oct 24
|
326 | ||
Connect Odoo with unopim
Solved
|
|
2
Oct 24
|
362 | |
|
2
Dec 24
|
678 |