Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Many2one field with account.invoice not set to null on delete

By
Evans Bernier
on 11/23/15, 2:06 PM 422 views

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

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 11/23/15, 2:06 PM
Seen: 422 times
Last updated: 11/23/15, 2:08 PM