diff options
| author | qsm-odoo <qsm@odoo.com> | 2018-07-05 13:17:59 +0200 |
|---|---|---|
| committer | Quentin Smetz (qsm) <qsm@odoo.com> | 2018-07-09 11:59:30 +0200 |
| commit | 2c966909e2c0b5e45912a6ff85577f0b19a5f4c9 (patch) | |
| tree | 71d294f0a0577c13561bf079aa58fd2395653f11 /odoo/addons/test_main_flows/static/src | |
| parent | 49a905321a5b94df6d87355c57c4c1a02d349502 (diff) | |
[FIX] *: fix some side-effects of https://github.com/odoo/odoo/commit/9de1bc0eef6f5bfaa2a8d745431caa361ae91548
- JS Modals were not correctly built anymore, their .modal-body element
was duplicated and many without-effect JS lines were introduced (as a
side effect, the form view design was broken when inside modals)
- Tests were changed to make bugs go unnoticed. For example, the media
dialog functionnality was entirely broken because the .modal-dialog
element was not receiving the correct class anymore.
- The JS translation function is _t, not _
- Do not use the <title/> tag as a regular DOM element, it is meant to
be unique, in the <head/> section
- CSS rules were added to the utils.scss file, which is meant to contain
functions and mixins, otherwise, the rule is duplicated in every asset
- Some icons were still broken, as missed by https://github.com/odoo/odoo/commit/f90cf060a3cfeb37a67bec83264c0aaab8892b56
- Tests were changed to use [role="dialog"]/footer/header in their
selectors without any reason, this commit restores some of that to
avoid rebase conflicts with the BS4 work.
- ...
Note: other elements should still be discussed, like the direct use of
the 'o_form_label' class in views definition... but those do not cause
direct problems.
Diffstat (limited to 'odoo/addons/test_main_flows/static/src')
| -rw-r--r-- | odoo/addons/test_main_flows/static/src/js/tour.js | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/odoo/addons/test_main_flows/static/src/js/tour.js b/odoo/addons/test_main_flows/static/src/js/tour.js index 833a6233d49..db978890e8b 100644 --- a/odoo/addons/test_main_flows/static/src/js/tour.js +++ b/odoo/addons/test_main_flows/static/src/js/tour.js @@ -122,7 +122,7 @@ tour.register('main_flow_tour', { position: 'right', }, { trigger: ".o_field_widget[name=name] input", - extra_trigger: "[role=\"dialog\"]", + extra_trigger: ".modal-dialog", content: _t('Select a seller'), position: 'top', run: "text the_flow.vendor", @@ -135,12 +135,12 @@ tour.register('main_flow_tour', { position: 'right', run: "text 1", }, { - trigger: "footer.modal-footer .btn-primary:first", + trigger: ".modal-footer .btn-primary:first", extra_trigger: ".o_field_widget[name=name] > .o_external_button", // Wait name_create content: _t('Save & Close'), position: 'bottom', }, { - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", content: _t('Save'), position: 'bottom', }, @@ -176,7 +176,7 @@ tour.register('main_flow_tour', { position: 'right', }, { trigger: ".o_field_widget[name=name] input", - extra_trigger: "[role=\"dialog\"]", + extra_trigger: ".modal-dialog", content: _t('Select a seller'), position: 'top', run: "text the_flow.vendor", @@ -190,11 +190,11 @@ tour.register('main_flow_tour', { position: 'right', run: "text 1", }, { - trigger: "footer.modal-footer .btn-primary:first", + trigger: ".modal-footer .btn-primary:first", content: _t('Save & Close'), position: 'bottom', }, { - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", // Wait Save & Close and check value extra_trigger: ".o_field_widget[name=seller_ids] .o_data_row td:nth-child(2):contains('the_flow.vendor')", content: _t('Save'), @@ -326,8 +326,8 @@ tour.register('main_flow_tour', { run: function (actions) { actions.auto(); // if the one2many isn't editable, we have to close the dialog - if ($("footer.modal-footer .btn-primary").length) { - actions.auto("footer.modal-footer .btn-primary"); + if ($(".modal-footer .btn-primary").length) { + actions.auto(".modal-footer .btn-primary"); } }, }, { @@ -338,7 +338,7 @@ tour.register('main_flow_tour', { trigger: ".o_field_widget[name=product_id] input", // the one2many may be editable or not according to the modules installed, so // we have to handle both cases - extra_trigger: '.o_field_widget[name=order_line] .o_data_row:nth(1).o_selected_row, [role="dialog"]', + extra_trigger: '.o_field_widget[name=order_line] .o_data_row:nth(1).o_selected_row, .modal-dialog', content: _t("Select a product"), position: "right", run: "text the_flow.service", @@ -349,8 +349,8 @@ tour.register('main_flow_tour', { run: function (actions) { actions.auto(); // if the one2many isn't editable, we have to close the dialog - if ($("footer.modal-footer .btn-primary").length) { - actions.auto("footer.modal-footer .btn-primary"); + if ($(".modal-footer .btn-primary").length) { + actions.auto(".modal-footer .btn-primary"); } }, }, { @@ -368,11 +368,11 @@ tour.register('main_flow_tour', { position: "right", run: "text test@the_flow.com", },{ - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", content: _t("Save your changes"), position: "bottom", }, { - trigger: "footer.modal-footer .btn-primary span:contains('Send')", + trigger: ".modal-footer .btn-primary span:contains('Send')", content: _t("Try to send it to email"), position: "bottom", }, { @@ -440,8 +440,8 @@ tour.register('main_flow_tour', { content: _t("Click on schedulers"), position: "bottom" }, { - trigger: "footer.modal-footer .btn-primary", - extra_trigger: "[role=\"dialog\"]", + trigger: ".modal-footer .btn-primary", + extra_trigger: ".modal-dialog", content: _t("Run Schedulers"), position: "bottom", }, { @@ -471,8 +471,8 @@ tour.register('main_flow_tour', { content: _t("Validate"), position: "bottom", }, { - trigger: "footer.modal-footer .btn-primary", - extra_trigger: "[role=\"dialog\"]", + trigger: ".modal-footer .btn-primary", + extra_trigger: ".modal-dialog", content: _t("Apply"), position: "bottom", }, { @@ -497,12 +497,12 @@ tour.register('main_flow_tour', { position: "bottom", }, { trigger: "select.o_field_widget[name=journal_id]", - extra_trigger: "[role=\"dialog\"]", + extra_trigger: ".modal-dialog", content: _t("Select Journal"), position: "bottom", run: 'text(Bank (USD))', }, { - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", extra_trigger: ".o_field_widget[name=payment_method_id]", // FIXME: Wait onchange content: _t("Validate"), position: "bottom", @@ -538,7 +538,7 @@ tour.register('main_flow_tour', { content: _t("Produce"), position: "bottom", }, { - trigger: "footer.modal-footer .btn-primary:first", + trigger: ".modal-footer .btn-primary:first", content: _t('Record Production'), position: 'bottom', }, { @@ -617,7 +617,7 @@ tour.register('main_flow_tour', { content: _t("Validate"), position: "bottom", }, { - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", content: _t("Create and View Invoices"), position: "bottom", }, { @@ -630,12 +630,12 @@ tour.register('main_flow_tour', { position: "bottom", }, { trigger: "select.o_field_widget[name=journal_id]", - extra_trigger: "[role=\"dialog\"]", + extra_trigger: ".modal-dialog", content: _t("Select Journal"), position: "bottom", run: 'text(Bank (USD))', }, { - trigger: "footer.modal-footer .btn-primary", + trigger: ".modal-footer .btn-primary", content: _t("Validate"), position: "bottom", }, { |
