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

I would like to create a from with fields which are not saved to the database.
The data should be sent to an webservices to check availabillity.

Can someone give me an example... ?

 

Thnx !

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

Hi Look at how to do a wizard?

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

For this you could use the new orm.transientmodel class. This will create a record in database like the regular orm/osv models but it will auto-remove itself after a certain period of time (I believe the default is 5 or 10 minutes).

You can create forms and such like you normally would with any other object/view.

--- EDIT ---

I meant osv.AbstractModel.

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

Hello Tom,

You can try out overriding "fields_view_get" method where you can create fields which are not there in the database, and then you can use those fields values for sending to a webservice, so actually, as the fields don't belongs to any of the model they will not get save in the database. This way actaully you are creating a dynamic view.

 

Regards

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