Skip to Content
Menu
This question has been flagged
2 Replies
3147 Views

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
Discard
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
Discard
Author

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
Discard
Author

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

Author

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 Replies Views Activity
1
Jul 23
2109
1
Jul 15
3784
0
May 15
7358
1
Aug 22
11728
0
Nov 20
3894