コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2 返信
3140 ビュー

I am using delegation inheritance from res.partner model:

​_name = "bostana.vendor"
​_inherits = {"res.partner": "partner_id"}


,and I added some new fields in the "bostana.vendor" model. When I inherited the view form from "res.partner", I could not add my new fields in the form nor the related new action buttons.

Any suggestions please?

アバター
破棄
最善の回答

Hi

When inheriting from the "res.partner" model using delegation inheritance, you might face some challenges in customizing the view form to include your new fields and related action buttons. Here are a few suggestions to help you overcome this issue:

* Ensure that the field names you added in the "bostana.vendor" model match the field names used in the view form definition. The field names should be consistent for the inheritance to work correctly.
*  In the view definition of the form, make sure to include your new fields explicitly. You can do this by extending the existing form view or creating a new form view that inherits from the original "res.partner" form view and adds your fields accordingly.
* Ensure that the user or user group has the necessary access rights to view and modify the new fields. Verify the access rules and security settings for the "bostana.vendor" model and its related fields.

Hope it helps

アバター
破棄
著作者

Thanks Cybrosys!
You are specific.

I admit I faced a trouble related to the third point which is security after an effort with the first two points.

I now do not know how to fix the security issue, Should I assign the "bostana.vendor" model the same security group and attributes of "res.partner" although I am still in the development mode using the admin privilege?

最善の回答


Hi 

Try this code

_inherits = {'res.partner': 'partner_id'}
_inherit = ['mail. thread', 'mail.activity.mixin']

partner_id = fields.Many2one('res.partner', string='Partner',)


Regards 

アバター
破棄
著作者

Hi Bella,
I tried this but I faced a security barrier, I can see the field but I can not modify it's values.

It says that I am not of the group!

make sure that security is added for that model that you're created

著作者

yes, it is added but I do not know why this kind of inheritance is hard to handle in views.

I am grateful that you are interested, and I will check it again trying my best.

関連投稿 返信 ビュー 活動
1
7月 23
2106
1
7月 15
3782
0
5月 15
7351
1
8月 22
11723
0
11月 20
3891