Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
3137 Visualizzazioni

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
Abbandona
Risposta migliore

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
Abbandona
Autore

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?

Risposta migliore


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
Abbandona
Autore

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

Autore

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.

Post correlati Risposte Visualizzazioni Attività
1
lug 23
2106
1
lug 15
3782
0
mag 15
7351
1
ago 22
11723
0
nov 20
3891