Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
2 Trả lời
3151 Lượt xem

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?

Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

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

Ảnh đại diện
Huỷ bỏ
Tác giả

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?

Câu trả lời hay nhất


Hi 

Try this code

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

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


Regards 

Ảnh đại diện
Huỷ bỏ
Tác giả

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

Tác giả

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.

Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 7 23
2116
1
thg 7 15
3793
0
thg 5 15
7364
1
thg 8 22
11734
0
thg 11 20
3910