[IMP][16.0] website_forum: faq also need BS5 migration#533
Conversation
c6675ac to
92b9ab9
Compare
305ccae to
63461a3
Compare
7c30f83 to
dd100f0
Compare
|
@duong77476 bao giờ cái PR này done thì báo a cái nhé, để a chạy migrate :v |
Vâng a, để test chạy xong xem lỗi j không đã ạ, e có test ở local ăn rồi :v |
|
@phamgiang2510 Xong rồi anh ơi, a nhớ cài lại thư viện như e note ở đầu mô tả PR anh nha |
|
@phamgiang2510 A chạy ra file log với tham số --logfile anh nhé, để có gì còn check var được ạ |
db6b2c8 to
afbc23b
Compare
| def _bs5_field_migration(env): | ||
| forums = env["forum.forum"].with_context(active_test=False).search([]) | ||
| for forum in forums: | ||
| forum.faq = convert_string_bootstrap_4to5(forum.faq) | ||
|
|
||
|
|
||
| @openupgrade.migrate() | ||
| def migrate(env, version): | ||
| _bs5_field_migration(env) | ||
| migrate_translations_to_jsonb(env, [("forum.forum", "faq")]) |
There was a problem hiding this comment.
Em xử lý thêm cho ticket https://viindoo.com/web#id=48829&cids=1&menu_id=777&action=1074&active_id=39&model=helpdesk.ticket&view_type=form . Có lẽ với các trường luu dạng html thì cũng cần phải booostrap migration
013e30f to
4dd4630
Compare
|
@duong77476 anh có thay bằng PR #536, em xem có cần PR này nữa không nhé |
Chỉ cần giữ lại commit sau cùng thôi ạ |
@duong77476 vậy revert và squash lại giúp anh nhé |
158762b to
ffed07c
Compare
| def _bs5_field_migration(env): | ||
| forums = env["forum.forum"].with_context(active_test=False).search([]) | ||
| for forum in forums: | ||
| forum.faq = convert_string_bootstrap_4to5(forum.faq) |
There was a problem hiding this comment.
@duong77476 có cần làm tổng quát không em? kiểu như tìm tất cả các trường kiểu html, và cho qua hàm convert_string_bootstrap_4to5?
| forum.faq = convert_string_bootstrap_4to5(forum.faq) | |
| new_faq = convert_string_bootstrap_4to5(forum.faq) | |
| if forum.faq != new_faq: | |
| forum.faq = new_faq |
There was a problem hiding this comment.
@royleviindoo Nhưng cần lấy giá trị của trường thi có cách nào tổng quát không ạ
There was a problem hiding this comment.
@duong77476 anh merge trước, về cơ bản thì anh thấy vẫn cần làm tổng quát để tránh sót
em thử theo hướng như này nhé
xử lý ở end-migration:
- select tất cả model, tên field từ bảng
ir.model.fieldscóstore=True and ttype='html' - sau đó search_read tất cả các model tìm được ở trên, đọc các fields ở trên với
domain=[] - convert và write nó nếu có khác biệt về giá trị
There was a problem hiding this comment.
@royleviindoo Vâng a, tạm thời e tạo issue ở : #537 xử sau ạ
ffed07c to
d4cea80
Compare
No description provided.