ODOO13 odoo.tools.view_validation: Invalid XML: A simili button must be tagged with role=button

odoo.tools.view_validation: Invalid XML: A simili button must be tagged with "role='button'". 
@validate('calendar', 'diagram', 'form', 'graph', 'kanban', 'pivot', 'search', 'tree', 'activity')
def valid_simili_button(arch, **kwargs):
    """A simili button must be tagged with "role='button'"."""
    # Select elements with class 'btn'
    xpath = '//a[contains(concat(" ", @class), " btn")'
    xpath += ' or contains(concat(" ", @t-att-class), " btn")'
    xpath += ' or contains(concat(" ", @t-attf-class), " btn")]'
    xpath += '[not(@role="button")]'
    if arch.xpath(xpath):
        return "Warning"
    return True

在calendar、kanban、diagram 等視圖上,使用使用a標籤的時候 需要加上 role="button"

在odoo 的視圖上使用標籤,且標籤作爲按鈕使用時,加上 role="button"

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章