- 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.
This commit is contained in:
qsm-odoo
2018-07-09 11:59:30 +02:00
committed by Quentin Smetz (qsm)
parent 49a905321a
commit 2c966909e2
60 changed files with 628 additions and 642 deletions
@@ -941,11 +941,11 @@ QUnit.module('account', {
// Simulate changing partner with SelectCreateDialog
widget = clientAction.widgets[1];
assert.strictEqual($('[role="dialog"]').length, 0, "shouldn't have any opened modal");
assert.strictEqual($('.modal').length, 0, "shouldn't have any opened modal");
widget.$('.o_input_dropdown input').trigger('click');
$('.ui-autocomplete .ui-menu-item a:contains(Search More):eq(1)').trigger('mouseenter').trigger('click');
assert.strictEqual($('[role="dialog"]').length, 1, "should open a SelectCreateDialog");
$('[role="dialog"] table.o_list_view td:contains(Camptocamp)').click();
assert.strictEqual($('.modal').length, 1, "should open a SelectCreateDialog");
$('.modal table.o_list_view td:contains(Camptocamp)').click();
assert.strictEqual(widget.$('.o_input_dropdown input').val(), "Camptocamp", "the partner many2one should display Camptocamp");
widget = clientAction.widgets[2];
@@ -1100,7 +1100,7 @@ QUnit.module('account', {
widget.$('.create .create_account_id input').trigger('click');
$('.ui-autocomplete .ui-menu-item a:contains(Search)').trigger('mouseenter').trigger('click');
// select the account who does not appear in the drop drown
$('[role="dialog"] tr.o_data_row:contains(502)').click();
$('.modal tr.o_data_row:contains(502)').click();
assert.strictEqual(widget.$('.create .create_account_id input').val(), "101200 Account Receivable", "Selected account does not change");
// wait the name_get to render the changes
def.resolve();
@@ -349,7 +349,7 @@ FormController.include({
}
// only catch the event if we're not focused in
// another field and it's a number
if (!$(event.target).is('body, [role="dialog"]') || !/[0-9]/.test(character)) {
if (!$(event.target).is('body, .modal') || !/[0-9]/.test(character)) {
return;
}
@@ -468,12 +468,12 @@ QUnit.test('specification of widget barcode_handler with keypress and notifyChan
setTimeout(function () {
var keycode = $.ui.keyCode.ENTER;
assert.strictEqual($('main.modal-body').length, 1, 'should open a modal with a quantity as input');
assert.strictEqual($('main.modal-body .o_set_qty_input').val(), '5', 'the quantity by default in the modal shoud be 5');
assert.strictEqual($('.modal .modal-body').length, 1, 'should open a modal with a quantity as input');
assert.strictEqual($('.modal .modal-body .o_set_qty_input').val(), '5', 'the quantity by default in the modal shoud be 5');
$('main.modal-body .o_set_qty_input').val('7');
$('.modal .modal-body .o_set_qty_input').val('7');
$('main.modal-body .o_set_qty_input').trigger($.Event('keypress', {which: keycode, keyCode: keycode}));
$('.modal .modal-body .o_set_qty_input').trigger($.Event('keypress', {which: keycode, keyCode: keycode}));
assert.strictEqual(form.$('.o_data_row .o_data_cell:nth(1)').text(), '7',
"quantity checked should be 7");
@@ -524,7 +524,7 @@ QUnit.test('barcode_scanned only trigger error for active view', function (asser
form.$('.o_data_row:first').click();
// We do not trigger on the body since modal and
// We do not trigger on the body since modal and
// form view are both inside it.
function modalTriggerKeypressEvent(char) {
var keycode;
@@ -533,7 +533,7 @@ QUnit.test('barcode_scanned only trigger error for active view', function (asser
} else {
keycode = char.charCodeAt(0);
}
return $('[role="dialog"]').trigger($.Event('keypress', {which: keycode, keyCode: keycode}));
return $('.modal').trigger($.Event('keypress', {which: keycode, keyCode: keycode}));
}
_.each(['O','-','B','T','N','.','c','a','n','c','e','l','Enter'], modalTriggerKeypressEvent);
assert.verifySteps(['warning'], "only one event should be triggered");
@@ -120,8 +120,11 @@
</div>
<div class="o_setting_right_pane">
<label string="Inter Company Flows" for="module_inter_company_rules"/>
<div class="fa fa-lg fa-building-o text-muted">
the creation of documents between your companies
<div>
<i class="fa fa-lg fa-building-o"/>
<span class="text-muted">
the creation of documents between your companies
</span>
</div>
<div class="content-group" attrs="{'invisible': [('module_inter_company_rules','=',False)]}" id="inter_companies_rules">
<div class="mt16 text-warning"><strong>Save</strong> this page and come back here to set up the feature.</div>
+8 -8
View File
@@ -161,17 +161,17 @@ QUnit.test('basic functionality, with one sub action', function (assert) {
assert.ok(form.$('.oe_content').is(':visible'), "content is visible again");
assert.verifySteps(['load action', 'edit custom', 'edit custom']);
assert.strictEqual($('[role="dialog"]').length, 0, "should have no modal open");
assert.strictEqual($('.modal').length, 0, "should have no modal open");
form.$('button.oe_dashboard_link_change_layout').click();
assert.strictEqual($('[role="dialog"]').length, 1, "should have opened a modal");
assert.strictEqual($('[role="dialog"] li[data-layout="2-1"] i.oe_dashboard_selected_layout').length, 1,
assert.strictEqual($('.modal').length, 1, "should have opened a modal");
assert.strictEqual($('.modal li[data-layout="2-1"] i.oe_dashboard_selected_layout').length, 1,
"should mark currently selected layout");
$('[role="dialog"] .oe_dashboard_layout_selector li[data-layout="1-1"]').click();
$('.modal .oe_dashboard_layout_selector li[data-layout="1-1"]').click();
assert.strictEqual($('[role="dialog"]').length, 0, "should have no modal open");
assert.strictEqual($('.modal').length, 0, "should have no modal open");
assert.strictEqual(form.$('table.oe_dashboard[data-layout="1-1"]').length, 1,
"should have rendered a table with correct layout");
@@ -179,12 +179,12 @@ QUnit.test('basic functionality, with one sub action', function (assert) {
assert.strictEqual(form.$('.oe_action').length, 1, "should have one displayed action");
form.$('span.oe_close').click();
assert.strictEqual($('[role="dialog"]').length, 1, "should have opened a modal");
assert.strictEqual($('.modal').length, 1, "should have opened a modal");
// confirm the close operation
$('[role="dialog"] button.btn-primary').click();
$('.modal button.btn-primary').click();
assert.strictEqual($('[role="dialog"]').length, 0, "should have no modal open");
assert.strictEqual($('.modal').length, 0, "should have no modal open");
assert.strictEqual(form.$('.oe_action').length, 0, "should have no displayed action");
assert.verifySteps(['load action', 'edit custom', 'edit custom', 'edit custom', 'edit custom']);
+2 -2
View File
@@ -41,12 +41,12 @@ tour.register('crm_tour', {
content: _t("Let's schedule an activity."),
position: "bottom"
}, {
trigger: 'main.modal-body .o_field_many2one',
trigger: '.modal-body .o_field_many2one',
extra_trigger: ".o_opportunity_kanban",
content: _t("<p>You will be able to customize your followup activities. Examples:</p><ol><li>introductory email</li><li>call 10 days after</li><li>second call 3 days after, ...</li></ol><p class='mb0'><i>Select a standard activity for now.</i></p>"),
position: "bottom",
run: function (actions) {
actions.auto('footer.modal-footer button[special=cancel]');
actions.auto('.modal-footer button[special=cancel]');
},
}, {
trigger: ".o_kanban_record",
@@ -70,7 +70,7 @@ odoo.define('document.tests', function (require) {
assert.strictEqual(form.sidebar.$('.o_sidebar_delete_attachment').length, 2, "there should be two attachments");
form.sidebar.$('.o_sidebar_delete_attachment:eq(0)').click();
$('footer.modal-footer .btn-primary').click();
$('.modal-footer .btn-primary').click();
assert.strictEqual(form.sidebar.$('.o_sidebar_delete_attachment').length, 1, "there should be only one attachment");
form.destroy();
});
@@ -17,7 +17,8 @@
<t t-extend="mail.discuss_mobile">
<t t-jquery=".o_mail_mobile_tabs" t-operation="append">
<div class="o_mail_mobile_tab" data-type="livechat">
<span class="fa fa-comments o_tab_title">Livechat</span>
<span class="fa fa-comments"/>
<span class="o_tab_title">Livechat</span>
</div>
</t>
</t>
+16 -16
View File
@@ -686,7 +686,7 @@ QUnit.test('chatter: discard changes on message post with post_refresh "always"'
var $modal = $('.modal-dialog');
assert.strictEqual($modal.length, 1, "should have a modal opened");
assert.strictEqual($modal.find('.modal-body p').text(),
assert.strictEqual($modal.find('.modal-body').text(),
"The record has been modified, your changes will be discarded. Do you want to proceed?",
"should warn the user that any unsaved changes will be lost");
@@ -862,7 +862,7 @@ QUnit.test('chatter: discard changes on message post with post_refresh "recipien
var $modal = $('.modal-dialog');
assert.strictEqual($modal.length, 1, "should have a modal opened");
assert.strictEqual($modal.find('.modal-body p').text(),
assert.strictEqual($modal.find('.modal-body').text(),
"The record has been modified, your changes will be discarded. Do you want to proceed?",
"should warn the user that any unsaved changes will be lost");
@@ -915,7 +915,7 @@ QUnit.test('chatter: discard changes on opening full-composer', function (assert
var $modal = $('.modal-dialog');
assert.strictEqual($modal.length, 1, "should have a modal opened");
assert.strictEqual($modal.find('.modal-body p').text(),
assert.strictEqual($modal.find('.modal-body').text(),
"The record has been modified, your changes will be discarded. Do you want to proceed?",
"should warn the user that any unsaved changes will be lost");
@@ -994,7 +994,7 @@ QUnit.test('chatter: Attachment viewer', function (assert) {
assert.strictEqual($('.o_modal_fullscreen img.o_viewer_img[data-src="/web/image/1?unique=1"]').length, 1,
"Modal popup should open with first image src");
// click on next button
$('[role="dialog"] .arrow.arrow-right.move_next span').click();
$('.modal .arrow.arrow-right.move_next span').click();
assert.strictEqual($('.o_modal_fullscreen img.o_viewer_img[data-src="/web/image/2?unique=1"]').length, 1,
"Modal popup should have now second image src");
assert.strictEqual($('.o_modal_fullscreen .o_viewer_toolbar .o_download_btn').length, 1,
@@ -1467,8 +1467,8 @@ QUnit.test('followers widget: follow/unfollow, edit subtypes', function (assert)
// click to unfollow
form.$('.o_followers_follow_button').click(); // click to open the dropdown
assert.ok($('[role="dialog"]').length, 'a confirm modal should be opened');
$('footer.modal-footer .btn-primary').click(); // click on 'OK'
assert.ok($('.modal').length, 'a confirm modal should be opened');
$('.modal .modal-footer .btn-primary').click(); // click on 'OK'
assert.strictEqual(form.$('.o_followers_count').text(), "0", 'should have no followers');
assert.ok(form.$('.o_followers_follow_button.o_followers_notfollow').length,
'should display the "Follow" button');
@@ -1672,16 +1672,16 @@ QUnit.test('fieldmany2many tags email', function (assert) {
done();
});
assert.strictEqual($('main.modal-body.o_act_window').length, 1,
assert.strictEqual($('.modal-body.o_act_window').length, 1,
"there should be one modal opened to edit the empty email");
assert.strictEqual($('main.modal-body input[name="display_name"]').val(), "silver",
assert.strictEqual($('.modal-body.o_act_window input[name="display_name"]').val(), "silver",
"the opened modal should be a form view dialog with the partner_type 14");
assert.strictEqual($('main.modal-body input[name="email"]').length, 1,
assert.strictEqual($('.modal-body.o_act_window input[name="email"]').length, 1,
"there should be an email field in the modal");
// set the email and save the modal (will render the form view)
$('main.modal-body input[name="email"]').val('coucou@petite.perruche').trigger('input');
$('footer.modal-footer .btn-primary').click();
$('.modal-body.o_act_window input[name="email"]').val('coucou@petite.perruche').trigger('input');
$('.modal-footer .btn-primary').click();
});
QUnit.test('fieldmany2many tags email (edition)', function (assert) {
@@ -1724,16 +1724,16 @@ QUnit.test('fieldmany2many tags email (edition)', function (assert) {
$input.click(); // opens the dropdown
$input.autocomplete('widget').find('li:first').click(); // add 'silver'
assert.strictEqual($('main.modal-body.o_act_window').length, 1,
assert.strictEqual($('.modal-body.o_act_window').length, 1,
"there should be one modal opened to edit the empty email");
assert.strictEqual($('main.modal-body input[name="display_name"]').val(), "silver",
assert.strictEqual($('.modal-body.o_act_window input[name="display_name"]').val(), "silver",
"the opened modal in edit mode should be a form view dialog with the partner_type 14");
assert.strictEqual($('main.modal-body input[name="email"]').length, 1,
assert.strictEqual($('.modal-body.o_act_window input[name="email"]').length, 1,
"there should be an email field in the modal");
// set the email and save the modal (will rerender the form view)
$('main.modal-body input[name="email"]').val('coucou@petite.perruche').trigger('input');
$('footer.modal-footer .btn-primary').click();
$('.modal-body.o_act_window input[name="email"]').val('coucou@petite.perruche').trigger('input');
$('.modal-footer .btn-primary').click();
assert.strictEqual(form.$('.o_field_many2manytags[name="timmy"] button.o_tag_color_0').length, 2,
"should contain the second tag");
+2 -2
View File
@@ -184,7 +184,7 @@ QUnit.module('pad widget', {
});
var def = form.canBeDiscarded();
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
"should have no confirmation modal opened");
assert.strictEqual(def.state(), 'resolved',
@@ -221,7 +221,7 @@ QUnit.module('pad widget', {
form.$buttons.find('.o_form_button_edit').click();
var def = form.canBeDiscarded();
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
"should have no confirmation modal opened");
assert.strictEqual(def.state(), 'resolved',
+32 -32
View File
@@ -334,7 +334,7 @@
<t t-if='partner.id'>
<img t-att-src='widget.partner_icon_url(partner.id)' alt="Partner"/>
</t>
<input type='file' class='image-uploader'></input>
<input type='file' class='image-uploader'></input>
</div>
<input class='detail client-name' name='name' t-att-value='partner.name' placeholder='Name'></input>
<div class='edit-buttons'>
@@ -360,7 +360,7 @@
<select class='detail client-address-country needsclick' name='country_id'>
<option value=''>None</option>
<t t-foreach='widget.pos.countries' t-as='country'>
<option t-att-value='country.id' t-att-selected="partner.country_id ? ((country.id === partner.country_id[0]) ? true : undefined) : undefined">
<option t-att-value='country.id' t-att-selected="partner.country_id ? ((country.id === partner.country_id[0]) ? true : undefined) : undefined">
<t t-esc='country.name'/>
</option>
</t>
@@ -389,7 +389,7 @@
<select class='detail needsclick' name='property_product_pricelist'>
<t t-foreach='widget.pos.pricelists' t-as='pricelist'>
<option t-att-value='pricelist.id'
t-att-selected="partner.property_product_pricelist ? (pricelist.id === partner.property_product_pricelist[0] ? true : undefined) : undefined">
t-att-selected="partner.property_product_pricelist ? (pricelist.id === partner.property_product_pricelist[0] ? true : undefined) : undefined">
<t t-esc='pricelist.display_name'/>
</option>
</t>
@@ -531,7 +531,7 @@
<t t-esc="widget.format_currency(order.get_total_with_tax())"/>
</div>
<div class='message'>
Please select a payment method.
Please select a payment method.
</div>
</div>
</t>
@@ -559,19 +559,19 @@
<t t-if='line.selected'>
<tr class='paymentline selected'>
<td class='col-due'> <t t-esc='widget.format_currency_no_symbol(order.get_due(line))' /> </td>
<td class='col-tendered edit'>
<td class='col-tendered edit'>
<t t-esc='widget.inputbuffer' />
<!-- <t t-esc='line.get_amount()' /> -->
</td>
<t t-if='order.get_change(line)'>
<td class='col-change highlight' >
<td class='col-change highlight' >
<t t-esc='widget.format_currency_no_symbol(order.get_change(line))' />
</td>
</t>
<t t-if='!order.get_change(line)'>
<td class='col-change' ></td>
</t>
<td class='col-name' > <t t-esc='line.name' /> </td>
<td class='delete-button' t-att-data-cid='line.cid' aria-label="Delete" title="Delete"> <i class='fa fa-times-circle' /> </td>
</tr>
@@ -580,7 +580,7 @@
<tr class='paymentline' t-att-data-cid='line.cid'>
<td class='col-due'> <t t-esc='widget.format_currency_no_symbol(order.get_due(line))' /> </td>
<td class='col-tendered'> <t t-esc='widget.format_currency_no_symbol(line.get_amount())' /> </td>
<td class='col-change'>
<td class='col-change'>
<t t-if='order.get_change(line)'>
<t t-esc='widget.format_currency_no_symbol(order.get_change(line))' />
</t>
@@ -668,8 +668,8 @@
<div class='payment-buttons'>
<div class='button js_set_customer'>
<i class='fa fa-user' role="img" aria-label="Customer" title="Customer"/>
<span class='js_customer_name'>
<i class='fa fa-user' role="img" aria-label="Customer" title="Customer"/>
<span class='js_customer_name'>
<t t-if="widget.pos.get_client()">
<t t-esc="widget.pos.get_client().name" />
</t>
@@ -687,7 +687,7 @@
</t>
<t t-if='widget.pos.config.tip_product_id'>
<div class='button js_tip'>
<i class='fa fa-heart' /> Tip
<i class='fa fa-heart' /> Tip
</div>
</t>
<t t-if='widget.pos.config.iface_cashdrawer'>
@@ -700,7 +700,7 @@
</div>
</div>
</t>
<t t-name="ReceiptScreenWidget">
<div class='receipt-screen screen'>
<div class='screen-content'>
@@ -795,9 +795,9 @@
<t t-esc='line.quantity' />
</value>
<t t-if='line.unit_name !== "Unit(s)"'>
<t t-esc='line.unit_name' />
<t t-esc='line.unit_name' />
</t>
x
x
<value t-att-value-decimals='pos.dp["Product Price"]'>
<t t-esc='line.price' />
</value>
@@ -841,14 +841,14 @@
<right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='line.get_amount()'/></value></right>
</line>
</t>
<br/>
<br/>
<line size='double-height'>
<left><pre> CHANGE</pre></left>
<right><value t-att-value-decimals='pos.currency.decimals'><t t-esc='receipt.change' /></value></right>
</line>
<br/>
<!-- Extra Payment Info -->
<t t-if='receipt.total_discount'>
@@ -918,7 +918,7 @@
<t t-esc='line.quantity' />
</value>
<t t-if='line.uom !== "Unit(s)"'>
<t t-esc='line.uom' />
<t t-esc='line.uom' />
</t>
</right>
<right>
@@ -1057,10 +1057,10 @@
<main class="body"><t t-esc=" widget.options.body || '' "/></main>
<footer class="footer">
<div class="button confirm">
Confirm
Confirm
</div>
<div class="button cancel">
Cancel
Cancel
</div>
</footer>
</div>
@@ -1074,10 +1074,10 @@
<input type='text' t-att-value="widget.options.value || ''"></input>
<div class="footer">
<div class="button confirm">
Ok
Ok
</div>
<div class="button cancel">
Cancel
Cancel
</div>
</div>
</div>
@@ -1116,14 +1116,14 @@
<t t-name="TextAreaPopupWidget">
<div role="dialog" class="modal-dialog">
<div class="popup popup-textinput">
<title class="title"><t t-esc=" widget.options.title || '' " /></title>
<header class="title"><t t-esc=" widget.options.title || '' " /></header>
<textarea rows="10" cols="40"><t t-esc="widget.options.value" /></textarea>
<footer class="footer">
<div class="button confirm">
Ok
Ok
</div>
<div class="button cancel">
Cancel
Cancel
</div>
</footer>
</div>
@@ -1143,7 +1143,7 @@
</div>
<footer class="footer">
<div class="button cancel">
Cancel
Cancel
</div>
</footer>
</div>
@@ -1195,7 +1195,7 @@
</div>
<footer class="footer centered">
<div class="button cancel">
Cancel
Cancel
</div>
<div class="button confirm">
Ok
@@ -1222,11 +1222,11 @@
<li><b><t t-esc="report.unpaid_skipped_session || 0" /></b> belong to another session:
<t t-if="report.unpaid_skipped_sessions">
<ul>
<li>Session ids: <b><t t-esc="JSON.stringify(report.unpaid_skipped_sessions)" /></b></li>
<li>Session ids: <b><t t-esc="JSON.stringify(report.unpaid_skipped_sessions)" /></b></li>
</ul>
</t>
</li>
</ul>
</li>
</t>
@@ -1244,7 +1244,7 @@
<t t-name="Product">
<article class='product' t-att-data-product-id="product.id" tabindex="0" t-attf-aria-labelledby="article_product_#{product.id}">
<div class="product-img">
<img t-att-src='image_url' alt="Product image"/>
<img t-att-src='image_url' alt="Product image"/>
<t t-if="!product.to_weight">
<span class="price-tag">
<t t-esc="widget.format_currency(product.get_price(pricelist, 1),'Product Price')"/>
@@ -1291,7 +1291,7 @@
</t>
<t t-if="line.get_discount_str() !== '0'">
<li class="info">
With a
With a
<em>
<t t-esc="line.get_discount_str()" />%
</em>
@@ -1446,7 +1446,7 @@
<t t-name="PosTicket">
<div class="pos-sale-ticket">
<div class="pos-center-align"><t t-esc="order.formatted_validation_date"/> <t t-esc="order.name"/></div>
<br />
<t t-esc="widget.pos.company.name"/><br />
@@ -1545,7 +1545,7 @@
</div>
</t>
<!-- Onscreen Keyboard :
<!-- Onscreen Keyboard :
http://net.tutsplus.com/tutorials/javascript-ajax/creating-a-keyboard-with-css-and-jquery/ -->
<t t-name="OnscreenKeyboardFull">
<div class="keyboard_frame">
+1 -1
View File
@@ -27,7 +27,7 @@ tour.register('project_tour', {
content: _t('This will create new project and redirect us to its tasks.'),
position: 'right',
run: function (actions) {
actions.auto('[role="dialog"]:visible .btn.btn-primary');
actions.auto('.modal:visible .btn.btn-primary');
},
}, {
trigger: ".o_kanban_project_tasks .o_column_quick_create input",
+3 -3
View File
@@ -118,12 +118,12 @@ QUnit.module('project', {
assert.strictEqual(kanban.$('img').length, 0, "Initially there is no image.");
kanban.$('.o_dropdown_kanban [data-type=set_cover]').eq(0).click();
// single click on image
$('[role="dialog"]').find("img[data-id='1']").click();
$('footer.modal-footer .btn-primary').click();
$('.modal').find("img[data-id='1']").click();
$('.modal-footer .btn-primary').click();
assert.strictEqual(kanban.$('img[data-src*="/web/image/1"]').length, 1, "Image inserted in record");
$('.o_dropdown_kanban [data-type=set_cover]').eq(1).click();
// double click on image
$('[role="dialog"]').find("img[data-id='2']").dblclick();
$('.modal').find("img[data-id='2']").dblclick();
assert.strictEqual(kanban.$('img[data-src*="/web/image/2"]').length, 1, "Image inserted after double click");
// varify write on both kanban record
assert.verifySteps([1,2]);
+3 -3
View File
@@ -13,15 +13,15 @@ odoo.define("sale_stock.tour", function (require) {
};
tour.tours.sale_tour.steps.splice(quotation_product_selected_step_index+1, 0, {
trigger: "footer.modal-footer .btn-primary",
trigger: ".modal-footer .btn-primary",
auto: true,
}, {
trigger: "body:not(:has(.o_dialog_warning))",
auto: true,
in_modal: false,
run: function (actions) {
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');
}
},
});
+14 -19
View File
@@ -23,7 +23,7 @@ var Dialog = Widget.extend({
focus_control_button: '_onFocusControlButton',
}),
events: _.extend({} , Widget.prototype.events, {
'keydown footer.modal-footer button':'_onFooterButtonKeyDown',
'keydown .modal-footer button':'_onFooterButtonKeyDown',
}),
/**
* @param {Widget} parent
@@ -93,7 +93,7 @@ var Dialog = Widget.extend({
self.$modal.find('.modal-dialog').addClass('modal-sm');
break;
}
self.$footer = self.$modal.find("footer");
self.$footer = self.$modal.find(".modal-footer");
self.set_buttons(self.buttons);
self.$modal.on('hidden.bs.modal', _.bind(self.destroy, self));
});
@@ -103,6 +103,9 @@ var Dialog = Widget.extend({
*/
renderElement: function () {
this._super();
// Note: ideally, the $el which is created/set here should use the
// 'main' tag, we cannot enforce this as it would require to re-create
// the whole element.
if (this.$content) {
this.setElement(this.$content);
}
@@ -169,15 +172,7 @@ var Dialog = Widget.extend({
var self = this;
this.appendTo($('<div/>')).then(function () {
var $main = self.$modal.find("main:first");
if ($main.length === 0) {
$main = self.$modal.find(".modal-body:first");
}
if (self.$el.tagName !== 'MAIN') {
self.$el.removeClass(".modal-body");
self.$el = $('<main class="modal-body"/>').append(self.$el);
}
$main.replaceWith(self.$el);
self.$modal.find(".modal-body").replaceWith(self.$el);
self.$modal.attr('open', true);
self.$modal.removeAttr("aria-hidden");
self.$modal.modal('show');
@@ -212,13 +207,11 @@ var Dialog = Widget.extend({
$('.tooltip').remove(); //remove open tooltip if any to prevent them staying when modal has disappeared
if (this.$modal) {
this.$modal.modal('hide');
this.$modal.removeAttr('open');
this.$modal.attr('aria-hidden', true);
this.$modal.remove();
}
if (!isFocusSet) {
var modals = $('body > [role="dialog"]').filter(':visible');
var modals = $('body > .modal').filter(':visible');
if (modals.length) {
modals.last().focus();
// Keep class modal-open (deleted by bootstrap hide fnct) on body to allow scrolling inside the modal
@@ -300,9 +293,10 @@ Dialog.alert = function (owner, message, options) {
return new Dialog(owner, _.extend({
size: 'medium',
buttons: buttons,
$content: $('<main role="alert"/>').append($('<p>', {
$content: $('<main/>', {
role: 'alert',
text: message,
})),
}),
title: _t("Alert"),
}, options)).open({shouldFocusButtons:true});
};
@@ -325,9 +319,10 @@ Dialog.confirm = function (owner, message, options) {
return new Dialog(owner, _.extend({
size: 'medium',
buttons: buttons,
$content: $('<main role="alert">').append($('<p>', {
$content: $('<main/>', {
role: 'alert',
text: message,
})),
}),
title: _t("Confirmation"),
}, options)).open({shouldFocusButtons:true});
};
@@ -358,7 +353,7 @@ Dialog.safeConfirm = function (owner, message, options) {
text: message,
});
}
$content = $('<main role="alert"/>').append($content, $securityCheck);
$content = $('<main/>', {role: 'alert'}).append($content, $securityCheck);
var buttons = [
{
@@ -1603,7 +1603,7 @@ var AttachmentImage = AbstractField.extend({
this.$el.empty().append($('<img>/', {
src: "/web/image/" + this.value.data.id + "?unique=1",
title: this.value.data.display_name,
alt: _("Image")
alt: _t("Image")
}));
}
}
@@ -216,7 +216,7 @@ var ColumnQuickCreate = Widget.extend({
}
// ignore clicks in modals
if ($(event.target).closest('[role="dialog"]').length) {
if ($(event.target).closest('.modal').length) {
return;
}
@@ -232,7 +232,7 @@ var RecordQuickCreate = Widget.extend({
}
// ignore clicks in modals
if ($(ev.target).closest('[role="dialog"]').length) {
if ($(ev.target).closest('.modal').length) {
return;
}
@@ -758,7 +758,7 @@ ListRenderer.include({
break;
}
},
/**
/**
* It will returns the first visible widget that is editable
*
* @private
@@ -768,9 +768,9 @@ ListRenderer.include({
var record = this.state.data[this.currentRow];
var recordWidgets = this.allFieldWidgets[record.id];
var firstWidget = _.find(recordWidgets, function (widget) {
var isFirst = widget.$el.is(':visible') &&
var isFirst = widget.$el.is(':visible') &&
(widget.$el.has('input').length > 0 ||
widget.tagName== 'input') &&
widget.tagName== 'input') &&
!widget.$el.hasClass('o_readonly_modifier');
return isFirst;
});
@@ -923,9 +923,9 @@ ListRenderer.include({
// ignore clicks in modals, except if the list is in a modal, and the
// click is performed in that modal
var $clickModal = $(event.target).closest('[role="dialog"]');
var $clickModal = $(event.target).closest('.modal');
if ($clickModal.length) {
var $listModal = this.$el.closest('[role="dialog"]');
var $listModal = this.$el.closest('.modal');
if ($clickModal.prop('id') !== $listModal.prop('id')) {
return;
}
@@ -28,7 +28,7 @@ var ChangePassword = AbstractAction.extend({
var $button = self.$('.oe_form_button');
$button.appendTo(this.getParent().$footer);
$button.eq(1).click(function () {
self.$el.parents('[role="dialog"]').modal('hide');
self.$el.parents('.modal').modal('hide');
});
$button.eq(0).click(function () {
self._rpc({
@@ -848,7 +848,7 @@ if (config.debug) {
if (action) {
var controller = parent.getCurrentControllerInDialog();
self.debugManager = new DebugManager(self);
var $header = self.$modal.find('header.modal-header:first');
var $header = self.$modal.find('.modal-header:first');
return self.debugManager.prependTo($header).then(function () {
self.debugManager.update('action', action, controller.widget);
});
@@ -43,7 +43,7 @@ return Dialog.extend({
var self = this;
this.opened().then(function () {
// this restores default modal height (bootstrap) and allows field selector to overflow
self.$el.css('overflow', 'visible').closest('[role="dialog"]').css('height', 'auto');
self.$el.css('overflow', 'visible').closest('.modal-dialog').css('height', 'auto');
});
return $.when(
this._super.apply(this, arguments),
@@ -508,4 +508,8 @@
// Records colours
@include o-kanban-record-color;
.oe_kanban_color_help {
@include o-position-absolute(0, 5px, 0, -1px);
}
}
-8
View File
@@ -337,14 +337,6 @@
}
}
}
.oe_kanban_color_help {
bottom: 0px;
left: -1px;
top: 0px;
width: 6px;
position: absolute;
right: auto;
}
@mixin o-kanban-slim-col {
position: relative;
@include o-flex(0, 0, auto);
+1 -1
View File
@@ -3,7 +3,7 @@
<!-- These templates are accessible in backend and frontend -->
<div role="dialog" t-name="Dialog" t-attf-class="modal#{technical ? ' o_technical_modal' : ''}" tabindex="-1" data-backdrop="static" t-att-id="_.uniqueId('modal_')">
<div role="dialog" t-name="Dialog" t-attf-class="modal#{technical ? ' o_technical_modal' : ''}" tabindex="-1" data-backdrop="static" t-att-id="_.uniqueId('modal_')" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<header class="modal-header">
@@ -2672,12 +2672,12 @@ QUnit.module('ActionManager', {
// go back to kanban view
$('.o_control_panel .breadcrumb li:first a').click();
assert.strictEqual($('main.modal-body:first').text(),
assert.strictEqual($('.modal .modal-body').text(),
"The record has been modified, your changes will be discarded. Do you want to proceed?",
"should display a modal dialog to confirm discard action");
// cancel
$('footer.modal-footer button.btn-default').click();
$('.modal .modal-footer button.btn-default').click();
assert.strictEqual(actionManager.$('.o_form_view').length, 1,
"should still be in form view");
@@ -2686,7 +2686,7 @@ QUnit.module('ActionManager', {
$('.o_control_panel .breadcrumb li:first a').click();
// confirm discard
$('footer.modal-footer button.btn-primary').click();
$('.modal .modal-footer button.btn-primary').click();
assert.strictEqual(actionManager.$('.o_form_view').length, 0,
"should no longer be in form view");
@@ -3049,7 +3049,7 @@ QUnit.module('ActionManager', {
assert.strictEqual($('.o_technical_modal .o_form_view').length, 1,
"should have rendered a form view in a modal");
assert.ok($('.o_technical_modal main').hasClass('o_act_window'),
assert.ok($('.o_technical_modal .modal-body').hasClass('o_act_window'),
"dialog main element should have classname 'o_act_window'");
assert.ok($('.o_technical_modal .o_form_view').hasClass('o_form_editable'),
"form view should be in edit mode");
@@ -3105,11 +3105,11 @@ QUnit.module('ActionManager', {
});
actionManager.doAction(5);
assert.strictEqual($('.o_technical_modal main button.infooter').length, 0,
assert.strictEqual($('.o_technical_modal .modal-body button.infooter').length, 0,
"the button should not be in the body");
assert.strictEqual($('.o_technical_modal footer button.infooter').length, 1,
assert.strictEqual($('.o_technical_modal .modal-footer button.infooter').length, 1,
"the button should be in the footer");
assert.strictEqual($('.o_technical_modal footer button').length, 1,
assert.strictEqual($('.o_technical_modal .modal-footer button').length, 1,
"the modal footer should only contain one button");
actionManager.destroy();
@@ -3139,7 +3139,7 @@ QUnit.module('ActionManager', {
type: 'ir.actions.client',
});
assert.strictEqual($('[role="dialog"] .o_test').length, 1,
assert.strictEqual($('.modal .o_test').length, 1,
"should have rendered the client action in a dialog");
assert.verifySteps(['on_attach_callback']);
@@ -1880,7 +1880,7 @@ QUnit.module('basic_fields', {
// Actual flow: click on an element of the m2m to get its form view
form.$('tbody td:contains(gold)').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
'The modal should have opened');
assert.verifySteps([
"The view's image should have been fetched",
@@ -2608,7 +2608,7 @@ QUnit.module('basic_fields', {
// switch to form view
form.$('.o_field_widget[name=p] .o_data_row').click();
assert.strictEqual($('[role="dialog"] .o_field_date[name=datetime]').text(), '02/07/2017',
assert.strictEqual($('.modal .o_field_date[name=datetime]').text(), '02/07/2017',
'the datetime (date widget) should be correctly displayed in form view');
form.destroy();
@@ -2652,7 +2652,7 @@ QUnit.module('basic_fields', {
// switch to form view
form.$('.o_field_widget[name=p] .o_data_row').click();
assert.strictEqual($('[role="dialog"] .o_field_date[name=datetime]').text(), '02/08/2017',
assert.strictEqual($('.modal .o_field_date[name=datetime]').text(), '02/08/2017',
'the datetime (date widget) should be correctly displayed in form view');
form.destroy();
@@ -4640,13 +4640,13 @@ QUnit.module('basic_fields', {
// open the selection
form.$(".o_domain_show_selection_button").click();
assert.strictEqual($('[role="dialog"] .o_list_view .o_data_row').length, 2,
assert.strictEqual($('.modal .o_list_view .o_data_row').length, 2,
"should have open a list view with 2 records in a dialog");
// click on a record -> should not open the record
// we don't actually check that it doesn't open the record because even
// if it tries to, it will crash as we don't define an arch in this test
$('[role="dialog"] .o_list_view .o_data_row:first .o_data_cell').click();
$('.modal .o_list_view .o_data_row:first .o_data_cell').click();
form.destroy();
});
File diff suppressed because it is too large Load Diff
@@ -33,7 +33,7 @@ QUnit.module('upgrade_fields', {
});
form.$('input:checkbox').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
"the 'Upgrade to Enterprise' dialog should be opened");
form.destroy();
+39 -39
View File
@@ -213,8 +213,8 @@ QUnit.module('Views', {
$sidebar.find('input[type="text"]').trigger('click');
assert.strictEqual($('ul.ui-autocomplete li:not(.o_m2o_dropdown_option)').text(), "partner 4", "should display the last choice in one2many autocomplete"); // TODO: remove :not(.o_m2o_dropdown_option) because can't have "create & edit" choice
$sidebar.find('.o_calendar_filter_item .o_remove').first().trigger('click');
assert.ok($('footer.modal-footer button.btn:contains(Ok)').length, "should display the confirm message");
$('footer.modal-footer button.btn:contains(Ok)').trigger('click');
assert.ok($('.modal-footer button.btn:contains(Ok)').length, "should display the confirm message");
$('.modal-footer button.btn:contains(Ok)').trigger('click');
assert.strictEqual($sidebar.find('.o_calendar_filter:has(h3:contains(attendees)) .o_calendar_filter_item').length, 3, "click on remove then should display 3 filter items for 'attendees'");
calendar.destroy();
});
@@ -295,19 +295,19 @@ QUnit.module('Views', {
calendar.$('.fc-event:contains(event 4) .fc-content').trigger('click');
assert.ok($('main.modal-body').length, "should open the form view in dialog when click on event");
assert.ok($('footer.modal-footer button.btn:contains(Edit)').length, "formViewDialog should be in readonly mode");
assert.ok($('footer.modal-footer button.btn:contains(Delete)').length, "formViewDialog should have a delete button");
assert.ok($('.modal-body').length, "should open the form view in dialog when click on event");
assert.ok($('.modal-footer button.btn:contains(Edit)').length, "formViewDialog should be in readonly mode");
assert.ok($('.modal-footer button.btn:contains(Delete)').length, "formViewDialog should have a delete button");
$('footer.modal-footer button.btn:contains(Edit)').trigger('click');
$('.modal-footer button.btn:contains(Edit)').trigger('click');
assert.ok($('main.modal-body').length, "should switch the modal in edit mode");
assert.notOk($('footer.modal-footer button.btn:contains(Delete)').length, "formViewDialog should not have a delete button in edit mode");
assert.ok($('.modal-body').length, "should switch the modal in edit mode");
assert.notOk($('.modal-footer button.btn:contains(Delete)').length, "formViewDialog should not have a delete button in edit mode");
$('main.modal-body input:first').val('event 4 modified').trigger('input');
$('footer.modal-footer button.btn:contains(Save)').trigger('click');
$('.modal-body input:first').val('event 4 modified').trigger('input');
$('.modal-footer button.btn:contains(Save)').trigger('click');
assert.notOk($('main.modal-body').length, "save button should close the modal");
assert.notOk($('.modal-body').length, "save button should close the modal");
assert.ok(calendar.$('.fc-event:contains(event 4 modified)').length, "should display the updated records");
// create a new event, quick create only
@@ -319,8 +319,8 @@ QUnit.module('Views', {
assert.ok($('.modal-sm').length, "should open the quick create dialog");
$('main.modal-body input:first').val('new event in quick create').trigger('input');
$('footer.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
$('.modal-body input:first').val('new event in quick create').trigger('input');
$('.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
assert.strictEqual(calendar.$('.fc-event:contains(new event in quick create)').length, 1, "should display the new record after quick create");
assert.strictEqual(calendar.$('td.fc-event-container[colspan]').length, 2, "should the new record have only one day");
@@ -332,7 +332,7 @@ QUnit.module('Views', {
assert.ok($('.modal-sm').length, "should open the quick create dialog");
$('main.modal-body input:first')
$('.modal-body input:first')
.val('new event in quick create validated by pressing enter key.')
.trigger($.Event('keyup', {keyCode: $.ui.keyCode.ENTER}))
.trigger($.Event('keyup', {keyCode: $.ui.keyCode.ENTER}));
@@ -349,8 +349,8 @@ QUnit.module('Views', {
assert.strictEqual($('.modal-sm').length, 1, "should open the quick create dialog");
$('main.modal-body input:first').val('coucou').trigger('input');
$('footer.modal-footer button.btn:contains(Edit)').trigger('click');
$('.modal-body input:first').val('coucou').trigger('input');
$('.modal-footer button.btn:contains(Edit)').trigger('click');
assert.strictEqual($('.modal-lg .o_form_view').length, 1, "should open the slow create dialog");
assert.strictEqual($('.modal-lg .modal-title').text(), "Create: Events",
@@ -371,13 +371,13 @@ QUnit.module('Views', {
testUtils.triggerMouseEvent($cell.next(), "mouseup");
$('.modal-dialog input:first').val('new event in quick create 2').trigger('input');
$('footer.modal-footer button.btn:contains(Edit)').trigger('click');
$('.modal-footer button.btn:contains(Edit)').trigger('click');
assert.strictEqual($('.modal-lg input:first').val(), 'new event in quick create 2', "should open the formViewDialog with default values");
$('.modal-lg button.btn:contains(Save)').trigger('click');
assert.notOk($('[role="dialog"]').length, "should close dialogs");
assert.notOk($('.modal').length, "should close dialogs");
var $newevent2 = calendar.$('.fc-event:contains(new event in quick create 2)');
assert.ok($newevent2.length, "should display the 2 days new record");
assert.strictEqual($newevent2.closest('.fc-event-container').attr('colspan'), "2", "the new record should have 2 days");
@@ -385,9 +385,9 @@ QUnit.module('Views', {
// delete the a record
calendar.$('.fc-event:contains(event 4) .fc-content').trigger('click');
$('footer.modal-footer button.btn:contains(Delete)').trigger('click');
assert.ok($('footer.modal-footer button.btn:contains(Ok)').length, "should display the confirm message");
$('footer.modal-footer button.btn:contains(Ok)').trigger('click');
$('.modal-footer button.btn:contains(Delete)').trigger('click');
assert.ok($('.modal-footer button.btn:contains(Ok)').length, "should display the confirm message");
$('.modal-footer button.btn:contains(Ok)').trigger('click');
assert.notOk(calendar.$('.fc-event:contains(event 4) .fc-content').length, "the record should be deleted");
assert.strictEqual(calendar.$('.fc-event-container .fc-event').length, 10, "should display 10 events");
@@ -442,8 +442,8 @@ QUnit.module('Views', {
assert.strictEqual($('.modal-sm .modal-title').text(), 'Create: Events',
"should open the quick create dialog");
$('main.modal-body input:first').val('new event in quick create').trigger('input');
$('footer.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
$('.modal-body input:first').val('new event in quick create').trigger('input');
$('.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
// If the event is not default-prevented, a traceback will be raised, which we do not want
assert.ok(event.isDefaultPrevented(), "fail deferred event should have been default-prevented");
@@ -1328,7 +1328,7 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(4) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
$('main.modal-body input:first').val('coucou').trigger('input');
$('.modal-body input:first').val('coucou').trigger('input');
testUtils.intercept(calendar, 'do_action', function (event) {
assert.deepEqual(event.data.action,
@@ -1385,7 +1385,7 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(4) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
$('main.modal-body input:first').val('coucou').trigger('input');
$('.modal-body input:first').val('coucou').trigger('input');
testUtils.intercept(calendar, 'do_action', function (event) {
assert.deepEqual(event.data.action,
@@ -1463,7 +1463,7 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(4) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
$('main.modal-body input:first').val('coucou').trigger('input');
$('.modal-body input:first').val('coucou').trigger('input');
testUtils.intercept(calendar, 'do_action', function (event) {
assert.deepEqual(event.data.action,
@@ -1600,8 +1600,8 @@ QUnit.module('Views', {
testUtils.triggerPositionalMouseEvent(left, top + 200, "mousemove");
testUtils.triggerPositionalMouseEvent(left, top + 200, "mouseup");
$('main.modal-body input:first').val('coucou').trigger('input');
$('footer.modal-footer button.btn:contains(Create)').trigger('click');
$('.modal-body input:first').val('coucou').trigger('input');
$('.modal-footer button.btn:contains(Create)').trigger('click');
assert.strictEqual(calendar.$('.o_calendar_filter_item').length, 6, "should add the missing filter (active)");
assert.strictEqual(calendar.$('.fc-event').length, 4, "should display the created item");
@@ -1617,8 +1617,8 @@ QUnit.module('Views', {
testUtils.triggerPositionalMouseEvent(left, top + 200, "mousemove");
testUtils.triggerPositionalMouseEvent(left, top + 200, "mouseup");
$('main.modal-body input:first').val('coucou 2').trigger('input');
$('footer.modal-footer button.btn:contains(Create)').trigger('click');
$('.modal-body input:first').val('coucou 2').trigger('input');
$('.modal-footer button.btn:contains(Create)').trigger('click');
assert.strictEqual(calendar.$('.o_calendar_filter_item').length, 6, "should have the same filters");
assert.strictEqual(calendar.$('.fc-event').length, 4, "should not display the created item");
@@ -1697,10 +1697,10 @@ QUnit.module('Views', {
testUtils.triggerPositionalMouseEvent(left, top + 200, "mousemove");
testUtils.triggerPositionalMouseEvent(left, top + 200, "mouseup");
$('main.modal-body input:first').val('coucou').trigger('input');
$('.modal-body input:first').val('coucou').trigger('input');
$('footer.modal-footer button.btn:contains(Edit)').trigger('click');
$('footer.modal-footer button.btn:contains(Save)').trigger('click');
$('.modal-footer button.btn:contains(Edit)').trigger('click');
$('.modal-footer button.btn:contains(Save)').trigger('click');
assert.strictEqual(calendar.$('.o_calendar_filter_item').length, 6, "should add the missing filter (active)");
assert.strictEqual(calendar.$('.fc-event').length, 4, "should display the created item");
@@ -1906,8 +1906,8 @@ QUnit.module('Views', {
"should open the quick create dialog");
// Creating the event
$('main.modal-body input:first').val('new event in quick create').trigger('input');
$('footer.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
$('.modal-body input:first').val('new event in quick create').trigger('input');
$('.modal-footer button.btn:contains(Create)').trigger('click').trigger('click');
assert.strictEqual(calendar.$('.fc-event:contains(new event in quick create)').length, 1,
"should display the new record after quick create dialog");
@@ -1989,14 +1989,14 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(2) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
var $input = $('[role="dialog"] input:first');
var $input = $('.modal input:first');
$input.val('new event in quick create').trigger('input');
// Simulate ENTER pressed on Create button (after a TAB)
$input.trigger($.Event('keyup', {
which: $.ui.keyCode.ENTER,
keyCode: $.ui.keyCode.ENTER,
}));
$('footer.modal-footer button:first').click();
$('.modal-footer button:first').click();
def.resolve();
assert.strictEqual(createCount, 1,
"should create only one event");
@@ -2221,7 +2221,7 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(2) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
var $input = $('main.modal-body input:first');
var $input = $('.modal-body input:first');
$input.val("It's just a fleshwound").trigger('input');
$('.modal button.btn:contains(Create)').trigger('click');
@@ -2268,7 +2268,7 @@ QUnit.module('Views', {
var $cell = calendar.$('.fc-day-grid .fc-row:eq(2) .fc-day:eq(2)');
testUtils.triggerMouseEvent($cell, "mousedown");
testUtils.triggerMouseEvent($cell, "mouseup");
var $input = $('main.modal-body input:first');
var $input = $('.modal-body input:first');
$input.val("It's just a fleshwound").trigger('input');
$('.modal button.btn:contains(Create)').trigger('click');
+92 -92
View File
@@ -2176,13 +2176,13 @@ QUnit.module('Views', {
"should display the name of the many2many on the original form");
form.$('td:contains(gold)').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
'The partner_type modal should have opened');
assert.strictEqual($('[role="dialog"]').find('td:contains(first record)').length, 1,
assert.strictEqual($('.modal').find('td:contains(first record)').length, 1,
"should display the name of the many2many on the modal form");
$('[role="dialog"]').find('td:contains(first record)').click();
assert.strictEqual($('[role="dialog"]').length, 2,
$('.modal').find('td:contains(first record)').click();
assert.strictEqual($('.modal').length, 2,
'There should be 2 modals (partner on top of partner_type) opened');
form.destroy();
@@ -2212,7 +2212,7 @@ QUnit.module('Views', {
// click on discard
form.$buttons.find('.o_form_button_cancel').click();
assert.ok(!$('[role="dialog"]:visible').length, 'no confirm modal should be displayed');
assert.ok(!$('.modal:visible').length, 'no confirm modal should be displayed');
assert.strictEqual(form.$('.o_field_widget').text(), 'yop', 'field in readonly should display yop');
assert.strictEqual(nbWrite, 0, 'no write RPC should have been done');
@@ -2245,14 +2245,14 @@ QUnit.module('Views', {
// click on discard and cancel the confirm request
form.$buttons.find('.o_form_button_cancel').click();
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-default').click(); // click on cancel
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-default').click(); // click on cancel
assert.strictEqual(form.$('input').val(), 'new value', 'input should still contain new value');
// click on discard and confirm
form.$buttons.find('.o_form_button_cancel').click();
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // click on confirm
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual(form.$('.o_field_widget').text(), 'yop', 'field in readonly should display yop');
assert.strictEqual(nbWrite, 0, 'no write RPC should have been done');
@@ -2332,7 +2332,7 @@ QUnit.module('Views', {
// click on discard and confirm
form.$buttons.find('.o_form_button_cancel').click();
$('footer.modal-footer .btn-primary').click(); // click on confirm
$('.modal-footer .btn-primary').click(); // click on confirm
assert.notOk(form.$el.prop('outerHTML').match('xphone'),
"the string xphone should not be present after discarding");
@@ -2362,7 +2362,7 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_cancel').click();
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
'there should not be a confirm modal');
form.destroy();
@@ -2396,17 +2396,17 @@ QUnit.module('Views', {
// discard the changes and check it has properly been discarded
form.$buttons.find('.o_form_button_cancel').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
'there should be a confirm modal');
assert.strictEqual(form.$('input').val(), 'DEF', 'input should be DEF');
$('footer.modal-footer .btn-primary').click(); // click on confirm
$('.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual(form.$('input').val(), 'ABC', 'input should now be ABC');
// redirty and discard the field foo (to make sure initial changes haven't been lost)
form.$('input').val('GHI').trigger('input');
form.$buttons.find('.o_form_button_cancel').click();
assert.strictEqual(form.$('input').val(), 'GHI', 'input should be GHI');
$('footer.modal-footer .btn-primary').click(); // click on confirm
$('.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual(form.$('input').val(), 'ABC', 'input should now be ABC');
form.destroy();
@@ -2440,7 +2440,7 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_cancel').click();
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
'there should not be a confirm modal');
form.destroy();
@@ -2481,15 +2481,15 @@ QUnit.module('Views', {
// click on the pager to switch to the next record and cancel the confirm request
form.pager.$('.o_pager_next').click(); // click on next
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-default').click(); // click on cancel
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-default').click(); // click on cancel
assert.strictEqual(form.$('input').val(), 'new value', 'input should still contain new value');
assert.strictEqual(form.pager.$('.o_pager_value').text(), "1", 'pager value should still be 1');
// click on the pager to switch to the next record and confirm
form.pager.$('.o_pager_next').click(); // click on next
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // click on confirm
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual(form.$('input').val(), 'blip', 'input should contain blip');
assert.strictEqual(form.pager.$('.o_pager_value').text(), "2", 'pager value should be 2');
@@ -2528,7 +2528,7 @@ QUnit.module('Views', {
// click on the pager to switch to the next record and cancel the confirm request
form.pager.$('.o_pager_next').click(); // click on next
assert.strictEqual($('[role="dialog"]:visible').length, 0, 'no confirm modal should be displayed');
assert.strictEqual($('.modal:visible').length, 0, 'no confirm modal should be displayed');
assert.strictEqual(form.pager.$('.o_pager_value').text(), "2", 'pager value should be 2');
assert.strictEqual(form.$('.o_priority .fa-star-o').length, 2,
@@ -2540,7 +2540,7 @@ QUnit.module('Views', {
'priority widget should have been updated');
form.pager.$('.o_pager_next').click(); // click on next
assert.strictEqual($('[role="dialog"]:visible').length, 0, 'no confirm modal should be displayed');
assert.strictEqual($('.modal:visible').length, 0, 'no confirm modal should be displayed');
assert.strictEqual(form.pager.$('.o_pager_value').text(), "1", 'pager value should be 1');
// switch to edit mode
@@ -2551,8 +2551,8 @@ QUnit.module('Views', {
form.$('input').val('wrong value').trigger('input');
form.$buttons.find('.o_form_button_cancel').click();
assert.strictEqual($('[role="dialog"]').length, 1, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual($('.modal').length, 1, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // click on confirm
form.pager.$('.o_pager_next').click(); // click on next
assert.strictEqual(form.pager.$('.o_pager_value').text(), "2", 'pager value should be 2');
form.destroy();
@@ -2781,16 +2781,16 @@ QUnit.module('Views', {
assert.strictEqual(form.pager.$('.o_pager_limit').text(), "3", 'pager limit should be 3');
assert.strictEqual(form.$('span:contains(yop)').length, 1,
'should have a field with foo value for record 1');
assert.ok(!$('[role="dialog"]:visible').length, 'no confirm modal should be displayed');
assert.ok(!$('.modal:visible').length, 'no confirm modal should be displayed');
// open sidebar
form.sidebar.$('button.o_dropdown_toggler_btn').click();
form.sidebar.$('a:contains(Delete)').click();
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
assert.ok($('.modal').length, 'a confirm modal should be displayed');
// confirm the delete
$('footer.modal-footer button.btn-primary').click();
$('.modal-footer button.btn-primary').click();
assert.strictEqual(form.pager.$('.o_pager_value').text(), "1", 'pager value should be 1');
assert.strictEqual(form.pager.$('.o_pager_limit').text(), "2", 'pager limit should be 2');
@@ -2829,9 +2829,9 @@ QUnit.module('Views', {
testUtils.intercept(form, 'history_back', function () {
assert.step('history_back');
});
assert.strictEqual($('[role="dialog"]').length, 1, 'a confirm modal should be displayed');
$('footer.modal-footer button.btn-primary').click();
assert.strictEqual($('[role="dialog"]').length, 0, 'no confirm modal should be displayed');
assert.strictEqual($('.modal').length, 1, 'a confirm modal should be displayed');
$('.modal-footer button.btn-primary').click();
assert.strictEqual($('.modal').length, 0, 'no confirm modal should be displayed');
assert.verifySteps(['read', 'unlink', 'history_back']);
form.destroy();
@@ -3399,7 +3399,7 @@ QUnit.module('Views', {
// open a subrecord and trigger an onchange
readInModal = true;
form.$('.o_data_row .o_data_cell:first').click();
$('[role="dialog"] .o_field_widget[name=name]').val("new name").trigger('input');
$('.modal .o_field_widget[name=name]').val("new name").trigger('input');
form.destroy();
});
@@ -3627,7 +3627,7 @@ QUnit.module('Views', {
// discard changes
form.$buttons.find('.o_form_button_cancel').click();
$('footer.modal-footer .btn-primary').click();
$('.modal-footer .btn-primary').click();
assert.strictEqual(form.$('span[name="foo"]').text(), "blip",
"field foo should still be displayed to initial value");
@@ -3672,13 +3672,13 @@ QUnit.module('Views', {
assert.strictEqual(form.$('.o_field_widget[name="foo"]').val(), "1234",
"field foo should still contain new value");
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
"Confirm dialog should not be displayed");
// complete the write
def.resolve();
assert.strictEqual($('[role="dialog"]').length, 0,
assert.strictEqual($('.modal').length, 0,
"Confirm dialog should not be displayed");
assert.strictEqual(form.$('.o_field_widget[name="foo"]').text(), "1234",
"value should have been saved and rerendered in readonly");
@@ -3849,9 +3849,9 @@ QUnit.module('Views', {
"onchange should have been correctly applied on field in o2m list");
form.$('.o_data_row').click(); // edit the o2m in the dialog
assert.strictEqual($('[role="dialog"] .modal-title').text().trim(), 'Open: one2many field',
assert.strictEqual($('.modal .modal-title').text().trim(), 'Open: one2many field',
"the field string is displayed in the modal title");
assert.strictEqual($('[role="dialog"] .o_field_widget').val(), 'foo changed',
assert.strictEqual($('.modal .o_field_widget').val(), 'foo changed',
"the onchange value hasn't been discarded when opening the o2m");
form.destroy();
@@ -3943,20 +3943,20 @@ QUnit.module('Views', {
"the initial value should be the default one");
form.$('.o_data_row td:first').click(); // edit the o2m in a dialog
$('[role="dialog"] input:nth(1)').val(77).trigger('input');
assert.strictEqual($('[role="dialog"] input:first').val(), '[blip] 77',
$('.modal input:nth(1)').val(77).trigger('input');
assert.strictEqual($('.modal input:first').val(), '[blip] 77',
"onchange should have been correctly applied");
$('footer.modal-footer .btn-primary').click(); // save the dialog
$('.modal-footer .btn-primary').click(); // save the dialog
assert.strictEqual(form.$('.o_data_row td:first').text(), '[blip] 77',
"onchange should have been correctly applied");
// create a new o2m record
form.$('.o_field_x2many_list_row_add a').click();
assert.strictEqual($('[role="dialog"] .modal-title').text().trim(), 'Create custom label',
assert.strictEqual($('.modal .modal-title').text().trim(), 'Create custom label',
"the custom field label is applied in the modal title");
assert.strictEqual($('[role="dialog"] input:first').val(), '[blip] 14',
assert.strictEqual($('.modal input:first').val(), '[blip] 14',
"onchange should have been correctly applied after default get");
$('footer.modal-footer .btn-primary').click(); // save the dialog
$('.modal-footer .btn-primary').click(); // save the dialog
assert.strictEqual(form.$('.o_data_row:nth(1) td:first').text(), '[blip] 14',
"onchange should have been correctly applied after default get");
@@ -4385,10 +4385,10 @@ QUnit.module('Views', {
// add a o2m subrecord
form.$('.o_field_x2many_list_row_add a').click();
$('main.modal-body .o_field_one2many .o_field_x2many_list_row_add a').click();
$('main.modal-body input').val('xtv').trigger('input');
$('footer.modal-footer button:first').click(); // save & close
assert.strictEqual($('[role="dialog"]').length, 0,
$('.modal-body .o_field_one2many .o_field_x2many_list_row_add a').click();
$('.modal-body input').val('xtv').trigger('input');
$('.modal-footer button:first').click(); // save & close
assert.strictEqual($('.modal').length, 0,
"dialog should be closed");
var row = form.$('.o_field_one2many .o_list_view .o_data_row');
@@ -4684,7 +4684,7 @@ QUnit.module('Views', {
assert.strictEqual(row.children()[1].textContent, '1 record',
"the cell should contains the number of record: 1");
row.click();
var modal_row = $('main.modal-body .o_form_sheet .o_field_one2many .o_list_view .o_data_row');
var modal_row = $('.modal-body .o_form_sheet .o_field_one2many .o_list_view .o_data_row');
assert.strictEqual(modal_row.children().length, 2,
"the row should contains the 2 fields defined in the form view");
assert.strictEqual($(modal_row).text(), "gold2",
@@ -5031,29 +5031,29 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_edit').click();
// Open first dialog
form.$('.o_external_button').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
"One FormViewDialog should be opened");
var $firstModal = $('[role="dialog"]');
assert.strictEqual($('[role="dialog"] .modal-title').first().text().trim(), 'Open: Product',
var $firstModal = $('.modal');
assert.strictEqual($('.modal .modal-title').first().text().trim(), 'Open: Product',
"dialog title should display the python field string as label");
assert.strictEqual($firstModal.find('input').val(), 'xphone',
"display_name should be correctly displayed");
// Open second dialog
$firstModal.find('.o_field_x2many_list_row_add a').click();
assert.strictEqual($('[role="dialog"]').length, 2,
assert.strictEqual($('.modal').length, 2,
"two FormViewDialogs should be opened");
var $secondModal = $('[role="dialog"]:nth(1)');
var $secondModal = $('.modal:nth(1)');
// Add new value
$secondModal.find('input').val('xtv').trigger('input');
$secondModal.find('footer.modal-footer button:first').click(); // Save & close
assert.strictEqual($('[role="dialog"]').length, 1,
$secondModal.find('.modal-footer button:first').click(); // Save & close
assert.strictEqual($('.modal').length, 1,
"last opened dialog should be closed");
// Check that data in first dialog is correctly updated
assert.strictEqual($firstModal.find('tr.o_data_row td').text(), 'xtv',
"should have added a line with xtv as new record");
$firstModal.find('footer.modal-footer button:first').click(); // Save & close
$firstModal.find('.modal-footer button:first').click(); // Save & close
form.destroy();
});
@@ -5255,12 +5255,12 @@ QUnit.module('Views', {
"record 1 should be first");
form.$buttons.find('.o_form_button_edit').click();
form.$('.o_field_x2many_list_row_add a').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
"FormViewDialog should be opened");
$('[role="dialog"] input[name="foo"]').val('xop').trigger("input");
$('footer.modal-footer button:eq(1)').click(); // Save & new
$('[role="dialog"] input[name="foo"]').val('zop').trigger("input");
$('footer.modal-footer button:first').click(); // Save & close
$('.modal input[name="foo"]').val('xop').trigger("input");
$('.modal-footer button:eq(1)').click(); // Save & new
$('.modal input[name="foo"]').val('zop').trigger("input");
$('.modal-footer button:first').click(); // Save & close
// client-side sort
assert.ok(form.$('.o_field_one2many tbody tr:eq(0) td:contains(zop)').length,
@@ -5282,8 +5282,8 @@ QUnit.module('Views', {
// client-side sort on edit
form.$buttons.find('.o_form_button_edit').click();
form.$('.o_field_one2many tbody tr:eq(1) td:contains(yop)').click();
$('[role="dialog"] input[name="foo"]').val('zzz').trigger("input");
$('footer.modal-footer button:first').click(); // Save
$('.modal input[name="foo"]').val('zzz').trigger("input");
$('.modal-footer button:first').click(); // Save
assert.ok(form.$('.o_field_one2many tbody tr:eq(0) td:contains(zzz)').length,
"record zzz should be first");
assert.ok(form.$('.o_field_one2many tbody tr:eq(1) td:contains(zop)').length,
@@ -5569,7 +5569,7 @@ QUnit.module('Views', {
});
form.$('.o_data_row:first').click();
assert.strictEqual($('[role="dialog"] .modal-title').first().text().trim(), 'Open: custom label',
assert.strictEqual($('.modal .modal-title').first().text().trim(), 'Open: custom label',
"modal should use the python field string as title");
form.destroy();
@@ -5655,10 +5655,10 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_edit').click();
form.$('[name="product_id"] .o_external_button').click();
assert.strictEqual($('main.modal-body .o_field_translate').length, 1,
assert.strictEqual($('.modal-body .o_field_translate').length, 1,
"there should be a translate button in the modal");
$('main.modal-body .o_field_translate').click();
$('.modal-body .o_field_translate').click();
assert.strictEqual(nbTranslateCalls, 1, "should call_button translate once");
@@ -5825,7 +5825,7 @@ QUnit.module('Views', {
form.$('.o_statusbar_buttons button').click();
assert.ok(form.$('.o_statusbar_buttons button').prop('disabled'),
'button should be disabled');
$('footer.modal-footer button.btn-default').click();
$('.modal-footer button.btn-default').click();
assert.ok(!form.$('.o_statusbar_buttons button').prop('disabled'),
'button should no longer be disabled');
@@ -5834,7 +5834,7 @@ QUnit.module('Views', {
// click on button, and click on ok in confirm dialog
form.$('.o_statusbar_buttons button').click();
assert.verifySteps(['default_get']);
$('footer.modal-footer button.btn-primary').click();
$('.modal-footer button.btn-primary').click();
assert.verifySteps(['default_get', 'create', 'read', 'execute_action']);
@@ -5890,17 +5890,17 @@ QUnit.module('Views', {
form.$('.o_external_button').click();
assert.notOk($('[role="dialog"] .oe_button_box button').attr('disabled'),
assert.notOk($('.modal .oe_button_box button').attr('disabled'),
"stat buttons should be enabled");
$('[role="dialog"] .oe_button_box button').click();
$('.modal .oe_button_box button').click();
assert.ok($('[role="dialog"] .oe_button_box button').attr('disabled'),
assert.ok($('.modal .oe_button_box button').attr('disabled'),
"stat buttons should be disabled");
def.resolve();
assert.notOk($('[role="dialog"] .oe_button_box button').attr('disabled'),
assert.notOk($('.modal .oe_button_box button').attr('disabled'),
"stat buttons should be enabled");
form.destroy();
@@ -6079,16 +6079,16 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_edit').click();
form.$('.o_field_x2many_list_row_add a').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
"One FormViewDialog should be opened");
// set a value on the m2o
var $dropdown = form.$('.o_field_many2one input').autocomplete('widget');
$('[role="dialog"] .o_field_many2one input').click();
$('.modal .o_field_many2one input').click();
$dropdown.find('li:first()').click();
$('footer.modal-footer button:eq(1)').click(); // Save & new
$('[role="dialog"] .o_field_many2one input').click();
$('footer.modal-footer button:first').click(); // Save & close
$('.modal-footer button:eq(1)').click(); // Save & new
$('.modal .o_field_many2one input').click();
$('.modal-footer button:first').click(); // Save & close
form.destroy();
});
@@ -6178,20 +6178,20 @@ QUnit.module('Views', {
});
form.$('.o_field_x2many_list_row_add a').click();
assert.strictEqual($('[role="dialog"] input.o_field_widget[name=foo]').length, 1,
assert.strictEqual($('.modal input.o_field_widget[name=foo]').length, 1,
'foo should be editable');
checkOnchange = true;
$('[role="dialog"] .o_field_widget[name=foo]').val('foo value').trigger('input');
$('[role="dialog"] .o_field_widget[name=display_name]').val('readonly').trigger('input');
assert.strictEqual($('[role="dialog"] span.o_field_widget[name=foo]').length, 1,
$('.modal .o_field_widget[name=foo]').val('foo value').trigger('input');
$('.modal .o_field_widget[name=display_name]').val('readonly').trigger('input');
assert.strictEqual($('.modal span.o_field_widget[name=foo]').length, 1,
'foo should be readonly');
$('footer.modal-footer .btn-primary').click(); // close the modal
$('.modal-footer .btn-primary').click(); // close the modal
checkOnchange = false;
form.$('.o_data_row').click(); // re-open previous record
assert.strictEqual($('[role="dialog"] .o_field_widget[name=foo]').text(), 'foo value',
assert.strictEqual($('.modal .o_field_widget[name=foo]').text(), 'foo value',
"the edited value should have been kept");
$('footer.modal-footer .btn-primary').click(); // close the modal
$('.modal-footer .btn-primary').click(); // close the modal
form.$buttons.find('.o_form_button_save').click(); // save the record
@@ -6264,8 +6264,8 @@ QUnit.module('Views', {
form.$buttons.find('.o_form_button_save').click(); // save duplicated record
form.sidebar.$('a:contains(Delete)').click(); // delete duplicated record
assert.strictEqual($('[role="dialog"]').length, 1, "should have opened a confirm dialog");
$('footer.modal-footer .btn-primary').click(); // confirm
assert.strictEqual($('.modal').length, 1, "should have opened a confirm dialog");
$('.modal-footer .btn-primary').click(); // confirm
assert.strictEqual(form.$('.o_field_widget').text(), 'first record',
"should have come back to previous record");
@@ -6346,12 +6346,12 @@ QUnit.module('Views', {
});
form.$('.o_external_button').click(); // open the many2one record in a modal
$('[role="dialog"] .o_external_button').click(); // in the modal, open the many2one record in another modal
$('.modal .o_external_button').click(); // in the modal, open the many2one record in another modal
$('[role="dialog"]:nth(1) .o_field_widget[name=display_name]').val('new name').trigger('input');
$('[role="dialog"]:nth(1) footer .btn-primary').first().click(); // save changes
$('.modal:nth(1) .o_field_widget[name=display_name]').val('new name').trigger('input');
$('.modal:nth(1) footer .btn-primary').first().click(); // save changes
assert.strictEqual($('[role="dialog"] .o_field_widget[name=trululu] input').val(), 'new name',
assert.strictEqual($('.modal .o_field_widget[name=trululu] input').val(), 'new name',
"record should have been reloaded");
assert.verifySteps([
"read", // main record
@@ -6454,11 +6454,11 @@ QUnit.module('Views', {
viewOptions: {mode: 'edit'},
});
form.$('.o_external_button').click();
assert.strictEqual($('main.modal-body .o_form_view .o_list_view .o_data_cell').text(), "yopblip",
assert.strictEqual($('.modal-body .o_form_view .o_list_view .o_data_cell').text(), "yopblip",
"table has some initial order");
$('main.modal-body .o_form_view .o_list_view th').click();
assert.strictEqual($('main.modal-body .o_form_view .o_list_view .o_data_cell').text(), "blipyop",
$('.modal-body .o_form_view .o_list_view th').click();
assert.strictEqual($('.modal-body .o_form_view .o_list_view .o_data_cell').text(), "blipyop",
"table is now sorted");
form.destroy();
});
@@ -6894,7 +6894,7 @@ QUnit.module('Views', {
core.bus.on('clear_cache', form, assert.step.bind(assert, 'clear_cache'));
form.sidebar.$('a:contains(Delete)').click();
$('footer.modal-footer .btn-primary').click(); // confirm
$('.modal-footer .btn-primary').click(); // confirm
assert.verifySteps(['unlink', 'clear_cache']);
+31 -31
View File
@@ -183,12 +183,12 @@ QUnit.module('Views', {
"last column should contain 3 records");
envIDs = [4];
kanban.$('.o_kanban_group:last .o_column_archive_records').click(); // Click on 'Archive All'
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-default').click(); // Click on 'Cancel'
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-default').click(); // Click on 'Cancel'
assert.strictEqual(kanban.$('.o_kanban_group:last .o_kanban_record').length, 3, "still last column should contain 3 records");
kanban.$('.o_kanban_group:last .o_column_archive_records').click();
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // Click on 'Ok'
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // Click on 'Ok'
assert.strictEqual(kanban.$('.o_kanban_group:last .o_kanban_record').length, 0, "last column should not contain any records");
kanban.destroy();
});
@@ -1205,16 +1205,16 @@ QUnit.module('Views', {
which: $.ui.keyCode.ENTER,
}));
assert.strictEqual($('[role="dialog"] .o_form_view.o_form_editable').length, 1,
assert.strictEqual($('.modal .o_form_view.o_form_editable').length, 1,
"a form view dialog should have been opened (in edit)");
assert.strictEqual($('[role="dialog"] .o_field_many2one input').val(), 'hello',
assert.strictEqual($('.modal .o_field_many2one input').val(), 'hello',
"the correct product_id should already be set");
// specify a name and save
$('[role="dialog"] input[name=foo]').val('test').trigger('input');
$('footer.modal-footer .btn-primary').click();
$('.modal input[name=foo]').val('test').trigger('input');
$('.modal-footer .btn-primary').click();
assert.strictEqual($('[role="dialog"]').length, 0, "the modal should be closed");
assert.strictEqual($('.modal').length, 0, "the modal should be closed");
assert.strictEqual(kanban.$('.o_kanban_group:first .o_kanban_record').length, 3,
"there should be 3 records in first column");
var $firstRecord = kanban.$('.o_kanban_group:first .o_kanban_record:first');
@@ -1794,13 +1794,13 @@ QUnit.module('Views', {
// delete second column (first cancel the confirm request, then confirm)
kanban.$('.o_kanban_group:last .o_column_delete').click(); // click on delete
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-default').click(); // click on cancel
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-default').click(); // click on cancel
assert.strictEqual(kanban.$('.o_kanban_group:last').data('id'), 5,
'column [5, "xmo"] should still be there');
kanban.$('.o_kanban_group:last .o_column_delete').click(); // click on delete
assert.ok($('[role="dialog"]').length, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // click on confirm
assert.ok($('.modal').length, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // click on confirm
assert.strictEqual(kanban.$('.o_kanban_group:last').data('id'), 3,
'last column should now be [3, "hello"]');
assert.strictEqual(kanban.$('.o_kanban_group').length, 2, "should still have two columns");
@@ -1871,7 +1871,7 @@ QUnit.module('Views', {
assert.strictEqual(kanban.$('.o_kanban_group').length, 3, "should have two columns");
kanban.$('.o_kanban_group:last .o_column_delete').click();
$('footer.modal-footer .btn-primary').click();
$('.modal-footer .btn-primary').click();
assert.strictEqual(kanban.$('.o_kanban_group').length, 2, "should have twos columns");
@@ -1913,33 +1913,33 @@ QUnit.module('Views', {
// edit the title of column [5, 'xmo'] and close without saving
kanban.$('.o_kanban_group[data-id=5] .o_column_edit').click(); // click on 'Edit'
assert.ok($('[role="dialog"] .o_form_editable').length, 'a form view should be open in a modal');
assert.strictEqual($('[role="dialog"] .o_form_editable input').val(), 'xmo',
assert.ok($('.modal .o_form_editable').length, 'a form view should be open in a modal');
assert.strictEqual($('.modal .o_form_editable input').val(), 'xmo',
'the name should be "xmo"');
$('[role="dialog"] .o_form_editable input').val('ged').trigger('input'); // change the value
$('.modal .o_form_editable input').val('ged').trigger('input'); // change the value
nbRPCs = 0;
$('header.modal-header .close').click(); // click on the cross to close the modal
assert.ok(!$('[role="dialog"]').length, 'the modal should be closed');
$('.modal-header .close').click(); // click on the cross to close the modal
assert.ok(!$('.modal').length, 'the modal should be closed');
assert.strictEqual(kanban.$('.o_kanban_group[data-id=5] .o_column_title').text(), 'xmo',
'title of the column should still be "xmo"');
assert.strictEqual(nbRPCs, 0, 'no RPC should have been done');
// edit the title of column [5, 'xmo'] and discard
kanban.$('.o_kanban_group[data-id=5] .o_column_edit').click(); // click on 'Edit'
$('[role="dialog"] .o_form_editable input').val('ged').trigger('input'); // change the value
$('.modal .o_form_editable input').val('ged').trigger('input'); // change the value
nbRPCs = 0;
$('footer.modal-footer .btn-default').click(); // click on discard
assert.ok(!$('[role="dialog"]').length, 'the modal should be closed');
$('.modal-footer .btn-default').click(); // click on discard
assert.ok(!$('.modal').length, 'the modal should be closed');
assert.strictEqual(kanban.$('.o_kanban_group[data-id=5] .o_column_title').text(), 'xmo',
'title of the column should still be "xmo"');
assert.strictEqual(nbRPCs, 0, 'no RPC should have been done');
// edit the title of column [5, 'xmo'] and save
kanban.$('.o_kanban_group[data-id=5] .o_column_edit').click(); // click on 'Edit'
$('[role="dialog"] .o_form_editable input').val('ged').trigger('input'); // change the value
$('.modal .o_form_editable input').val('ged').trigger('input'); // change the value
nbRPCs = 0;
$('footer.modal-footer .btn-primary').click(); // click on save
assert.ok(!$('[role="dialog"]').length, 'the modal should be closed');
$('.modal-footer .btn-primary').click(); // click on save
assert.ok(!$('.modal').length, 'the modal should be closed');
assert.strictEqual(kanban.$('.o_kanban_group[data-id=5] .o_column_title').text(), 'ged',
'title of the column should be "ged"');
assert.strictEqual(nbRPCs, 4, 'should have done 1 write, 1 read_group and 2 search_read');
@@ -2059,16 +2059,16 @@ QUnit.module('Views', {
// click to see the examples
kanban.$('.o_column_quick_create .o_kanban_examples').click();
assert.strictEqual($('[role="dialog"] .o_kanban_examples_dialog').length, 1,
assert.strictEqual($('.modal .o_kanban_examples_dialog').length, 1,
"should have open the examples dialog");
assert.strictEqual($('[role="dialog"] .o_kanban_examples_dialog_nav li').length, 2,
assert.strictEqual($('.modal .o_kanban_examples_dialog_nav li').length, 2,
"should have two examples (in the menu)");
assert.strictEqual($('[role="dialog"] .o_kanban_examples_dialog_nav a').text(),
assert.strictEqual($('.modal .o_kanban_examples_dialog_nav a').text(),
' A first example A second example ', "example names should be correct");
assert.strictEqual($('[role="dialog"] .o_kanban_examples_dialog_content .tab-pane').length, 2,
assert.strictEqual($('.modal .o_kanban_examples_dialog_content .tab-pane').length, 2,
"should have two examples");
var $firstPane = $('[role="dialog"] .o_kanban_examples_dialog_content .tab-pane:first');
var $firstPane = $('.modal .o_kanban_examples_dialog_content .tab-pane:first');
assert.strictEqual($firstPane.find('.o_kanban_examples_group').length, 3,
"there should be 3 stages in the first example");
assert.strictEqual($firstPane.find('h6').text(), 'Column 1Column 2Column 3',
@@ -2076,7 +2076,7 @@ QUnit.module('Views', {
assert.strictEqual($firstPane.find('.o_kanban_examples_description').text().trim(),
"Some description", "the correct description should be displayed");
var $secondPane = $('[role="dialog"] .o_kanban_examples_dialog_content .tab-pane:nth(1)');
var $secondPane = $('.modal .o_kanban_examples_dialog_content .tab-pane:nth(1)');
assert.strictEqual($secondPane.find('.o_kanban_examples_group').length, 2,
"there should be 2 stages in the second example");
assert.strictEqual($secondPane.find('h6').text(), 'Col 1Col 2',
+9 -9
View File
@@ -430,7 +430,7 @@ QUnit.module('Views', {
var $td = form.$('.o_data_cell').first();
var $td2 = form.$('.o_data_cell').eq(1);
assert.ok($td.hasClass("o_readonly_modifier"), "first field must be readonly");
assert.ok($td2.hasClass("o_boolean_toggle_cell"), "second field must be not activable but updatable on click (boolean toggle in this case)");
assert.ok($td2.hasClass("o_boolean_toggle_cell"), "second field must be not activable but updatable on click (boolean toggle in this case)");
$td.click(); //select row first
var $slider = $td2.find('.slider').first();
try {
@@ -880,7 +880,7 @@ QUnit.module('Views', {
list.sidebar.$('a:contains(Delete)').click();
assert.ok($('body').hasClass('modal-open'), 'body should have modal-open clsss');
$('body [role="dialog"] button span:contains(Ok)').click();
$('body .modal button span:contains(Ok)').click();
assert.strictEqual(list.$('tbody td.o_list_record_selector').length, 3, "should have 3 records");
list.destroy();
@@ -916,13 +916,13 @@ QUnit.module('Views', {
assert.verifySteps(['/web/dataset/search_read']);
list.sidebar.$('a:contains(Archive)').click();
assert.strictEqual($('[role="dialog"]').length, 1, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-default').click(); // Click on 'Cancel'
assert.strictEqual($('.modal').length, 1, 'a confirm modal should be displayed');
$('.modal-footer .btn-default').click(); // Click on 'Cancel'
assert.strictEqual(list.$('tbody td.o_list_record_selector').length, 4, "still should have 4 records");
list.sidebar.$('a:contains(Archive)').click();
assert.strictEqual($('[role="dialog"]').length, 1, 'a confirm modal should be displayed');
$('footer.modal-footer .btn-primary').click(); // Click on 'Ok'
assert.strictEqual($('.modal').length, 1, 'a confirm modal should be displayed');
$('.modal-footer .btn-primary').click(); // Click on 'Ok'
assert.strictEqual(list.$('tbody td.o_list_record_selector').length, 3, "should have 3 records");
assert.verifySteps(['/web/dataset/search_read', '/web/dataset/call_kw/foo/write', '/web/dataset/search_read']);
list.destroy();
@@ -2759,10 +2759,10 @@ QUnit.module('Views', {
list.$('.o_data_cell:first').click();
list.$('input[name="foo"]').val("hello").trigger('input');
list.$buttons.find('.o_list_button_discard').click();
assert.strictEqual($('[role="dialog"]:visible').length, 1,
assert.strictEqual($('.modal:visible').length, 1,
"a modal to ask for discard should be visible");
$('[role="dialog"]:visible .btn-primary').click();
$('.modal:visible .btn-primary').click();
assert.strictEqual(list.$('.o_data_cell:first').text(), "yop",
"first cell should still contain 'yop'");
@@ -3555,7 +3555,7 @@ QUnit.module('Views', {
// delete a record
list.$('.o_data_row:first .o_list_record_selector input').click();
list.sidebar.$('a:contains(Delete)').click();
$('footer.modal-footer .btn-primary').click(); // confirm
$('.modal-footer .btn-primary').click(); // confirm
assert.verifySteps([
'create',
@@ -90,9 +90,9 @@ QUnit.module('Views', {
res_id: 1,
}).open();
assert.notOk($('main.modal-body button').length,
assert.notOk($('.modal-body button').length,
"should not have any button in body");
assert.strictEqual($('footer.modal-footer button').length, 1,
assert.strictEqual($('.modal-footer button').length, 1,
"should have only one button in footer");
parent.destroy();
});
@@ -118,7 +118,7 @@ QUnit.module('Views', {
res_id: 1,
}).open();
assert.strictEqual($('[role="dialog"] button.btn-primary').length, 1,
assert.strictEqual($('.modal button.btn-primary').length, 1,
"should have 1 buttons in modal");
$('.o_field_x2many_list_row_add a').click();
@@ -127,7 +127,7 @@ QUnit.module('Views', {
keyCode: $.ui.keyCode.ESCAPE,
}));
assert.strictEqual($('[role="dialog"] button.btn-primary').length, 1,
assert.strictEqual($('.modal button.btn-primary').length, 1,
"should still have 1 buttons in modal");
parent.destroy();
});
@@ -321,7 +321,7 @@ QUnit.module('Views', {
return $.when(false);
}
if (route === '/web/dataset/call_kw/instrument/create') {
assert.deepEqual(args.args, [{badassery: [[6, false, [1]]], name: false}],
assert.deepEqual(args.args, [{badassery: [[6, false, [1]]], name: false}],
'The method create should have been called with the right arguments');
return $.when(false);
}
@@ -107,15 +107,15 @@ QUnit.module('widgets', {
list.$('thead th.o_list_record_selector input').click();
list.sidebar.$('a:contains(Export)').click();
assert.strictEqual($('[role="dialog"]').length, 1, "a modal dialog should be open");
assert.strictEqual($('.modal').length, 1, "a modal dialog should be open");
assert.strictEqual($('span.o_tree_column:contains(Activities)').length, 1,
"the Activities field should be in the list of exportable fields");
// select the field Description, click on add, then export and close
$('[role="dialog"] span:contains(Description)').click();
$('[role="dialog"] .o_add_field').click();
$('[role="dialog"] span:contains(Export To File)').click();
$('[role="dialog"] span:contains(Close)').click();
$('.modal span:contains(Description)').click();
$('.modal .o_add_field').click();
$('.modal span:contains(Export To File)').click();
$('.modal span:contains(Close)').click();
list.destroy();
framework.blockUI = blockUI;
@@ -185,26 +185,26 @@ QUnit.module('widgets', {
// Open the export modal
list.$('thead th.o_list_record_selector input').click();
list.sidebar.$('a:contains(Export)').click();
assert.strictEqual($('[role="dialog"]').length, 1,
assert.strictEqual($('.modal').length, 1,
"a modal dialog should be open");
// Select 'Activities' in fields to export
assert.strictEqual($('[role="dialog"] select.o_fields_list option').length, 0,
assert.strictEqual($('.modal select.o_fields_list option').length, 0,
"the fields list should be empty");
$('[role="dialog"] .o_export_tree_item:contains(Activities)').click();
$('[role="dialog"] button:contains(Add)').click();
assert.strictEqual($('[role="dialog"] select.o_fields_list option').length, 1,
$('.modal .o_export_tree_item:contains(Activities)').click();
$('.modal button:contains(Add)').click();
assert.strictEqual($('.modal select.o_fields_list option').length, 1,
"there should be one item in the fields list");
// Save fields list
$('[role="dialog"] a:contains(Save fields list)').click();
$('[role="dialog"] .o_save_list > input').val('fields list').trigger('input');
$('[role="dialog"] .o_save_list > button').click();
$('.modal a:contains(Save fields list)').click();
$('.modal .o_save_list > input').val('fields list').trigger('input');
$('.modal .o_save_list > button').click();
assert.verifySteps(['build_search_data', 'create'],
"create should have been called");
// Close the modal and destroy list
$('[role="dialog"] button span:contains(Close)').click();
$('.modal button span:contains(Close)').click();
list.destroy();
// restore create function
@@ -152,9 +152,9 @@ QUnit.module('Views', {
"diagram should only have the default nodes at start");
diagram.$buttons.find('.o_diagram_new_button').click();
$('main.modal-body input:first').val('a new node').trigger('input');
$('main.modal-body input:last').val(1).trigger('input');
$('footer.modal-footer button.btn-primary').click(); // save
$('.modal-body input:first').val('a new node').trigger('input');
$('.modal-body input:last').val(1).trigger('input');
$('.modal-footer button.btn-primary').click(); // save
assert.strictEqual(diagram.$('.o_diagram ellipse').length, 3,
"diagram should contain 3 'ellipse' nodes now (nodes 2, 3 and the new one)");
@@ -184,8 +184,8 @@ QUnit.module('Views', {
"diagram first node should have default name at first");
CuteNode.double_click_callback({id: 1});
$('main.modal-body input:first').val('An edited node').trigger('input');
$('footer.modal-footer button.btn-primary').click(); // save
$('.modal-body input:first').val('An edited node').trigger('input');
$('.modal-footer button.btn-primary').click(); // save
assert.strictEqual(diagram.$('text').first().text(), 'An edited node',
"diagram first node should now have new name");
@@ -212,7 +212,7 @@ QUnit.module('Views', {
"diagram should contain 2 'ellipse' nodes (nodes 2 and 3)");
CuteNode.destruction_callback({id: 2});
$('footer.modal-footer button.btn-primary').click(); // Confirm
$('.modal-footer button.btn-primary').click(); // Confirm
assert.strictEqual(diagram.$('.o_diagram ellipse').length, 1,
"diagram should contain 1 'ellipse' nodes (node 2)");
@@ -245,8 +245,8 @@ QUnit.module('Views', {
get_start: function () {return {id: 1};},
get_end: function () {return {id: 3};},
});
$('main.modal-body input:first').val('a transition from 1 to 3').trigger('input');
$('footer.modal-footer button.btn-primary').click(); // Confirm
$('.modal-body input:first').val('a transition from 1 to 3').trigger('input');
$('.modal-footer button.btn-primary').click(); // Confirm
assert.strictEqual(diagram.$('.o_diagram path').length, 5,
"diagram should contain 4 'path' nodes (#raphael-marker-block, transitions 1, 2, 3, and the new one)");
@@ -278,8 +278,8 @@ QUnit.module('Views', {
"diagram should only have the default edges at start");
CuteEdge.double_click_callback({id: 1});
$('main.modal-body input:first').val('An edited edge').trigger('input');
$('footer.modal-footer button.btn-primary').click(); // save
$('.modal-body input:first').val('An edited edge').trigger('input');
$('.modal-footer button.btn-primary').click(); // save
assert.strictEqual(diagram.$('text:contains(a transition from 1 to 2)').length, 0,
"diagram edge should not have default name anymore");
@@ -310,7 +310,7 @@ QUnit.module('Views', {
"diagram edge should have default name at start");
CuteEdge.destruction_callback({id: 3});
$('footer.modal-footer button.btn-primary').click(); // Confirm
$('.modal-footer button.btn-primary').click(); // Confirm
assert.strictEqual(diagram.$('.o_diagram path').length, 3,
"diagram should contain 3 'path' nodes (#raphael-marker-block, and transitions 1 and 2)");
@@ -817,7 +817,7 @@ define([
$dialog.addClass('note-air-layout');
$dialog.attr('id', 'note-dialog-' + id);
$dialog.find('button.close, a.modal-close').click(function () {
$(this).closest('[role="dialog"]').modal('hide');
$(this).closest('.modal').modal('hide');
});
$dialog.appendTo($container);
};
@@ -905,7 +905,7 @@ define([
var $dialogContainer = options.dialogsInBody ? $(document.body) : $editor;
var $dialog = $(tplDialogs(langInfo, options)).prependTo($dialogContainer);
$dialog.find('button.close, a.modal-close').click(function () {
$(this).closest('[role="dialog"]').modal('hide');
$(this).closest('.modal').modal('hide');
});
//09. Editor/Holder switch
@@ -400,7 +400,7 @@ var FieldTextHtml = AbstractField.extend({
return src;
},
old_initialize_content: function () {
this.$el.closest('main.modal-body').css('max-height', 'none');
this.$el.closest('.modal-body').css('max-height', 'none');
this.$iframe = this.$el.find('iframe');
this.document = null;
this.$body = $();
+3 -3
View File
@@ -157,7 +157,7 @@ tour.register('rte', {
trigger: '#editor-media-icon.active span.fa:first',
}, {
content: "save pictogram",
trigger: 'footer.modal-footer .btn-primary',
trigger: '.modal-footer > .btn-primary',
extra_trigger: '#editor-media-icon.active span.o_selected',
}, {
content: "select a size for the pictogram",
@@ -180,7 +180,7 @@ tour.register('rte', {
extra_trigger: 'a#link-preview:containsRegex(/^<span [^>]+><\\/span>$/) > span.fa.fa-3x.pull-right',
}, {
content: "save link",
trigger: 'footer.modal-footer .btn-primary',
trigger: '.modal-footer > .btn-primary',
extra_trigger: 'a#link-preview.btn.btn-success span.fa.fa-3x.pull-right',
}, {
content: "click on other picture",
@@ -200,7 +200,7 @@ tour.register('rte', {
extra_trigger: 'a#link-preview:containsRegex(/^<img [^>]+>$/) img',
}, {
content: "save link",
trigger: 'footer.modal-footer .btn-primary',
trigger: '.modal-footer > .btn-primary',
extra_trigger: 'a#link-preview.btn.btn-success[href="mailto:test@test.test"]:containsRegex(/^<img [^>]+>$/) img',
}, {
content: "select for triple enter then double backspace",
@@ -1171,7 +1171,7 @@ var MediaDialog = Dialog.extend({
var self = this;
var defs = [this._super.apply(this, arguments)];
this.$modal.addClass('note-image-dialog');
this.$modal.find('[role="dialog"]').addClass('o_select_media_dialog');
this.$modal.find('.modal-dialog').addClass('o_select_media_dialog');
if (this.imageDialog) {
defs.push(this.imageDialog.appendTo(this.$("#editor-media-image")));
+2 -10
View File
@@ -160,7 +160,7 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
update: function (tour_name) {
if (this.paused) return;
this.$modal_displayed = $('[role="dialog"]:visible').last();
this.$modal_displayed = $('.modal:visible').last();
tour_name = this.running_tour || tour_name;
if (tour_name) {
@@ -325,14 +325,7 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
_set_running_tour_timeout: function (tour_name, step) {
this._stop_running_tour_timeout();
this.running_tour_timeout = setTimeout((function() {
var message;
if (step.extra_trigger) {
message = _.str.sprintf('Tour %s failed at step "%s" with trigger "%s" and extra trigger "%s"',
tour_name, step.content, step.trigger, step.extra_trigger);
} else {
message = _.str.sprintf('Tour %s failed at step "%s" with trigger "%s"', tour_name, step.content, step.trigger);
}
this._consume_tour(tour_name, message);
this._consume_tour(tour_name, _.str.sprintf("Tour %s failed at step %s", tour_name, step.trigger));
}).bind(this), (step.timeout || RUNNING_TOUR_TIMEOUT) + this.running_step_delay);
},
_stop_running_tour_timeout: function () {
@@ -365,7 +358,6 @@ return core.Class.extend(mixins.EventDispatcherMixin, ServicesMixin, {
MENU_MORE: {
edition: "community",
trigger: "body > header > nav",
content: _t('Click on the <i>More icon</i> to show hidden apps.'),
position: "bottom",
auto: true,
run: function (actions) {
@@ -740,7 +740,7 @@ registry.gallery = Animation.extend({
$(this).siblings().filter('.modal-backdrop').remove(); // bootstrap leaves a modal-backdrop
$(this).remove();
});
$modal.find('[role="dialog"] .modal-content, main.modal-body.o_slideshow').css('height', '100%');
$modal.find('.modal-content, .modal-body.o_slideshow').css('height', '100%');
$modal.appendTo(document.body);
this.carousel = new registry.gallery_slider($modal.find('.carousel').carousel());
@@ -17,7 +17,7 @@ var MobilePreviewDialog = Dialog.extend({
start: function () {
var self = this;
this.$modal.addClass('oe_mobile_preview');
this.$modal.on('click', 'header.modal-header', function () {
this.$modal.on('click', '.modal-header', function () {
self.$el.toggleClass('o_invert_orientation');
});
this.$iframe = $('<iframe/>', {
+5 -5
View File
@@ -16,8 +16,8 @@ tour.register('rte_translator', {
run: 'text "fr_BE"',
}, {
content: "load french",
trigger: 'footer.modal-footer button:first',
extra_trigger: '[role="dialog"] select[name="lang"]:propValueContains(fr_BE)',
trigger: '.modal-footer button:first',
extra_trigger: '.modal select[name="lang"]:propValueContains(fr_BE)',
}, {
content : "click language dropdown",
trigger : '.js_language_selector .dropdown-toggle',
@@ -72,7 +72,7 @@ tour.register('rte_translator', {
trigger: 'html:not(:has(#wrap p span)) .o_menu_systray a[data-action="translate"]',
}, {
content: "close modal",
trigger: 'footer.modal-footer .btn-default',
trigger: '.modal-footer .btn-default',
}, {
content: "check if translation is activate",
trigger: '[data-oe-translation-id]',
@@ -101,8 +101,8 @@ tour.register('rte_translator', {
run: 'text test french placeholder',
}, {
content: "close modal",
trigger: 'footer.modal-footer .btn-primary',
extra_trigger: '[role="dialog"] input:propValue(test french placeholder)',
trigger: '.modal-footer .btn-primary',
extra_trigger: '.modal input:propValue(test french placeholder)',
}, {
content: "save translation",
trigger: 'button[data-action=save]',
@@ -30,12 +30,12 @@ odoo.define("website_blog.tour", function (require) {
content: _t("Click here to change your post cover."),
position: "right",
}, {
trigger: ".o_existing_attachment_cell:nth(1) img",
extra_trigger: '.modal-dialog:has(.o_existing_attachment_cell:nth(1))',
trigger: ".o_select_media_dialog .o_existing_attachment_cell:nth(1) img",
extra_trigger: '.modal:has(.o_existing_attachment_cell:nth(1))',
content: _t("Choose an image from the library."),
position: "top",
}, {
trigger: "footer.modal-footer .btn-primary",
trigger: ".o_select_media_dialog .modal-footer > .btn-primary",
extra_trigger: ".o_existing_attachment_cell.o_selected",
content: _t("Click on <b>Save</b> to set the picture as cover."),
position: "top",
@@ -59,7 +59,7 @@ odoo.define("website_blog.tour", function (require) {
position: "bottom",
}, {
trigger: "button[data-dismiss=modal]",
extra_trigger: '[role="dialog"]:has(#mobile-viewport)',
extra_trigger: '.modal:has(#mobile-viewport)',
content: _t("Once you have reviewed the content on mobile, close the preview."),
position: "right",
}, {
@@ -19,7 +19,7 @@ odoo.define("website_event.tour", function (require) {
content: _t("Create a name for your new event and click <em>\"Continue\"</em>. e.g: Technical Training"),
position: "right",
}, {
trigger: 'footer.modal-footer button.btn-primary.btn-continue',
trigger: '.modal-footer button.btn-primary.btn-continue',
extra_trigger: '#editor_new_event input[type=text][value!=""]',
content: _t("Click <em>Continue</em> to create the event."),
position: "right",
@@ -60,7 +60,7 @@ var EventRegistrationForm = Widget.extend({
return ajax.jsonRpc($form.attr('action'), 'call', post).then(function (modal) {
var $modal = $(modal);
$modal.modal({backdrop: 'static', keyboard: false});
$modal.find('main.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19
$modal.find('.modal-body > div').removeClass('container'); // retrocompatibility - REMOVE ME in master / saas-19
$modal.insertAfter($form).modal();
$modal.on('click', '.js_goto_event', function () {
$modal.modal('hide');
@@ -30,7 +30,7 @@
</xpath>
<!-- Generic questions -->
<xpath expr='//div[@role="dialog"]//main/div/t[last()]' position="after">
<xpath expr="//*[hasclass('modal-body')]/div/t[last()]" position="after">
<t t-if="event.general_question_ids">
<h4 class="page-header mt8"><strong>Questions</strong></h4>
<div>
@@ -20,7 +20,7 @@ odoo.define("website_forum.tour_forum", function (require) {
position: "right",
}, {
trigger: "button.btn-primary",
extra_trigger: '#editor_new_forum input[type=text]:not(:propValue(""))',
extra_trigger: '.modal #editor_new_forum input[type=text]:not(:propValue(""))',
content: _t("Click <em>Continue</em> to create the forum."),
position: "right",
}, {
@@ -51,7 +51,7 @@ odoo.define("website_forum.tour_forum", function (require) {
content: _t("Click to post your question."),
position: "bottom",
}, {
trigger: "header.modal-header button.close",
trigger: ".modal-header button.close",
auto: true,
}, {
trigger: ".note-editable p",
@@ -64,7 +64,7 @@ odoo.define("website_forum.tour_forum", function (require) {
content: _t("Click to post your answer."),
position: "bottom",
}, {
trigger: "header.modal-header button.close",
trigger: ".modal-header button.close",
auto: true,
}, {
trigger: "a[data-karma=\"20\"]:first",
@@ -177,7 +177,7 @@
</xpath>
</template>
<!-- duplicata of the template payment.payment_confirmation_status.
<!-- duplicata of the template payment.payment_confirmation_status.
The duplication avoid to break an existing installation in stable version-->
<template id="payment_confirmation_status">
<div t-if="payment_tx_id and payment_tx_id.state == 'done'" class="alert alert-success alert-dismissable" role="status">
@@ -217,10 +217,10 @@
<div class="bs-sidebar">
<div class="text-center" t-if="quotation.state in ('draft', 'sent', 'waiting_date')" style="padding: 10px">
<a role="button" t-if="order_valid and not quotation.signature and quotation.has_to_be_signed()" class="btn btn-primary btn-block" data-toggle="modal" data-target="#modalaccept">
<span class="fa fa-check"> Accept Order</span>
<i class="fa fa-check"/> Accept Order
</a>
<a role="button" t-elif="order_valid and quotation.has_to_be_paid()" class="btn btn-primary btn-block" data-toggle="modal" data-target="#modalaccept">
<span class="fa fa-check"> <t t-if="not quotation.signature">Accept &amp; </t>Pay</span>
<i class="fa fa-check"/> <t t-if="not quotation.signature">Accept &amp; </t>Pay
</a>
<a role="button" t-if="not order_valid" href="#discussion" class="btn btn-info btn-block o_normalwhitespace">
<strong>This offer expired!</strong><br/>
@@ -701,6 +701,6 @@
<t t-else="">
<a t-attf-href="/my/orders/#{quotation.id}?#{keep_query()}"><t t-esc="quotation.name"/></a>
</t>
</xpath>
</xpath>
</template>
</odoo>
@@ -20,11 +20,11 @@ odoo.define("website_sale.tour_shop", function (require) {
content: _t("Select <b>New Product</b> to create it and manage its properties to boost your sales."),
position: "bottom",
}, {
trigger: "#editor_new_product input[type=text]",
trigger: ".modal-dialog #editor_new_product input[type=text]",
content: _t("Enter a name for your new product"),
position: "right",
}, {
trigger: "footer.modal-footer button.btn-primary.btn-continue",
trigger: ".modal-footer button.btn-primary.btn-continue",
content: _t("Click on <em>Continue</em> to create the product."),
position: "right",
}, {
@@ -38,11 +38,11 @@ odoo.define("website_sale.tour_shop", function (require) {
content: _t("Click here to set an image describing your product."),
position: "top",
}, {
trigger: ".o_upload_image_button",
trigger: ".o_select_media_dialog .o_upload_image_button",
content: _t("Upload an image from your local library."),
position: "bottom",
run: function (actions) {
actions.auto("footer.modal-footer .btn-default");
actions.auto(".modal-footer .btn-default");
},
}, {
trigger: "#snippet_structure .oe_snippet:eq(8) .oe_snippet_thumbnail",
+1 -1
View File
@@ -1300,7 +1300,7 @@
<div class="panel panel-default">
<div class="panel-headisng"></div>
<div class="panel-body">
<a class='pull-right no-decoration' href='/shop/checkout'><span class='fa fa-edit'> Edit</span></a>
<a class='pull-right no-decoration' href='/shop/checkout'><i class="fa fa-edit"/> Edit</a>
<t t-set="same_shipping" t-value="bool(order.partner_shipping_id==order.partner_id or only_services)" />
<div><b>Billing<t t-if="same_shipping and not only_services"> &amp; Shipping</t>: </b><span t-esc='order.partner_id' t-options="dict(widget='contact', fields=['address'], no_marker=True, separator=', ')" class="address-inline"/></div>
<div t-if="not same_shipping and not only_services" groups="sale.group_delivery_invoice_address"><b>Shipping: </b><span t-esc='order.partner_shipping_id' t-options="dict(widget='contact', fields=['address'], no_marker=True, separator=', ')" class="address-inline"/></div>
@@ -17,7 +17,7 @@
</div>
</div>
<div class="o_comparelist_button" style='display:none'>
<a role="button" class="btn btn-primary btn-block" href="#"><span class="fa fa-exchange mr4">Compare</span></a>
<a role="button" class="btn btn-primary btn-block" href="#"><i class="fa fa-exchange mr4"/>Compare</a>
</div>
</span>
</span>
@@ -180,7 +180,7 @@ tour.register('shop_customize', {
{
content: "click in modal on 'Proceed to checkout' button",
extra_trigger: 'body:has(.js_product:contains(Warranty) a:contains(Add to Cart):hidden)',
trigger: 'footer.modal-footer a:contains("Proceed to Checkout")',
trigger: '.modal-footer a:contains("Proceed to Checkout")',
},
{
content: "check quantity",
@@ -31,9 +31,8 @@
<t t-set='wishcount' t-value="len(request.env['product.wishlist'].current())"/>
<li id="my_wish" t-att-style="not wishcount and 'display:none;'">
<a href="/shop/wishlist">
<span class="fa fa-heart">
Wishlist <sup t-attf-class="my_wish_quantity o_animate_blink label label-primary"><t t-esc='wishcount'/></sup>
</span>
<i class="fa fa-heart"/>
Wishlist <sup t-attf-class="my_wish_quantity o_animate_blink label label-primary"><t t-esc='wishcount'/></sup>
</a>
</li>
</t>
@@ -355,12 +355,12 @@ var SlideDialog = Widget.extend({
values.website_published = true;
}
this.$('.oe_slides_upload_loading').show();
this.$('footer.modal-footer, main.modal-body').hide();
this.$('.modal-footer, .modal-body').hide();
ajax.jsonRpc("/slides/add_slide", 'call', values).then(function (data) {
if (data.error) {
self.display_alert(data.error);
self.$('.oe_slides_upload_loading').hide();
self.$('footer.modal-footer, main.modal-body').show();
self.$('.modal-footer, .modal-body').show();
} else {
window.location = data.url;
@@ -124,7 +124,7 @@
<div class="col-md-8 col-sm-12 col-xs-12">
<ul class="nav nav-tabs nav-tabs-border" role="tablist">
<li t-attf-class="#{not slide_type and 'active' ''}">
<a t-attf-href="/slides/#{slug(channel)}#{category and '/category/' + slug(category) or ''}"> <span class="fa fa-home"> Home</span></a>
<a t-attf-href="/slides/#{slug(channel)}#{category and '/category/' + slug(category) or ''}"> <i class="fa fa-home"/> Home</a>
</li>
<li t-if="header_object.nbr_presentations" t-attf-class="#{slide_type == 'presentation' and 'active' ''}">
<a t-attf-href="/slides/#{slug(channel)}#{category and '/category/' + slug(category) or ''}/presentation">
@@ -272,7 +272,7 @@
<t t-esc="category['name']"/>
</span>
<a t-attf-href="/slides/#{slug(channel)}/category/#{category['id']}" class="pull-right" t-if="category['total'] - 4 > 0 and category['id']">
<span class="fa fa-arrow-right"> See all</span>
<i class="fa fa-arrow-right"/> See all
</a>
</div>
</div>
@@ -698,7 +698,7 @@
data-loading-text="Sending..."
t-attf-data-slide-id="#{slide.id}"
style="border-top-right-radius: 4px;border-bottom-right-radius: 4px;">
<span class="fa fa-envelope-o">Send Email</span>
<i class="fa fa-envelope-o"/> Send Email
</button>
</span>
</div>
+1 -1
View File
@@ -91,7 +91,7 @@ action = {
<!-- Add link to theme install in default customize modal -->
<template id="customize_modal" inherit_id="website.theme_customize" priority="1">
<xpath expr='//*[@role="dialog"]//header' position="inside">
<xpath expr="//*[hasclass('modal-header')]" position="inside">
<a href="/web#action=website_theme_install.theme_install_kanban_action">See themes here</a>
</xpath>
</template>
@@ -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",
}, {
+16 -16
View File
@@ -31,7 +31,7 @@ odoo.define('web.test.x2many', function (require) {
}, {
content: "insert a name into the modal form",
trigger: 'input.o_field_widget.o_required_modifier:first',
extra_trigger: '[role="dialog"]:visible',
extra_trigger: '.modal:visible',
run: function (action_helper) {
action_helper.text('user_test_' + (inc = new Date().getTime()));
}
@@ -44,7 +44,7 @@ odoo.define('web.test.x2many', function (require) {
}
}, {
content: "save the modal content and create the new moderator",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'input.o_field_widget.o_required_modifier:propValueContains(@test)',
}, {
content: "check if the modal is saved",
@@ -82,12 +82,12 @@ odoo.define('web.test.x2many', function (require) {
trigger: '.tab-pane:eq(0) .o_field_x2many_list_row_add a'
}, {
content: "insert body a",
trigger: 'main.modal-body textarea:first',
trigger: '.modal-body textarea:first',
run: 'text a',
}, {
content: "save new message a",
trigger: 'footer.modal-footer button:contains(Save):first',
extra_trigger: 'main.modal-body textarea:first:propValue(a)',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: '.modal-body textarea:first:propValue(a)',
}, { // add message b
content: "create new message b",
trigger: '.tab-pane:eq(0) .o_field_x2many_list_row_add a',
@@ -98,7 +98,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text b',
}, {
content: "save new message b",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(b)',
}, { // change content to trigger on change
content: "insert content",
@@ -123,7 +123,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text bbb',
}, {
content: "save changes",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(bbb)',
}, { // add message c
content: "create new message c",
@@ -135,7 +135,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text c',
}, {
content: "save new message c",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(c)',
}, { // add participants
content: "change tab to Participants",
@@ -186,7 +186,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text d',
}, {
content: "save new message d",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(d)',
}, { // add message e
content: "create new message e",
@@ -198,7 +198,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text e',
}, {
content: "save new message e",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(e)',
}, { // change message a
content: "edit message a",
@@ -210,7 +210,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text aaa',
}, {
content: "save changes",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(aaa)',
}, { // change message e
content: "edit message e",
@@ -235,7 +235,7 @@ odoo.define('web.test.x2many', function (require) {
run: function () {}, // don't change texarea content
}, {
content: "save changes",
trigger: 'footer.modal-footer button:contains(Save):contains(Close)'
trigger: '.modal-footer button:contains(Save):contains(Close)'
}, {
content: "test one2many triggered the onchange on save for the line",
trigger: '.o_content:has(.tab-pane:eq(0) .o_field_widget tbody tr td.o_readonly_modifier:contains([test_trigger] Demo User))',
@@ -283,7 +283,7 @@ odoo.define('web.test.x2many', function (require) {
}, {
content: "select another user",
trigger: '.o_field_many2one .o_input_dropdown > input',
extra_trigger: 'body:has([role="dialog"]) .tab-pane:eq(0) .o_field_widget tbody tr:has(td:containsExact(d))',
extra_trigger: 'body:has(.modal) .tab-pane:eq(0) .o_field_widget tbody tr:has(td:containsExact(d))',
run: 'text Demo',
}, {
content: "select demo user",
@@ -299,7 +299,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'text ddd',
}, {
content: "save new message ddd",
trigger: 'footer.modal-footer button:contains(Save):first',
trigger: '.modal-footer button:contains(Save):first',
extra_trigger: 'textarea[name="body"]:first:propValue(ddd)',
}, { // trigger onchange
content: "blur the one2many",
@@ -321,7 +321,7 @@ odoo.define('web.test.x2many', function (require) {
run: 'click',
}, {
content: "confirm cancel change",
trigger: 'footer.modal-footer button:contains(Ok)',
trigger: '.modal-footer button:contains(Ok)',
},
/////////////////////////////////////////////////////////////////////////////////////////////
@@ -516,6 +516,6 @@ odoo.define('web.test.x2many', function (require) {
run: 'click',
}, {
content: "confirm cancel change",
trigger: 'footer.modal-footer button:contains(Ok)',
trigger: '.modal-footer button:contains(Ok)',
}]);
});