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

Hi,

I'm using ODOO 10 and I've been looking everywhere for this but I can't find an answer to this problem.

I want some fields to be 'required' only when the form is in edit mode.

I tried attrs="{'required': [('id','>',0)]}" but it works only for new records.


My problem is that I can't click on "toggle_active" or any other button  for a partner that does'nt have required fields. This is really anoying.


Any help appriciated.


Ảnh đại diện
Huỷ bỏ

Can you provide more info about the issue?

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

Sorry to disagree but it makes perfect sense when you add a new field to a model with already existing records which don't have a value for said field and thus that prevents you from using some actions.

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

Hi,

Basicaly my problem is that I want to be able to click on any "action" button of the partner form and not be blocked if any of the required fields are not set.

Ảnh đại diện
Huỷ bỏ

Basicaly, when a field is set as required, it must be filled for proper computation; otherwise, you'll not get what you are looking for.

Could you please tell me which fields you are unable to fill?

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

Hi, 

It does not make sense to make a field required on form's edit mode only.

It is either to make the field required (whenever you hit the create button), or the field is required under a condition, like if some other field has a value or a certain value.

Ảnh đại diện
Huỷ bỏ