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

I made a change to the create_from_ui function in pos.order file. I created a function, create_receipt_file, that turns the content in the order into a text file that creates the entire information. For some reason, when I try to do 

order_object =self.search([], limit=1, order='id desc') 
The order_object I get is not the last object but the one before it (let's say from interface I create pos.order(23), and I get pos.order(22). The strangest part is that when I try with debugging, it all works out properly( i get pos.order(22)).

I added a small time.sleep(2)  and this fixes it. But I am just curious to know what causes this error. 

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

Small change, because for some reason I can't edit the post. "it all works out properly( i get pos.order(22))." , should instead be "it all works out properly( i get pos.order(23))."

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 9 21
2072
0
thg 9 23
1481
6
thg 1 18
5204
3
thg 4 25
1216
0
thg 1 25
1346