diff options
45 files changed, 94 insertions, 87 deletions
diff --git a/addons/account/views/account_portal_templates.xml b/addons/account/views/account_portal_templates.xml index f40de7d3fc3..aa7f81ec3a3 100644 --- a/addons/account/views/account_portal_templates.xml +++ b/addons/account/views/account_portal_templates.xml @@ -1,6 +1,6 @@ <odoo> <template id="portal_my_home_menu_invoice" name="Portal layout : invoice menu entries" inherit_id="portal.portal_layout" priority="30"> - <xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside"> + <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside"> <li t-if="page_name == 'invoice'" class="active"> Invoices </li> @@ -8,7 +8,7 @@ </template> <template id="portal_my_home_invoice" name="Portal My Home : invoice entries" inherit_id="portal.portal_my_home" priority="30"> - <xpath expr="//ul[contains(@class,'o_portal_docs')]" position="inside"> + <xpath expr="//ul[hasclass('o_portal_docs')]" position="inside"> <li t-if="invoice_count" class="list-group-item"> <span class="badge" t-esc="invoice_count"/> <a href="/my/invoices">Invoices</a> @@ -63,4 +63,4 @@ </div> </t> </template> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/account_check_printing/views/account_journal_views.xml b/addons/account_check_printing/views/account_journal_views.xml index 95628770749..92989a46fa6 100644 --- a/addons/account_check_printing/views/account_journal_views.xml +++ b/addons/account_check_printing/views/account_journal_views.xml @@ -5,7 +5,7 @@ <field name="model">account.journal</field> <field name="inherit_id" ref="account.account_journal_dashboard_kanban_view" /> <field name="arch" type="xml"> - <xpath expr="//t[@t-name='JournalBodyBankCash']//div[contains(@class, 'o_kanban_primary_right')]" position="inside"> + <xpath expr="//t[@t-name='JournalBodyBankCash']//div[hasclass('o_kanban_primary_right')]" position="inside"> <div t-if="journal_type == 'bank' and dashboard.num_checks_to_print != 0"> <div class="row"> <div class="col-xs-12"> diff --git a/addons/account_payment/views/account_portal_templates.xml b/addons/account_payment/views/account_portal_templates.xml index 51919d918a9..50ce0f4fb88 100644 --- a/addons/account_payment/views/account_portal_templates.xml +++ b/addons/account_payment/views/account_portal_templates.xml @@ -1,6 +1,6 @@ <odoo> <template id="portal_my_invoices_payment" name="Payment on My Invoices" inherit_id="account.portal_my_invoices"> - <xpath expr="//table[contains(@class, 'o_my_status_table')]/thead/tr/th[last()]" position="before"> + <xpath expr="//table[hasclass('o_my_status_table')]/thead/tr/th[last()]" position="before"> <th></th> </xpath> <xpath expr="//t[@t-foreach='invoices']/tr/td[last()]" position="before"> @@ -11,4 +11,4 @@ </td> </xpath> </template> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/base_address_city/views/res_country_view.xml b/addons/base_address_city/views/res_country_view.xml index e221e2f9798..9e57ed5700b 100644 --- a/addons/base_address_city/views/res_country_view.xml +++ b/addons/base_address_city/views/res_country_view.xml @@ -5,7 +5,7 @@ <field name="model">res.country</field> <field name="inherit_id" ref="base.view_country_form"/> <field name="arch" type="xml"> - <xpath expr="//div[@class='oe_button_box']" position="inside"> + <xpath expr="//div[hasclass('oe_button_box')]" position="inside"> <button name="%(action_res_city_tree)d" class="oe_stat_button" icon="fa-globe" diff --git a/addons/base_setup/views/res_partner_views.xml b/addons/base_setup/views/res_partner_views.xml index 2fd1658d825..cad14d96a29 100644 --- a/addons/base_setup/views/res_partner_views.xml +++ b/addons/base_setup/views/res_partner_views.xml @@ -6,7 +6,7 @@ <field name="model">res.partner</field> <field name="inherit_id" ref="base.res_partner_kanban_view"/> <field name="arch" type="xml"> - <xpath expr="//div[contains(@class, 'oe_kanban_partner_categories')]" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_partner_categories')]" position="inside"> <span class="oe_kanban_list_many2many"> <field name="category_id" widget="many2many_tags" options="{'color_field': 'color'}"/> </span> diff --git a/addons/crm/views/crm_team_views.xml b/addons/crm/views/crm_team_views.xml index 0d15737638f..0ab63e75c73 100644 --- a/addons/crm/views/crm_team_views.xml +++ b/addons/crm/views/crm_team_views.xml @@ -184,7 +184,7 @@ <field name="use_opportunities"/> </xpath> - <xpath expr="//div[contains(@class, 'o_primary')]" position="after"> + <xpath expr="//div[hasclass('o_primary')]" position="after"> <div t-if="record.use_leads.raw_value and record.alias_name.value and record.alias_domain.value"> <small><i class="fa fa-envelope-o"></i>&nbsp; <field name="alias_id"/></small> </div> @@ -212,7 +212,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_view')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_view')]" position="inside"> <div t-if="record.use_leads.raw_value" groups="crm.group_use_lead"> <a name="%(crm_case_form_view_salesteams_lead)d" type="action"> Leads @@ -225,7 +225,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_new')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_new')]" position="inside"> <div t-if="record.use_opportunities.raw_value"> <a name="%(action_opportunity_form)d" type="action"> Opportunity @@ -233,7 +233,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div t-if="record.use_leads.raw_value" groups="crm.group_use_lead"> <a name="%(action_report_crm_lead_salesteam)d" type="action"> Leads diff --git a/addons/crm/views/res_partner_views.xml b/addons/crm/views/res_partner_views.xml index 8f0ec4da1f6..e01b6b3c424 100644 --- a/addons/crm/views/res_partner_views.xml +++ b/addons/crm/views/res_partner_views.xml @@ -69,7 +69,7 @@ <field name="opportunity_count"/> <field name="meeting_count"/> </field> - <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="inside"> <span class="badge" t-if="record.opportunity_count.value>0"><i class="fa fa-fw fa-star"/><t t-esc="record.opportunity_count.value"/></span> <span class="badge" t-if="record.meeting_count.value>0"><i class="fa fa-fw fa-calendar"/><t t-esc="record.meeting_count.value"/></span> </xpath> diff --git a/addons/hr_attendance/views/hr_department_view.xml b/addons/hr_attendance/views/hr_department_view.xml index 3c573b19bd3..6c874108b38 100644 --- a/addons/hr_attendance/views/hr_department_view.xml +++ b/addons/hr_attendance/views/hr_department_view.xml @@ -9,7 +9,7 @@ <field name="arch" type="xml"> <data> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(hr_attendance_action_graph_filtered)d" type="action"> @@ -22,4 +22,4 @@ </data> </field> </record> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/hr_expense/views/hr_dashboard.xml b/addons/hr_expense/views/hr_dashboard.xml index e9e9a67a8bd..1935fff051d 100644 --- a/addons/hr_expense/views/hr_dashboard.xml +++ b/addons/hr_expense/views/hr_dashboard.xml @@ -11,7 +11,7 @@ <field name="expense_sheets_to_approve_count"/> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside"> <div t-if="record.expense_sheets_to_approve_count.raw_value > 0" class="row"> <div class="col-xs-9"> <a name="%(action_hr_expense_sheet_department_to_approve)d" type="action"> @@ -24,7 +24,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_to_approve')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_to_approve')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(action_hr_expense_sheet_department_to_approve)d" type="action"> @@ -34,7 +34,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(action_hr_expense_sheet_department_filtered)d" type="action"> diff --git a/addons/hr_holidays/views/hr_views.xml b/addons/hr_holidays/views/hr_views.xml index 2d7635f1325..a026bc20794 100644 --- a/addons/hr_holidays/views/hr_views.xml +++ b/addons/hr_holidays/views/hr_views.xml @@ -15,7 +15,7 @@ <field name="absence_of_today"/> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside"> <div t-if="record.leave_to_approve_count.raw_value > 0" class="row"> <div class="col-xs-9"> <a name="%(hr_holidays_action_request_from_department)d" type="action"> @@ -38,7 +38,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="after"> + <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="after"> <div class="col-xs-12 o_kanban_primary_bottom"> <div class="row"> <div class="col-xs-3"> @@ -51,7 +51,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_to_approve')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_to_approve')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(hr_holidays_action_request_from_department)d" type="action"> @@ -69,7 +69,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(action_hr_holidays_leaves_analysis_filtered)d" type="action"> @@ -145,4 +145,4 @@ </field> </record> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/hr_recruitment/views/hr_department_views.xml b/addons/hr_recruitment/views/hr_department_views.xml index 008a1a1c36a..187499b3f41 100644 --- a/addons/hr_recruitment/views/hr_department_views.xml +++ b/addons/hr_recruitment/views/hr_department_views.xml @@ -13,7 +13,7 @@ <field name="expected_employee"/> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_primary_right')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_primary_right')]" position="inside"> <div t-if="record.new_applicant_count.raw_value > 0" class="row"> <div class="col-xs-9"> <a name="%(hr_applicant_action_from_department)d" type="action"> @@ -26,7 +26,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_to_do')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_to_do')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(hr_applicant_action_from_department)d" type="action"> @@ -36,7 +36,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(action_hr_recruitment_report_filtered_department)d" type="action"> @@ -59,4 +59,4 @@ <menuitem id="menu_hr_department" name="Departments" parent="menu_hr_recruitment_configuration" action="action_hr_department"/> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/hr_timesheet/views/hr_views.xml b/addons/hr_timesheet/views/hr_views.xml index d92c9680c66..d87abf0fb60 100644 --- a/addons/hr_timesheet/views/hr_views.xml +++ b/addons/hr_timesheet/views/hr_views.xml @@ -41,7 +41,7 @@ <field name="arch" type="xml"> <data> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(act_hr_timesheet_report)d" type="action" diff --git a/addons/hr_timesheet/views/project_views.xml b/addons/hr_timesheet/views/project_views.xml index c84663c2985..0a6b1446b8b 100644 --- a/addons/hr_timesheet/views/project_views.xml +++ b/addons/hr_timesheet/views/project_views.xml @@ -118,12 +118,12 @@ <field name="use_tasks" position="after"> <field name="allow_timesheets" invisible="1"/> </field> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]/div[last()]" position="after"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]/div[last()]" position="after"> <div attrs="{'invisible': [('allow_timesheets', '=', False)]}"> <a name="%(act_hr_timesheet_line_by_project)d" type="action">Timesheets</a> </div> </xpath> - <xpath expr="//div[contains(@class, 'o_project_kanban_box')]/div[last()]" position="after"> + <xpath expr="//div[hasclass('o_project_kanban_boxes')]/div[last()]" position="after"> <div attrs="{'invisible': [('allow_timesheets', '=', False)]}" class="o_project_kanban_box"> <a t-if="record.allow_timesheets.raw_value" name="%(act_hr_timesheet_line_by_project)d" type="action"> <span class="o_label">Timesheets</span> diff --git a/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml b/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml index 7b87b2ff4de..046632c515d 100644 --- a/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml +++ b/addons/hr_timesheet_attendance/views/hr_timesheet_sheet_views.xml @@ -54,7 +54,7 @@ </button> </div> </div> - <xpath expr="//page[@class='o_hr_timesheet_sheet_details']" position="after"> + <xpath expr="//page[hasclass('o_hr_timesheet_sheet_details')]" position="after"> <page string="Attendances" groups="hr_attendance.group_hr_attendance"> <group> <group groups="hr_attendance.group_hr_attendance"> diff --git a/addons/l10n_in_hr_payroll/report/payslip_report_view.xml b/addons/l10n_in_hr_payroll/report/payslip_report_view.xml index c4ecd4c276d..aa2964ababe 100644 --- a/addons/l10n_in_hr_payroll/report/payslip_report_view.xml +++ b/addons/l10n_in_hr_payroll/report/payslip_report_view.xml @@ -84,7 +84,7 @@ <field name="groups_id" eval="[(4,ref('hr_payroll.group_hr_payroll_user'))]"/> <field name="arch" type="xml"> <data> - <xpath expr="//div[contains(@class, 'manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div class="row"> <div class="col-xs-12 text-left"> <a name="%(action_payslip_report_all)d" type="action"> diff --git a/addons/payment/views/payment_portal_templates.xml b/addons/payment/views/payment_portal_templates.xml index 388696c75c5..c898a7374a3 100644 --- a/addons/payment/views/payment_portal_templates.xml +++ b/addons/payment/views/payment_portal_templates.xml @@ -49,7 +49,7 @@ <!-- TDE FIXME: was customize_show=True --> <template id="pay_meth_link" inherit_id="portal.portal_layout"> - <xpath expr="//div[@class='o_portal_my_details']" position="inside"> + <xpath expr="//div[hasclass('o_portal_my_details')]" position="inside"> <t t-if="request.env['payment.acquirer'].search([('website_published', '=', True), ('registration_view_template_id', '!=', False)])"> <div class='manage_payment_method mt16'><a href="/my/payment_method">Manage your payment acquirers</a></div> </t> diff --git a/addons/point_of_sale/views/res_partner_view.xml b/addons/point_of_sale/views/res_partner_view.xml index efde03711ad..b7be54f7c9f 100644 --- a/addons/point_of_sale/views/res_partner_view.xml +++ b/addons/point_of_sale/views/res_partner_view.xml @@ -30,7 +30,7 @@ <field name="state_id" position="before"> <field name="pos_order_count"/> </field> - <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="inside"> <span t-if="record.pos_order_count.value>0" class="badge"><i class="fa fa-fw fa-shopping-bag"/><t t-esc="record.pos_order_count.value"/></span> </xpath> </field> diff --git a/addons/pos_sale/views/sales_team_views.xml b/addons/pos_sale/views/sales_team_views.xml index e878ddcfad6..044d4abc40b 100644 --- a/addons/pos_sale/views/sales_team_views.xml +++ b/addons/pos_sale/views/sales_team_views.xml @@ -70,15 +70,15 @@ <attribute name="attrs">{'invisible': [('team_type', '=', 'pos')]}</attribute> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_view')]" position="attributes"> + <xpath expr="//div[hasclass('o_kanban_manage_view')]" position="attributes"> <attribute name="attrs">{'invisible': [('team_type', '=', 'pos')]}</attribute> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_new')]" position="attributes"> + <xpath expr="//div[hasclass('o_kanban_manage_new')]" position="attributes"> <attribute name="attrs">{'invisible': [('team_type', '=', 'pos')]}</attribute> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <t t-if="record.team_type.raw_value == 'pos'"> <a name="%(point_of_sale.action_report_pos_order_all)d" type="action"> Sales diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml index a5651792aaa..e3c950329a8 100644 --- a/addons/product/views/product_views.xml +++ b/addons/product/views/product_views.xml @@ -328,7 +328,7 @@ </tree> </field> </field> - <xpath expr="//div[@class='oe_title']" position="inside"> + <xpath expr="//div[hasclass('oe_title')]" position="inside"> <field name="attribute_value_ids" widget="many2many_tags" groups="product.group_product_variant"/> </xpath> </field> diff --git a/addons/product_expiry/views/production_lot_views.xml b/addons/product_expiry/views/production_lot_views.xml index 1209d32706a..9922b02fe8a 100644 --- a/addons/product_expiry/views/production_lot_views.xml +++ b/addons/product_expiry/views/production_lot_views.xml @@ -17,7 +17,7 @@ </group> </group> </xpath> - <xpath expr="//div[@class='oe_title']" position="inside"> + <xpath expr="//div[hasclass('oe_title')]" position="inside"> <field name="product_expiry_alert" invisible="1"/> <span class="label label-danger" attrs="{'invisible': [('product_expiry_alert', '=', False)]}">Expiration Alert</span> </xpath> diff --git a/addons/purchase/views/res_partner_views.xml b/addons/purchase/views/res_partner_views.xml index e246a02b847..af244c9988c 100644 --- a/addons/purchase/views/res_partner_views.xml +++ b/addons/purchase/views/res_partner_views.xml @@ -41,7 +41,7 @@ <field name="mobile" position="after"> <field name="purchase_order_count"/> </field> - <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="inside"> <span t-if="record.purchase_order_count.value>0" class="badge"><i class="fa fa-fw fa-shopping-cart"/><t t-esc="record.purchase_order_count.value"/></span> </xpath> </field> diff --git a/addons/rating_project/views/project_view.xml b/addons/rating_project/views/project_view.xml index 4ef55bb2ab5..1ac0d2b8de2 100644 --- a/addons/rating_project/views/project_view.xml +++ b/addons/rating_project/views/project_view.xml @@ -98,7 +98,7 @@ <field name="rating_last_value"/> <field name="rating_ids"/> </xpath> - <xpath expr="//div[@class='oe_kanban_bottom_left']" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_bottom_left')]" position="inside"> <b t-if="record.rating_ids.raw_value.length"> <span style="font-weight:bold;" class="fa fa-fw mt4 fa-smile-o text-success" t-if="record.rating_last_value.value == 10" title="Latest Rating: Satisfied"/> <span style="font-weight:bold;" class="fa fa-fw mt4 fa-meh-o text-warning" t-if="record.rating_last_value.value == 5" title="Latest Rating: Not Satisfied"/> @@ -148,7 +148,7 @@ <field name="percentage_satisfaction_project" invisible="1"/> <field name="rating_status" invisible="1"/> </field> - <xpath expr="//div[contains(@class, 'o_kanban_primary_left')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_primary_left')]" position="inside"> <div t-if="record.rating_status.raw_value != 'no'" class="mt8 text-primary" title="Percentage of happy ratings over the past 30 days. Get rating details from the More menu."> <b> <t t-if="record.percentage_satisfaction_project.value == -1"> @@ -162,7 +162,7 @@ </b> </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_card_manage_section')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_card_manage_section')]" position="inside"> <div t-if="record.rating_status.raw_value != 'no'"> <a name="action_view_all_rating" type="object"> Customer Ratings diff --git a/addons/sale/views/res_partner_views.xml b/addons/sale/views/res_partner_views.xml index dba326bd09f..dcd52422834 100644 --- a/addons/sale/views/res_partner_views.xml +++ b/addons/sale/views/res_partner_views.xml @@ -29,7 +29,7 @@ <field name="mobile" position="after"> <field name="sale_order_count"/> </field> - <xpath expr="//div[@class='oe_kanban_partner_links']" position="inside"> + <xpath expr="//div[hasclass('oe_kanban_partner_links')]" position="inside"> <span t-if="record.sale_order_count.value>0" class="badge"><i class="fa fa-fw fa-usd"/><t t-esc="record.sale_order_count.value"/></span> </xpath> </field> diff --git a/addons/sale/views/sale_portal_templates.xml b/addons/sale/views/sale_portal_templates.xml index 68d677728ab..bfd0ebe801d 100644 --- a/addons/sale/views/sale_portal_templates.xml +++ b/addons/sale/views/sale_portal_templates.xml @@ -7,7 +7,7 @@ </template> <template id="portal_my_home_menu_sale" name="Portal layout : sales menu entries" inherit_id="portal.portal_layout" priority="20"> - <xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside"> + <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside"> <li t-if="page_name == 'quote' or sales_order and sales_order.state == 'sent'"> <a t-if="sales_order" t-attf-href="/my/quotes?{{ keep_query() }}">Quotations</a> <t t-else="">Quotations</t> @@ -25,7 +25,7 @@ </template> <template id="portal_my_home_sale" name="Portal My Home : sales entries" inherit_id="portal.portal_my_home" priority="20"> - <xpath expr="//ul[contains(@class,'o_portal_docs')]" position="inside"> + <xpath expr="//ul[hasclass('o_portal_docs')]" position="inside"> <li t-if="quotation_count" class="list-group-item"> <span class="badge" t-esc="quotation_count"/> <a href="/my/quotes">Quotations</a> diff --git a/addons/sale/views/sales_team_views.xml b/addons/sale/views/sales_team_views.xml index d575304b2bf..31370e39bbd 100644 --- a/addons/sale/views/sales_team_views.xml +++ b/addons/sale/views/sales_team_views.xml @@ -95,7 +95,7 @@ </t> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_view')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_view')]" position="inside"> <div t-if="record.use_quotations.raw_value"> <a name="%(action_quotations_salesteams)d" type="action" class="o_quotation_view_button">Quotations</a> </div> @@ -107,7 +107,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_new')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_new')]" position="inside"> <div t-if="record.use_quotations.raw_value"> <a name="%(action_quotation_form)d" type="action"> Quotation @@ -115,7 +115,7 @@ </div> </xpath> - <xpath expr="//div[contains(@class, 'o_kanban_manage_reports')]" position="inside"> + <xpath expr="//div[hasclass('o_kanban_manage_reports')]" position="inside"> <div t-if="record.use_quotations.raw_value"> <a name="%(action_order_report_quotation_salesteam)d" type="action"> Quotation diff --git a/addons/website/views/website_templates.xml b/addons/website/views/website_templates.xml index b46402aba28..b9d6fbadf8c 100644 --- a/addons/website/views/website_templates.xml +++ b/addons/website/views/website_templates.xml @@ -150,7 +150,7 @@ <t t-call-assets="website.assets_editor" t-css="false" groups="website.group_website_publisher"/> </t> </xpath> - <xpath expr="//header//div[@class='navbar-header']" position="replace"> + <xpath expr="//header//div[hasclass('navbar-header')]" position="replace"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-top-collapse"> <span class="sr-only">Toggle navigation</span> @@ -161,13 +161,13 @@ <a class="navbar-brand" href="/" t-if="website" t-field="website.name">My Website</a> </div> </xpath> - <xpath expr="//header//ul[@id='top_menu']/li[@class='divider']" position="attributes"> + <xpath expr="//header//ul[@id='top_menu']/li[hasclass('divider')]" position="attributes"> <attribute name="t-if">website.user_id != user_id</attribute> </xpath> - <xpath expr="//header//ul[@id='top_menu']/li[@class='dropdown']" position="attributes"> + <xpath expr="//header//ul[@id='top_menu']/li[hasclass('dropdown')]" position="attributes"> <attribute name="t-if">website.user_id != user_id</attribute> </xpath> - <xpath expr="//header//ul[@id='top_menu']/li[@class='divider']" position="before"> + <xpath expr="//header//ul[@id='top_menu']/li[hasclass('divider')]" position="before"> <t t-foreach="website.menu_id.child_id" t-as="submenu"> <t t-call="website.submenu"/> </t> @@ -200,7 +200,7 @@ </template> <template id="layout_logo_show" inherit_id="website.layout" customize_show="True" name="Show Logo"> - <xpath expr="//header//a[@class='navbar-brand']" position="replace"> + <xpath expr="//header//a[hasclass('navbar-brand')]" position="replace"> <a href="/" class="navbar-brand logo"> <span t-field="res_company.logo" t-options="{'widget': 'image'}" t-att-alt="'Logo of %s' % res_company.name" t-att-title="res_company.name" /> </a> diff --git a/addons/website_blog/views/website_blog_templates.xml b/addons/website_blog/views/website_blog_templates.xml index a7877cdc8c1..de80bdb5646 100644 --- a/addons/website_blog/views/website_blog_templates.xml +++ b/addons/website_blog/views/website_blog_templates.xml @@ -300,7 +300,7 @@ <!-- Options: Blog Post: user can reply --> <template id="opt_blog_post_complete_comment" name="Allow blog post comment" inherit_id="website_blog.blog_post_complete" active="False" customize_show="True"> - <xpath expr="//div[@class='o_blog_post_complete o_sharing_links']" position="after"> + <xpath expr="//div[hasclass('o_blog_post_complete','o_sharing_links')]" position="after"> <section id="comments" class="read_width"> <t t-call="website_mail.message_thread"> <t t-set="object" t-value="blog_post"/> @@ -312,7 +312,7 @@ <!-- Options: Blog Post : Read Next Article --> <template id="opt_blog_post_complete_read_next" name="Read next article" inherit_id="website_blog.blog_post_complete" active="True" customize_show="True"> - <xpath expr="//div[@id='comments']|//div[@class='o_blog_post_complete o_sharing_links']" position="after"> + <xpath expr="//div[@id='comments']|//div[hasclass('o_blog_post_complete','o_sharing_links')]" position="after"> <t t-if="next_post"> <t t-call="website_blog.blog_cover"> <t t-set="cover_properties" t-value="next_post_cover_properties"/> @@ -359,7 +359,7 @@ <xpath expr="//div[@id='blog_content']" position="attributes"> <attribute name="class" add="js_tweet" separator=" "/> </xpath> - <xpath expr="//div[@id='title']//div[contains(@class, 'blog_title')]" position="attributes"> + <xpath expr="//div[@id='title']//div[hasclass('blog_title')]" position="attributes"> <attribute name="class" add="js_tweet" separator=" "/> </xpath> </template> @@ -369,7 +369,7 @@ <xpath expr="//div[@id='blog_content']" position="attributes"> <attribute name="class" add="js_comment" separator=" "/> </xpath> - <xpath expr="//div[@id='title']//div[contains(@class, 'blog_title')]" position="attributes"> + <xpath expr="//div[@id='title']//div[hasclass('blog_title')]" position="attributes"> <attribute name="class" add="js_comment" separator=" "/> </xpath> </template> diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml index 202f090f331..ae449b901af 100644 --- a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml +++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml @@ -193,7 +193,7 @@ </xpath> </template> <template id="portal_my_home_menu_lead" name="Portal layout : lead menu entry" inherit_id="portal.portal_layout" priority="15"> - <xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside"> + <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside"> <li t-if="page_name == 'lead' or lead"> <a t-if="lead" t-attf-href="/my/leads?{{ keep_query() }}"> My Leads @@ -220,7 +220,7 @@ </template> <template id="portal_my_home_lead" name="Portal My Home : lead entries" inherit_id="portal.portal_my_home" priority="15"> - <xpath expr="//div[contains(@class,'o_my_home_content')]" position="inside"> + <xpath expr="//div[hasclass('o_my_home_content')]" position="inside"> <t t-if="user_id.commercial_partner_id.grade_id"> <h3 t-if="lead_count" class="page-header"> <a href="/my/leads">My Leads diff --git a/addons/website_event_questions/views/event_templates.xml b/addons/website_event_questions/views/event_templates.xml index a04c553bcb6..c522a3adc30 100644 --- a/addons/website_event_questions/views/event_templates.xml +++ b/addons/website_event_questions/views/event_templates.xml @@ -30,7 +30,7 @@ </xpath> <!-- Generic questions --> - <xpath expr="//div[@class='container']/t[last()]" position="after"> + <xpath expr="//div[hasclass('container')]/t[last()]" position="after"> <t t-if="event.general_question_ids"> <h4 class="page-header mt8"><strong>Questions</strong></h4> <div> diff --git a/addons/website_event_sale/views/event_templates.xml b/addons/website_event_sale/views/event_templates.xml index f6fab282992..e336df0e7f2 100644 --- a/addons/website_event_sale/views/event_templates.xml +++ b/addons/website_event_sale/views/event_templates.xml @@ -84,7 +84,7 @@ </template> <template id="cart" inherit_id="website_sale.cart_lines" name="Hide product reduction for event tickets"> - <xpath expr="//td[@class='td-product_name']/div/a" position="attributes"> + <xpath expr="//td[hasclass('td-product_name')]/div/a" position="attributes"> <attribute name="t-attf-href"/> <attribute name="t-att-href"> line.event_id and ('/event/%s/register' % slug(line.event_id)) or ('/shop/product/%s' % slug(line.product_id.product_tmpl_id)) diff --git a/addons/website_event_track/views/event_views.xml b/addons/website_event_track/views/event_views.xml index ad4d6290bdc..fdaf69c56eb 100644 --- a/addons/website_event_track/views/event_views.xml +++ b/addons/website_event_track/views/event_views.xml @@ -6,7 +6,7 @@ <field name="model">event.type</field> <field name="inherit_id" ref="website_event.event_type_view_form_inherit_website"/> <field name="arch" type="xml"> - <xpath expr="//div[@name='event_type_visibility_website']/div[@class='o_setting_right_pane']" position='inside'> + <xpath expr="//div[@name='event_type_visibility_website']/div[hasclass('o_setting_right_pane')]" position='inside'> <div class="row mt16" attrs="{'invisible': [('website_menu', '=', False)]}"> <label class="col-md-4" for="website_track"/> <field name="website_track"/> </div> diff --git a/addons/website_hr/views/website_hr_templates.xml b/addons/website_hr/views/website_hr_templates.xml index 8d92e1289fe..ecadc7eae9d 100644 --- a/addons/website_hr/views/website_hr_templates.xml +++ b/addons/website_hr/views/website_hr_templates.xml @@ -8,7 +8,7 @@ </template> <template id="aboutus" inherit_id="website.aboutus" customize_show="True" name="Our Team"> - <xpath expr="//div[@class='oe_structure']" position="after"> + <xpath expr="//div[hasclass('oe_structure')]" position="after"> <section class="container" id="team"> <div class="col-sm-12 text-center" t-if="len(employees)"> <h2>Our Team</h2> diff --git a/addons/website_hr_recruitment/views/website_hr_recuitment_snippets.xml b/addons/website_hr_recruitment/views/website_hr_recuitment_snippets.xml index 3713dfede12..fd64dde4576 100644 --- a/addons/website_hr_recruitment/views/website_hr_recuitment_snippets.xml +++ b/addons/website_hr_recruitment/views/website_hr_recuitment_snippets.xml @@ -23,7 +23,7 @@ <!-- Add Snippets' into library --> <template id="website_hr_recuitment_snippets_include" inherit_id="website.snippets" name="Website HR Recruitment Snippets Include"> - <xpath expr="//div[@id='snippet_content']/div[@class='o_panel_body']/*[1]" position="before"> + <xpath expr="//div[@id='snippet_content']/div[hasclass('o_panel_body')]/*[1]" position="before"> <t t-snippet="website_hr_recruitment.s_hr_rating" t-thumbnail="/website_hr_recruitment/static/src/img/ui/s_hr_rating_thumb.jpg"/> </xpath> </template> @@ -58,4 +58,4 @@ </xpath> </template> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/website_mass_mailing/views/mass_mailing_view.xml b/addons/website_mass_mailing/views/mass_mailing_view.xml index 01bd8c7989d..1a091db6d7c 100644 --- a/addons/website_mass_mailing/views/mass_mailing_view.xml +++ b/addons/website_mass_mailing/views/mass_mailing_view.xml @@ -12,7 +12,7 @@ </page> </notebook> </xpath> - <xpath expr="//div[@class='oe_title']" position="inside"> + <xpath expr="//div[hasclass('oe_title')]" position="inside"> <group groups="website_mass_mailing.group_website_popup_on_exit"> <field name="popup_redirect_url"/> </group> diff --git a/addons/website_portal_purchase/views/website_portal_purchase_templates.xml b/addons/website_portal_purchase/views/website_portal_purchase_templates.xml index 118b317b802..9c6f6acb9e6 100644 --- a/addons/website_portal_purchase/views/website_portal_purchase_templates.xml +++ b/addons/website_portal_purchase/views/website_portal_purchase_templates.xml @@ -2,7 +2,7 @@ <odoo> <template id="portal_my_home_menu_purchase" name="Portal layout : purchase menu entries" inherit_id="portal.portal_layout" priority="25"> - <xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside"> + <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside"> <li t-if="page_name == 'purchase' or purchase_order"> <a t-if="purchase_order" t-attf-href="/my/purchase?{{ keep_query() }}">Purchase Orders</a> <t t-else="">Purchase Orders</t> @@ -14,7 +14,7 @@ </template> <template id="portal_my_home_purchase" name="Portal My Home : purchase entry" inherit_id="portal.portal_my_home" priority="25"> - <xpath expr="//ul[contains(@class,'o_portal_docs')]" position="inside"> + <xpath expr="//ul[hasclass('o_portal_docs')]" position="inside"> <li t-if="purchase_count" class="list-group-item"> <span class="badge" t-esc="purchase_count"/> <a href="/my/purchase">Purchase Orders</a> diff --git a/addons/website_project/views/project_templates.xml b/addons/website_project/views/project_templates.xml index 1b0b0599c1a..c9e4b047d53 100644 --- a/addons/website_project/views/project_templates.xml +++ b/addons/website_project/views/project_templates.xml @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <template id="portal_layout" name="Portal layout: project menu entry" inherit_id="portal.portal_layout" priority="40"> - <xpath expr="//ol[contains(@class,'o_portal_submenu')]" position="inside"> + <xpath expr="//ol[hasclass('o_portal_submenu')]" position="inside"> <li t-if="page_name == 'project' or project"> <a t-if="project" t-attf-href="/my/projects?{{ keep_query() }}">Projects</a> <t t-else="">Projects</t> @@ -20,7 +20,7 @@ </template> <template id="portal_my_home" name="Portal My Home: project entries" inherit_id="portal.portal_my_home" priority="40"> - <xpath expr="//ul[contains(@class,'o_portal_docs')]" position="inside"> + <xpath expr="//ul[hasclass('o_portal_docs')]" position="inside"> <li t-if="project_count" class="list-group-item"> <span class="badge" t-esc="project_count"/> <a href="/my/projects">Projects</a> diff --git a/addons/website_project_timesheet/views/account_analytic_line_templates.xml b/addons/website_project_timesheet/views/account_analytic_line_templates.xml index 75c2cb87ace..f48b0739794 100644 --- a/addons/website_project_timesheet/views/account_analytic_line_templates.xml +++ b/addons/website_project_timesheet/views/account_analytic_line_templates.xml @@ -2,7 +2,7 @@ <odoo> <template id="my_task" inherit_id="website_project.my_task" name="Project Task Timesheets"> - <xpath expr="//div[@class='panel-body']" position="inside"> + <xpath expr="//div[hasclass('panel-body')]" position="inside"> <div class="container" t-if="task.timesheet_ids"> <hr/> <table class="table table-hover"> diff --git a/addons/website_quote/report/sale_order_templates.xml b/addons/website_quote/report/sale_order_templates.xml index 3a59995eccb..308df119a16 100644 --- a/addons/website_quote/report/sale_order_templates.xml +++ b/addons/website_quote/report/sale_order_templates.xml @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <template id="report_saleorder_validity_date" inherit_id="sale.report_saleorder_document"> - <xpath expr="//div[@class='page']/div[@id='informations']" position="inside"> + <xpath expr="//div[hasclass('page')]/div[@id='informations']" position="inside"> <div t-if="doc.validity_date and doc.state in ['draft', 'sent']" class="col-xs-3"> <strong>Expiration Date:</strong> <p t-field="doc.validity_date"/> </div> </xpath> - <xpath expr="//div[@class='page']/p[@id='fiscal_position_remark']" position="after"> + <xpath expr="//div[hasclass('page')]/p[@id='fiscal_position_remark']" position="after"> <div t-if="doc.options and doc.state in ['draft', 'sent']" style="page-break-before:always;"> <h2> <span>Suggested Products</span> diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml index 664a26ef2b3..3307b12ba7a 100644 --- a/addons/website_sale/views/templates.xml +++ b/addons/website_sale/views/templates.xml @@ -57,7 +57,7 @@ </template> <template id="search count" inherit_id="website.website_search_box" active="False" customize_show="True" name="Show # found"> - <xpath expr="//button[contains(@class, 'oe_search_button')]" position="inside"> + <xpath expr="//button[hasclass('oe_search_button')]" position="inside"> <span t-if='search and search_count' class='oe_search_found'> <small>(<t t-esc="search_count"/> found)</small></span> </xpath> </template> @@ -123,7 +123,7 @@ </template> <template id="products_description" inherit_id="website_sale.products_item" active="False" customize_show="True" name="Product Description"> - <xpath expr="//div[@class='product_price']" position="before"> + <xpath expr="//div[hasclass('product_price')]" position="before"> <div class="text-info oe_subdescription" contenteditable="false"> <div itemprop="description" t-field="product.description_sale"></div> </div> @@ -131,7 +131,7 @@ </template> <template id="products_add_to_cart" inherit_id="website_sale.products_item" active="False" customize_show="True" name="Add to Cart"> - <xpath expr="//div[@class='product_price']" position="inside"> + <xpath expr="//div[hasclass('product_price')]" position="inside"> <input name="product_id" t-att-value="product.product_variant_id.id" type="hidden" /> <t t-if="len(product.product_variant_ids) == 1"> <a class="btn btn-default btn-xs a-submit"> @@ -222,7 +222,7 @@ </template> <template id="sort" inherit_id="website_sale.products" active="True" customize_show="True" name="Show Sort by"> - <xpath expr="//div[@class='products_pager']/div/t[@t-call][last()]" position="after"> + <xpath expr="//div[hasclass('products_pager')]/div/t[@t-call][last()]" position="after"> <t t-set="list_price_desc_label">Catalog price: High to Low</t> <t t-set="list_price_asc_label">Catalog price: Low to High</t> <t t-set="name_asc_label">Name - A to Z</t> @@ -505,7 +505,7 @@ </template> <template inherit_id='website_sale.product' id="product_picture_magnify" customize_show="True" name="Activate Magnify"> - <xpath expr='//div[contains(@class, "js_sale")]' position='attributes'> + <xpath expr='//div[hasclass("js_sale")]' position='attributes'> <attribute name="class" separator=" " add="ecom-zoomable zoomodoo-hover" /> </xpath> </template> diff --git a/addons/website_sale_comparison/views/website_sale_comparison_template.xml b/addons/website_sale_comparison/views/website_sale_comparison_template.xml index 3889b05a148..70d2e14848b 100644 --- a/addons/website_sale_comparison/views/website_sale_comparison_template.xml +++ b/addons/website_sale_comparison/views/website_sale_comparison_template.xml @@ -9,7 +9,7 @@ </template> <template id="add_to_compare" inherit_id="website_sale.products_item" active="True" customize_show="True" name="Comparison List" priority="22"> - <xpath expr="//div[@class='product_price']" position="inside"> + <xpath expr="//div[hasclass('product_price')]" position="inside"> <a class="hidden-xs btn btn-default btn-xs o_add_compare" title="Compare" t-att-data-product-product-id="product.product_variant_ids[0].id" data-action="o_comparelist"><span class="fa fa-exchange"></span></a> </xpath> </template> diff --git a/addons/website_sale_options/views/website_sale_options_templates.xml b/addons/website_sale_options/views/website_sale_options_templates.xml index 9b347cdf92d..41823c8e9ac 100644 --- a/addons/website_sale_options/views/website_sale_options_templates.xml +++ b/addons/website_sale_options/views/website_sale_options_templates.xml @@ -10,13 +10,13 @@ </template> <template id="optional_products" inherit_id="website_sale.cart_lines" name="Optional products"> - <xpath expr="//table[@id='cart_products']/tbody//td[contains(@class, 'td-qty')]/div" position="attributes"> + <xpath expr="//table[@id='cart_products']/tbody//td[hasclass('td-qty')]/div" position="attributes"> <attribute name="t-if">not line.linked_line_id</attribute> </xpath> <xpath expr="//table[@id='cart_products']/tbody//tr" position="attributes"> <attribute name="t-att-class">'optional_product info' if line.linked_line_id else None</attribute> </xpath> - <xpath expr="//table[@id='cart_products']/tbody//td[contains(@class, 'td-qty')]" position="inside"> + <xpath expr="//table[@id='cart_products']/tbody//td[hasclass('td-qty')]" position="inside"> <t t-if="line.linked_line_id"> <span class="js_quantity text-muted" t-att-data-line-id="line.id" t-att-data-product-id="line.product_id.id" t-esc="int(line.product_uom_qty)"/> </t> @@ -141,10 +141,10 @@ </template> <template id="products_add_to_cart" inherit_id="website_sale.products_add_to_cart"> - <xpath expr="//div[@class='product_price']/t[1]" position="attributes"> + <xpath expr="//div[hasclass('product_price')]/t[1]" position="attributes"> <attribute name="t-if">len(product.product_variant_ids) == 1 and not len(product.optional_product_ids) >= 1</attribute> </xpath> - <xpath expr="//div[@class='product_price']/t[2]" position="attributes"> + <xpath expr="//div[hasclass('product_price')]/t[2]" position="attributes"> <attribute name="t-if">len(product.product_variant_ids) > 1 or len(product.optional_product_ids) >= 1</attribute> </xpath> </template> diff --git a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml index a71545bbd11..003c1ff3796 100644 --- a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml +++ b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml @@ -9,7 +9,7 @@ </template> <template id="add_to_wishlist" inherit_id="website_sale.products_item" active="True" customize_show="True" name="Wishlist" priority="20"> - <xpath expr="//div[@class='product_price']" position="inside"> + <xpath expr="//div[hasclass('product_price')]" position="inside"> <t t-set="in_wish" t-value="product.product_variant_ids[0] in request.env.user.partner_id.wishlist_ids.mapped('product_id')"/> <a class="btn btn-default btn-xs o_add_wishlist" t-att-disabled='in_wish or None' title="Add to Wishlist" t-att-data-product-product-id="product.product_variant_ids[0].id" data-action="o_wishlist"><span class="fa fa-heart"></span></a> </xpath> diff --git a/addons/website_slides/views/website_slides.xml b/addons/website_slides/views/website_slides.xml index 2dc648e75d0..afcf7747203 100644 --- a/addons/website_slides/views/website_slides.xml +++ b/addons/website_slides/views/website_slides.xml @@ -4,7 +4,7 @@ <!-- add link to the standard footer --> <template id="slide_footer" inherit_id="website.footer_default" name="Footer Slides Link"> - <xpath expr="//div[@id='info']//ul[@class='list-unstyled']" position="inside"> + <xpath expr="//div[@id='info']//ul[hasclass('list-unstyled')]" position="inside"> <li> <a href="/slides">Presentations</a> </li> diff --git a/odoo/addons/base/ir/ir_ui_view.py b/odoo/addons/base/ir/ir_ui_view.py index 1a14fbfbfef..343aa6f570a 100644 --- a/odoo/addons/base/ir/ir_ui_view.py +++ b/odoo/addons/base/ir/ir_ui_view.py @@ -153,6 +153,7 @@ xpath_utils = etree.FunctionNamespace(None) xpath_utils['hasclass'] = _hasclass TRANSLATED_ATTRS_RE = re.compile(r"@(%s)\b" % "|".join(TRANSLATED_ATTRS)) +WRONGCLASS = re.compile(r"(@class\s*=|=\s*@class|contains\(@class)") class View(models.Model): @@ -301,6 +302,12 @@ actual arch. if match: message = "View inheritance may not use attribute %r as a selector." % match.group(1) self.raise_view_error(message, self.id) + if WRONGCLASS.search(node.get('expr', '')): + _logger.warn( + "Error-prone use of @class in view %s (%s): use the " + "hasclass(*classes) function to filter elements by " + "their classes", self.name, self.xml_id + ) else: for attr in TRANSLATED_ATTRS: if node.get(attr): diff --git a/odoo/addons/base/res/res_partner.py b/odoo/addons/base/res/res_partner.py index 7784cc231e6..c3f52ed6302 100644 --- a/odoo/addons/base/res/res_partner.py +++ b/odoo/addons/base/res/res_partner.py @@ -48,7 +48,7 @@ class FormatAddressMixin(models.AbstractModel): if address_view_id and not self._context.get('no_address_format'): #render the partner address accordingly to address_view_id doc = etree.fromstring(arch) - for address_node in doc.xpath("//div[@class='o_address_format']"): + for address_node in doc.xpath("//div[hasclass('o_address_format')]"): Partner = self.env['res.partner'].with_context(no_address_format=True) sub_view = Partner.fields_view_get( view_id=address_view_id.id, view_type='form', toolbar=False, submenu=False) |
