I'd like to modify res_partner in an onchange. I'm currently doing this:
@api.onchange('my_field')
def onchange_model_type(self):
var = 0
for res_id in res_partner:
if self.name == res_id: #name is a many2one in this model which
#leads to res_partern
#I check here if res_id is the good partner
res_id.house = 2 #house is a many2one in res_partner to
#a 3rd model.
I get : NameError: global name 'res_partner' is not defined
How do I import res_partner so I don't have this error anymore and I can modify it?
(I already tried self.name.house = 2
but it don't works, that's why I go straight to res_partner)