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

Can someone explain what is wrong? I get this when I try to delete a record from the model 'Order' in a custom module. I can delete records from every other model without any problems.

This is the error:


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

share your code

What exactly did you code in your custom module though? The query that you see in the traceback says "DELETE FROM order" but it should be "DELETE FROM sale.order". If you're writing a custom SQL query to delete records I should also say that it is a bad idea. The ORM has delete features by default so there should be a good reason for altering it.

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

Are you sure about the table name "order" ..if yes then its a syntax issue from you code you are not providing proper input.
Or try it from backend i.e from postgres query..  by connecting to the database, If it worked apply same logic in code.

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

I had to know that naming a module 'order' would bring complications. I copied all my code and changed the module name to something else and everything works now. Thank you for your answer!

Tác giả Câu trả lời hay nhất

I had to know that naming a model'order' would bring complications. I copied all my code and changed the model name to something else and everything works now. Thank you guys for your answer!

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 6 24
7887
1
thg 3 19
5870
8
thg 5 24
48426
2
thg 2 21
40780
2
thg 7 20
3615