[IMP] openupgrade_160, openupgrade_tools: BS4 to BS5 transformation yeahhhhh#1
Conversation
…ranslation [FIX] delete_record_translation: invalid input syntax for type json
…ranslation [FIX] delete_record_translations: error when only update for 1 one column
[ADD] get_model2table: method to map nonstandard table names
[FIX] merge_records: assure don't break on method="orm" if KeyError on model
…ry,date,datetime,selection
|
@ngochuy97hp a Huy có thể check xem e có miss case nào trong việc migration BS5 này ko với ạ |
ok e |
|
@duong77476 a chưa rõ có miss case nào hay ko nhưng bản staging của Viindoo (staging.viindoo.com) đang có rất nhiều template ngoài website mà chưa đc migrate sang BS5 |
Có thể do đoạn query này chưa đủ ạ https://github.com/Viindoo/OpenUpgrade/blob/5601d50ab7378de73055a4658ea419666ebdf0cf/openupgrade_scripts/scripts/website/16.0.1.0/pre-migration.py#L82 , A check var xem e query như này cần thêm gì không a và có thể thử vs DB Viindoo xem nó được nhiêu bản ghi ạ |
openupgradelib/openupgrade_160.py
Outdated
| _r("rounded-sm", "rounded-0"), | ||
| _r("rounded-lg", "rounded-1"), |
There was a problem hiding this comment.
| _r("rounded-sm", "rounded-0"), | |
| _r("rounded-lg", "rounded-1"), | |
| _r("rounded-sm", "rounded-1"), | |
| _r("rounded-lg", "rounded-3"), |
| _r("custom-control-input", "form-check-input"), | ||
| _r("custom-control-label", "form-check-label"), | ||
| _r("custom-switch", "form-switch"), | ||
| _r("custom-select", "form-select"), |
There was a problem hiding this comment.
viết kiểu này thì nó có đè cả custom-select-sm thành form-select-sm không? Cả -lg nữa, anh thấy trên staging chưa được.
There was a problem hiding this comment.
@ngochuy97hp A cho e xin link cái page đó để có gì e test thử
cc @phamgiang2510 @royleviindoo
There was a problem hiding this comment.
There was a problem hiding this comment.
Nếu thế thì chắc phải viết hẳn ra kiểu _r("custom-select-sm", "form-select-sm") , tương tự với lg. Còn viết như trên nó chỉ selector đến đúng class đó xong replace thôi ạ
openupgradelib/openupgrade_160.py
Outdated
| _r("mr", "me"), | ||
| # Forms | ||
| _r("custom-control", "form-control"), | ||
| _r("custom-check", "form-check"), |
There was a problem hiding this comment.
| _r("custom-check", "form-check"), | |
| _r("custom-checkbox", "form-check"), |
There was a problem hiding this comment.
custom-checkbox mới đúng.
Ở BS4 1 checkbox sẽ cần cặp custom-control custom-checkbox nhưng lên BS5 nó chỉ còn form-check
Ở trên có đoạn replace custom-control thành form-control. Như vậy sẽ thành form-control form-check -> lỗi
There was a problem hiding this comment.
à đungs rồi, chắc e viết nhầm 👯
| _r("pl", "ps"), | ||
| _r("pr", "pe"), | ||
| _r("ml", "ms"), | ||
| _r("mr", "me"), |
There was a problem hiding this comment.
Mấy cái này nó cũng có sm với lg đấy
There was a problem hiding this comment.
Đúng rồi , e vừa search có cả kiểu ms-1 xong cả ms-sm-2 nữa, theo như https://getbootstrap.com/docs/5.0/utilities/spacing/ đây sẽ có nhiều case hơn để cover ✌️
a1759d0 to
4f04503
Compare
|
@ngochuy97hp E đã sửa a nhé, a test được với db Viindoo thì có thể cài lại thư viện để test cc @phamgiang2510 |
openupgradelib/openupgrade_160.py
Outdated
| _r( | ||
| "text-justify", "text-center" | ||
| ), # actually boostrap 5 only drop without any replacements |
There was a problem hiding this comment.
cái này chuyển thành style inline style="text-align: justify;"
There was a problem hiding this comment.
Vâng a, e search thấy thằng odoo ko có class naò trong core cả, phải inline rồi :((
4f04503 to
b0e1d53
Compare
| _class_rp_by_inline( | ||
| selector="//*[contains(@class, 'text-justify')]", | ||
| selector_mode="xpath", | ||
| class_rp_by_inline={"text-justify": ["text-align: justify"]}, | ||
| ), | ||
| _r(class_rm="text-justify", class_add=""), |
| if class_rp_by_inline: | ||
| inline_style = "" | ||
| for _, value in class_rp_by_inline.items(): | ||
| for inline_css_style in value: | ||
| inline_style += inline_css_style + ";" | ||
| if "style" in node.attrib and node.attrib["style"]: | ||
| node.attrib["style"] += inline_style | ||
| else: | ||
| node.attrib["style"] = inline_style |
There was a problem hiding this comment.
Done #1 (comment)
Video test : https://drive.google.com/file/d/1zc2YCuE07w1hz3AFRbeVIpzAPlZ7xnVB/view?usp=sharing . E ko biết thêm class text-justify bằng website editor kiểu gì nên sửa view thủ công
fix filtering of columns in delete_record_translations() for versions >= 16. the loop was wrong as it was changing the size of the list while looping over it.
…umns_16 [FIX] fix columns filter in `delete_record_translations()` for versions >= 16
…irst_not_null-mle [IMP] openupgrade_merge_records: add first_not_null operation on several field types
b0e1d53 to
b76b002
Compare
| _r("custom-control", "form-control"), | ||
| _r("custom-checkbox", "form-check"), |
There was a problem hiding this comment.
ok anh để e xử ở con master của em
There was a problem hiding this comment.
@ngochuy97hp Kiểu như này đúng ko a
_r( selector=".custom-checkbox + .custom-control", class_rm="custom-checkbox", class_add="form-check" ),
e chưa test , thấy thằng khác dùng như thế thôi
cc @royleviindoo
There was a problem hiding this comment.
à có khi ko cần dấu +
There was a problem hiding this comment.
There was a problem hiding this comment.
anh chưa đọc cái hàm _r này miễn là 2 thằng này custom-checkbox custom-control biến thành form-check là được
There was a problem hiding this comment.
@ngochuy97hp oh ok a, vậy nó nên là
_r( selector=".custom-checkbox .custom-control", class_rm="custom-checkbox custom-control", class_add="form-check", ),
nghĩa là selector đến element nào có 2 class trên, xóa 2 thk đó thay bằng thk form-check

PR OCA:
https://github.com/OCA/openupgradelib/pull/338