Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
2 Vastaukset
3406 Näkymät

I'm trying to create a new model that inherits from res.partner, but I'm getting an error. Please give me an example of this case for my reference. Thanks a lot

Avatar
Hylkää
Paras vastaus

Hi,

You can inherit res.partner using this code:

class ResPartner(models.Model):
_inherit = 'res.partner'

As well as check that you inherited the correct view.

You may check this video: https://www.youtube.com/watch?v=46yecsKX2tw

Thanks.


Avatar
Hylkää
Paras vastaus

The below mentioned answer is correct. All you need to do is create a class and inherit res.partner model and Also check the view inheritance. if some other model has inherited the view of res.partner, you can check that by enabling debugging mode and click on debug menu and select edit view: form. There under the inherited views, you can see all the inherited views of res.partner. And another thing is sometimes when we create a field, it will not get loaded and shows field not found error when we try to upgrade from UI. To solve that you should upgrade from the configuration itself by passing parameter -u module name. Thank you.

Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
2
maalisk. 15
8596
4
maalisk. 15
17621
4
helmik. 25
2166
1
elok. 24
1913
2
marrask. 24
3042