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

Anybody has any ideas if there is a way to skip required fields while using external api?

And one other question as well: so I have 900K customers and now I want to add orders of them to sale.order model. But the field which is connecting both is one2many. Which is big problem. Any ideas how I can handle it? Any ways to fill one2many field with values rather than id's or so?


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

If the field is marked as required, you won't be able to bypass it easily.

If you would like a field to be required through the interface but not at the server level, the easiest way is to make it required=False in the field definition, but put required="1" in the view definition. This means anyone entering a record on the page is forced to add it, but through the api you don't need it.

However, if you open a record that was created through the api, you won't be able to save any changes until the field is set.


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 7 22
3783
5
thg 4 17
16089
1
thg 3 15
7361
0
thg 6 22
1841
1
thg 5 21
4830