my first answar is correct now i will give a solution if you don't want to change the selection:
Create a wizard to affect a car to user :
class AffectCar(model.TransientModel):
_name = 'affect.user.car.wizard'
use_id = fields.Many2one(..) # you know how you do it
car_name = fields.Selection(selection='_get_car_selection', 'Car name')
def _get_car_selection(self):
"""
generate a selection for field car_name according to
the default user_id passed to this form
"""
# get all car name that this user don't have
# generate the selection [('car_name','car_name')..]
return computed_selection
def create_user_car(self):
""" save a new tbbl_car_user record """
# this method is called from the form of the wizard
# save the user_id and the car_name in tbl_car_user
now add a button to the user form and call a method to open the wizard form with user_id by default is the
same user
@api.multi()
def add_car(self):
"""
open the wizard to add a car
to this user
"""
return {
'type': 'ir.actions.act_window',
'view_mode': 'form',
'view_type': 'form',
'res_model':'affect.user.car.wizard',
'target': 'new',
'context': {
# pass the id the the user to the wizard
'default_use_id': self.id,
},
}
one thing to prevent the user of you application from changing the user_id when the popup is shown
make the user is in the form view of the wizard invisble="1"
<record id="add_car_wizard" model="ir.ui.view">
<field name="name">tax.adjustments.wizard.form</field>
<field name="model">tax.adjustments.wizard</field>
<field name="arch" type="xml">
<form>
<group>
<field name="user_id" invisible="1"/>
<field name="car_name"/>
</group>
<footer>
<button name="create_user_car" string="Add car" type="object" class="oe_highlight"/>
or
<button string="Cancel" special="cancel" />
</footer>
</form>
</field>
</record>