跳至內容
選單
此問題已被標幟
2 回覆
3726 瀏覽次數

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

頭像
捨棄
最佳答案

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.


頭像
捨棄
最佳答案

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.

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
3月 15
8783
4
3月 15
17774
4
2月 25
2645
1
8月 24
2219
2
11月 24
3352