[REF] web, mrp: drop custom text decoration classes
Drop custom text decoration classes in favor of default bootstrap ones.
This commit is contained in:
committed by
Aaron Bohy
parent
1971bf3981
commit
d9a0877096
@@ -172,7 +172,7 @@
|
||||
<label for="product_uom_id" string="" class="oe_inline"/>
|
||||
<field name="product_uom_category_id" invisible="1"/>
|
||||
<field name="product_uom_id" options="{'no_open': True, 'no_create': True}" force_save="1" groups="uom.group_uom" attrs="{'readonly': [('state', '!=', 'draft')]}"/>
|
||||
<span class='text-bf'>To Produce</span>
|
||||
<span class='font-weight-bold'>To Produce</span>
|
||||
<button type="object" name="action_product_forecast_report" icon="fa-area-chart" attrs="{'invisible': [('forecasted_issue', '=', True)]}"/>
|
||||
<button type="object" name="action_product_forecast_report" icon="fa-area-chart" attrs="{'invisible': [('forecasted_issue', '=', False)]}" class="text-danger"/>
|
||||
</div>
|
||||
|
||||
@@ -1049,7 +1049,7 @@ const RemainingDays = AbstractField.extend({
|
||||
*/
|
||||
_render() {
|
||||
if (this.value === false) {
|
||||
this.$el.removeClass('text-bf text-danger text-warning');
|
||||
this.$el.removeClass('font-weight-bold text-danger text-warning');
|
||||
return;
|
||||
}
|
||||
// compare the value (in the user timezone) with now (also in the user
|
||||
@@ -1069,7 +1069,7 @@ const RemainingDays = AbstractField.extend({
|
||||
text = diffDays === 1 ? _t("Tomorrow") : _.str.sprintf(_t('In %s days'), diffDays);
|
||||
}
|
||||
this.$el.text(text).attr('title', this._formatValue(this.value, 'date'));
|
||||
this.$el.toggleClass('text-bf', diffDays <= 0);
|
||||
this.$el.toggleClass('font-weight-bold', diffDays <= 0);
|
||||
this.$el.toggleClass('text-danger', diffDays < 0);
|
||||
this.$el.toggleClass('text-warning', diffDays === 0);
|
||||
},
|
||||
|
||||
@@ -1146,7 +1146,7 @@ var ListRenderer = BasicRenderer.extend({
|
||||
* @param {jQueryElement} $el the element to which to add the classes (a tr
|
||||
* or td)
|
||||
* @param {Object} decorations keys are the decoration classes (e.g.
|
||||
* 'text-bf') and values are the python expressions to evaluate
|
||||
* 'font-weight-bold') and values are the python expressions to evaluate
|
||||
* @param {Object} record a basic model record
|
||||
*/
|
||||
_setDecorationClasses: function ($el, decorations, record) {
|
||||
|
||||
@@ -96,14 +96,6 @@ div.o_boolean_toggle.custom-control.custom-checkbox {
|
||||
font-family: $font-family-sans-serif;
|
||||
}
|
||||
|
||||
// Decorations
|
||||
.text-bf {
|
||||
font-weight: bold;
|
||||
}
|
||||
.text-it {
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
//== Badges
|
||||
.badge {
|
||||
margin: 1px 2px 1px 0;
|
||||
|
||||
@@ -4903,13 +4903,13 @@ QUnit.module('basic_fields', {
|
||||
|
||||
assert.strictEqual(list.$('.o_data_cell:nth(0) .o_field_widget').attr('title'), '10/08/2017');
|
||||
|
||||
assert.hasClass(list.$('.o_data_cell:nth(0) div'), 'text-bf text-warning');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(1) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(2) div'), 'text-bf text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(3) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(4) div'), 'text-bf text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(5) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(6) div'), 'text-bf text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(0) div'), 'font-weight-bold text-warning');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(1) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(2) div'), 'font-weight-bold text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(3) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(4) div'), 'font-weight-bold text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(5) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(6) div'), 'font-weight-bold text-danger');
|
||||
|
||||
list.destroy();
|
||||
unpatchDate();
|
||||
@@ -4932,7 +4932,7 @@ QUnit.module('basic_fields', {
|
||||
});
|
||||
|
||||
assert.strictEqual(form.$('.o_field_widget').text(), 'Today');
|
||||
assert.hasClass(form.$('.o_field_widget'), 'text-bf text-warning');
|
||||
assert.hasClass(form.$('.o_field_widget'), 'font-weight-bold text-warning');
|
||||
|
||||
// in edit mode, this widget should not be editable.
|
||||
await testUtils.form.clickEdit(form);
|
||||
@@ -4980,13 +4980,13 @@ QUnit.module('basic_fields', {
|
||||
|
||||
assert.strictEqual(list.$('.o_data_cell:nth(0) .o_field_widget').attr('title'), '10/08/2017');
|
||||
|
||||
assert.hasClass(list.$('.o_data_cell:nth(0) div'), 'text-bf text-warning');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(1) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(2) div'), 'text-bf text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(3) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(4) div'), 'text-bf text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(5) div'), 'text-bf text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(6) div'), 'text-bf text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(0) div'), 'font-weight-bold text-warning');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(1) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(2) div'), 'font-weight-bold text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(3) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(4) div'), 'font-weight-bold text-danger');
|
||||
assert.doesNotHaveClass(list.$('.o_data_cell:nth(5) div'), 'font-weight-bold text-warning text-danger');
|
||||
assert.hasClass(list.$('.o_data_cell:nth(6) div'), 'font-weight-bold text-danger');
|
||||
|
||||
list.destroy();
|
||||
unpatchDate();
|
||||
|
||||
Reference in New Issue
Block a user