I'm using post_init_hook to run a method but this method will only run once during the module installation.
How can I make it run every time I update the odoo module?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Kế toán
- Tồn kho
- PoS
- Project
- MRP
Câu hỏi này đã bị gắn cờ
Hii Tiago Rangel,
->If you want to run a method on updation of the module you can write that method in post-migration files.
->Follow below steps to achieve that.
1)Create folder named "migrations" inside your module.
2)Create subfolder inside it and name should be the version of the module which you have specified in the __manifest__.py file.
3)Create file named "post-migration.py"
4)Inside that file create a function like this.
def migrate(cr, version):
YOUR LOGIC HERE
5)This method will execute once when the module updates.
->Note that if you change your manifest version,you need to create another folder with that version name and do the same process.
->You can refer following link for your reference-https://odoo-development.readthedocs.io/en/latest/maintenance/data-migration.html
Thanks & Regards,
Email: odoo@aktivsoftware.com
Skype: kalpeshmaheshwari
Bạn có hứng thú với cuộc thảo luận không? Đừng chỉ đọc, hãy tham gia nhé!
Tạo tài khoản ngay hôm nay để tận hưởng các tính năng độc đáo và tham gia cộng đồng tuyệt vời của chúng tôi!
Đăng kýBài viết liên quan | Trả lời | Lượt xem | Hoạt động | |
---|---|---|---|---|
|
2
thg 8 25
|
3471 | ||
|
1
thg 7 25
|
1605 | ||
|
1
thg 8 25
|
1153 | ||
|
0
thg 5 25
|
1932 | ||
|
2
thg 4 25
|
4258 |