Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
2 Odgovori
3132 Prikazi

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?

Avatar
Opusti
Best Answer

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

Avatar
Opusti
Avtor

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?

Best Answer


Hi 

Try this code

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

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


Regards 

Avatar
Opusti
Avtor

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

Avtor

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.

Related Posts Odgovori Prikazi Aktivnost
1
jul. 23
2106
1
jul. 15
3782
0
maj 15
7350
1
avg. 22
11722
0
nov. 20
3891