Odoo:如何导入res_partner?

时间:2016-05-19 09:05:38

标签: python openerp odoo-8

我想在onc​​hange中修改res_partner。 我现在正在这样做:

@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.

我得到: NameError:未定义全局名称“res_partner”

如何导入res_partner以便我不再有此错误,我可以修改它?

(我已经尝试了self.name.house = 2但它不起作用,这就是我直接去res_partner的原因)

0 个答案:

没有答案