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

Hello,

I have a module that create invoice from some datas. In my model, I have a field that is linked to invoicing system (see below). When I create invoices, I put the invoice_id generated by accounting system in this field. I set ondelete to "set null", to remove the invoice Id in my model if I delete an invoice. The problem is that my field is not set to null when I delete an invoice, is still feeded with the original ID of the invoice. I do the same thing with some other models an I don't have any problem. Does the "account.invoice" have some constraints to do that? What is wrong?

invoice_id = fields.Many2one('account.invoice', ondelete='set null')

Thanks

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 11 24
2334
1
thg 10 23
8976
2
thg 11 23
7243
1
thg 1 21
2107
1
thg 3 15
5340