From fbfd0119041ca7dc830796e76d9ae5c303459d4f Mon Sep 17 00:00:00 2001 From: qsm-odoo Date: Thu, 15 Feb 2018 18:14:58 +0100 Subject: [PATCH] =?UTF-8?q?[REF]=20*:=20get=20rid=20of=20introduced=20@?= =?UTF-8?q?=E2=80=8Bextend?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During first scss convertion, classes called as mixins were changed to an @​extend instruction which was the best approximation given the fact there is no equivalent in sass to do that. The problem is that the instruction is slowing the scss computation a lot and might also break the style in unexpected ways because of the complex unwanted selectors the instruction induces. This commit removes the need of extends. This is done case per case. Sometimes this involves adding classes in xml, sometimes to change the style a little, ... The button rendering refactoring which was made at the start of the LESS to SASS merge was also done in prevision of this. After this commit, sass computation is like 5-6 times faster than less computation while it was like 10 times *slower* before this commit. --- .../views/account_journal_dashboard_view.xml | 2 +- .../base_import/static/src/js/import_action.js | 2 +- .../base_import/static/src/scss/base_import.scss | 16 ---------------- .../base_import/static/src/xml/base_import.xml | 8 ++++---- addons/hr/views/hr_views.xml | 2 +- addons/hr_recruitment/views/hr_job_views.xml | 2 +- addons/mail/static/src/scss/systray.scss | 2 -- addons/mail/static/src/scss/thread.scss | 4 ---- addons/mail/static/src/xml/activity.xml | 2 +- addons/mail/static/src/xml/systray.xml | 9 ++++----- addons/mail/static/src/xml/thread.xml | 6 +++--- addons/mail/wizard/mail_compose_message_view.xml | 2 +- addons/maintenance/views/maintenance_views.xml | 2 +- .../views/mass_mailing_stats_views.xml | 2 +- addons/mass_mailing/views/mass_mailing_views.xml | 6 +++--- addons/mrp/views/mrp_workcenter_views.xml | 2 +- addons/mrp/views/stock_picking_views.xml | 2 +- .../views/point_of_sale_dashboard.xml | 2 +- addons/project/views/project_views.xml | 2 +- addons/sales_team/views/sales_team_dashboard.xml | 2 +- addons/stock/views/stock_picking_views.xml | 2 +- addons/web/static/src/scss/dropdown_extra.scss | 5 ----- addons/web/static/src/scss/form_view.scss | 7 +++---- addons/web/static/src/scss/kanban_dashboard.scss | 6 ++++-- .../web/static/src/scss/search_view_extra.scss | 7 ------- addons/web/static/src/xml/base.xml | 8 ++++---- odoo/addons/base/views/res_users_views.xml | 2 +- 27 files changed, 40 insertions(+), 74 deletions(-) diff --git a/addons/account/views/account_journal_dashboard_view.xml b/addons/account/views/account_journal_dashboard_view.xml index 9c7f1aca551..f6b74013d54 100644 --- a/addons/account/views/account_journal_dashboard_view.xml +++ b/addons/account/views/account_journal_dashboard_view.xml @@ -29,7 +29,7 @@ -
+
diff --git a/addons/base_import/static/src/js/import_action.js b/addons/base_import/static/src/js/import_action.js index 1e17798ae34..d995e9cf055 100644 --- a/addons/base_import/static/src/js/import_action.js +++ b/addons/base_import/static/src/js/import_action.js @@ -281,7 +281,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { // TODO: test that write // succeeded? this.$el.removeClass('oe_import_preview_error oe_import_error'); this.$el.toggleClass( - 'oe_import_noheaders', + 'oe_import_noheaders text-muted', !this.$('input.oe_import_has_header').prop('checked')); this._rpc({ model: 'base_import.import', diff --git a/addons/base_import/static/src/scss/base_import.scss b/addons/base_import/static/src/scss/base_import.scss index 72fe2651331..9a4ce56f5c2 100644 --- a/addons/base_import/static/src/scss/base_import.scss +++ b/addons/base_import/static/src/scss/base_import.scss @@ -84,10 +84,6 @@ display: block; } - .oe_import_noheaders { - @extend .text-muted; // FIXME was a mixin before scss convertion - } - /* ------------- ERRORS AND WARNINGS REPORT ------------ */ .oe_import_error_report { > ul { @@ -99,18 +95,6 @@ list-style: none; border-radius: $border-radius-base; } - .oe_import_report_error { - @extend .bg-danger; // FIXME was a mixin before scss convertion - @extend .text-danger; // FIXME was a mixin before scss convertion - } - .oe_import_report_warning { - @extend .bg-warning; // FIXME was a mixin before scss convertion - @extend .text-warning; // FIXME was a mixin before scss convertion - } - .oe_import_report_info { - @extend .bg-info; // FIXME was a mixin before scss convertion - @extend .text-info; // FIXME was a mixin before scss convertion - } } /* ------------- THE CSV TABLE ------------ */ diff --git a/addons/base_import/static/src/xml/base_import.xml b/addons/base_import/static/src/xml/base_import.xml index f882bf7f557..276d9ca0245 100644 --- a/addons/base_import/static/src/xml/base_import.xml +++ b/addons/base_import/static/src/xml/base_import.xml @@ -68,7 +68,7 @@ Track history during import -
@@ -84,7 +84,7 @@ -

If the file contains +

If the file contains the column names, Odoo can try auto-detecting the field corresponding to the column. This makes imports simpler especially when the file has many columns.

@@ -124,7 +124,7 @@ -
+

Import preview failed due to: .

For CSV files, the issue could be an incorrect encoding.

Here is the start of the file we could not import:

@@ -133,7 +133,7 @@
  • + t-attf-class="oe_import_report bg-#{error_value[0].type} text-#{error_value[0].type}"> diff --git a/addons/hr/views/hr_views.xml b/addons/hr/views/hr_views.xml index 7fd75167757..7e5d6a61b39 100644 --- a/addons/hr/views/hr_views.xml +++ b/addons/hr/views/hr_views.xml @@ -554,7 +554,7 @@
-
+