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

As far as I konw, flush() method updates the values from the cache to the database while 

self.env.cr.commit() allows us to commit changes to the database.

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

In short, the changes applied to the database using flush() are visible only within that transaction/session and can be rolled back, if required. commit() does the final write to the database that makes the changes visible to everyone and cannot be rolled back.

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

Thanks, you’ve helped make it clearer.