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

Hello,


We have some custom developed modules. When we remove a field, we simply delete it from the code, increment the version in the manifest file and push the change. This way odoo.sh picks up the change and starts upgrading the module.

However, since v14, we get the following warnings when we do this:

odoo.addons.base.models.ir_model: Deleting field xxxxx (hint: fields should be explicitly removed by an upgrade script)


After searching, a way to remove that field without a warning is to write something like the following. (and some more trickery for many2many fields)

env['ir.model.fields'].search([...]).with_context(_force_unlink=True).unlink()


Is there something _standard_ in odoo to not have that warning?
_force_unlink starts with an underscore, so that's probably something subject to change.


Best regards,

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
1
thg 3 25
825
1
thg 2 22
3886
0
thg 10 21
1787
4
thg 2 25
15587
1
thg 12 23
1608