Module odoo tại sao lại có lỗi khi upgrade?
Khi các lập trình viên viết các module odoo, đôi khi chúng ta thay đổi các thành phần giao diện của hệ thống (chúng ta hay gọi là thay đổi view của hệ thống) và khi chỉnh sửa sai cấu trúc của Odoo framework, upgrade module và gây lỗi database. Khi đó chúng ta không thể truy xuất vào database bị lỗi để upgrade lại module odoo với code đã chỉnh sữa để khắc phục lỗi. Nhưng làm cách nào để upgrade lại module khi chúng ta không thể truy xuất vào database?.
Bài viết này sẽ gửi đến các bạn mẹo nhỏ để khắc phục lỗi trên.
Hướng dẫn thực hiện
Truy cập PgAdmin
Các bạn có thể truy xuất trực tiếp vào database bị lỗi thông qua PgAdmin (Phần mềm hỗ trợ quản lý database cho Posgresql). Các bạn có thể tham khảo tại đây.
Sau khi truy cập PgAdmin bạn sẽ thấy giao diện sau:

Sửa lỗi database
Sau khi truy cập vào Pgadmin các bạn chọn database đang bị lỗi.
Chọn sử dụng câu truy vấn.
Gõ vào ô truy vấn câu lệnh SQL sau:
select * from ir_module_module where name = 'your_module'

Câu truy vấn trên sẽ giúp bạn tìm kiếm được module bạn đang upgrade bị lỗi.
your_module: tên module bạn đang upgrade bị lỗi.
Sau đó bạn chạy tiếp câu lệnh SQL sau:
update ir_module_module set state = 'installed' where id in(select * from ir_module_module where name = 'your_module')
Câu truy vấn trên sẽ chuyển trạng thái module của bạn từ trạng thái đang upgrade sang trạng thái đã cài đặt.

Vậy là bạn đã có thể đăng nhập vào database bị lỗi và upgrade lại module của mình.
Kết luận:
Mình vừa hướng dẫn các bạn cách khắc phục lỗi sau khi upgrade module odoo.
Các bạn có thể tham khảo thêm cách viết module tại đây.
I’m also writing to make you be aware of of the exceptional experience our girl undergone browsing your web site.
She came to find too many things, not to mention what it is like to possess a
marvelous teaching heart to get certain people without difficulty learn about certain complex things.
You undoubtedly did more than visitors’ desires. I appreciate you for distributing
those informative, trustworthy, educational and in addition easy tips about your topic to Tanya.
My blog post; ccna boot camp (Jessica)
Thanks to my father who told me about this blog,
this webpage is in fact remarkable.
Check out my web-site – test creator – Sadie,
Does your website have a contact page? I’m having a tough time locating it but, I’d
like to shoot you an email. I’ve got some ideas for your blog you might be interested
in hearing. Either way, great blog and I look forward to seeing it grow over
time.
Feel free to surf to my homepage; cpa exam (Deb)
Generally I don’t read post on blogs, however I would like to say that
this write-up very compelled me to take a look at and do it!
Your writing style has been surprised me. Thank
you, very great post.
Stop by my homepage :: police written exam
Does your website have a contact page? I’m having problems locating it
but, I’d like to shoot you an e-mail. I’ve got some ideas for
your blog you might be interested in hearing. Either way, great site and I look
forward to seeing it improve over time.
Here is my blog: pmp simulator
Post writing is also a fun, if you be familiar with after that you can write or
else it is difficult to write.
Feel free to visit my web-site :: cooper institute certification (Lourdes)