Browse Source

[FIX] agreement_legal: lint warnings

pull/394/head
Alexandre Fayolle 5 years ago
parent
commit
6a20d54993
  1. 17
      agreement_legal/static/src/js/domain_widget_ext.js
  2. 20
      agreement_legal/static/src/xml/domain_widget_view.xml

17
agreement_legal/static/src/js/domain_widget_ext.js

@ -18,9 +18,9 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
this.partialUse = this.nodeOptions.partial_use || false;
},
//--------------------------------------------------------------------------
//----------------------------------------------------------------------
// Private
//--------------------------------------------------------------------------
//----------------------------------------------------------------------
/**
* @private
@ -37,10 +37,12 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
// Convert char value to array value
var value = this.value || "[]";
// Create the domain selector or change the value of the current one...
// Create the domain selector or change the value of the current
// one...
var def;
if (!this.domainSelector) {
this.domainSelector = new DomainSelector(this, this._domainModel, value, {
this.domainSelector = new DomainSelector(
this, this._domainModel, value, {
readonly: this.mode === "readonly" || this.inDialog,
filters: this.fsFilters,
debugMode: session.debug,
@ -54,9 +56,10 @@ odoo.define('agreement_legal.domain_widget_ext', function (require) {
return def.then(this._replaceContent.bind(this));
},
/**
* Render the field DOM except for the domain selector part. The full field
* DOM is composed of a DIV which contains the domain selector widget,
* followed by other content. This other content is handled by this method.
* Render the field DOM except for the domain selector part. The full
* field DOM is composed of a DIV which contains the domain selector
* widget, followed by other content. This other content is handled by
* this method.
*
* @private
*/

20
agreement_legal/static/src/xml/domain_widget_view.xml

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="FieldDomain.content">
<t t-name="FieldDomain.content">
<t t-if="partialUse">
<div t-if="hasModel" class="o_field_domain_panel">
<!--<div t-if="hasModel" class="o_field_domain_panel">
@ -29,9 +29,9 @@
</div>
<div t-else="">Select a model to add a filter.</div>
</t>
</t>
</t>
<div aria-atomic="true" t-name="DomainSelector" t-attf-class="o_domain_node o_domain_tree o_domain_selector #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
<div aria-atomic="true" t-name="DomainSelector" t-attf-class="o_domain_node o_domain_tree o_domain_selector #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
<t t-if="widget.options.partialUse">
<t t-if="widget.children.length === 0">
<span>SMatch <strong>all records</strong></span>
@ -73,8 +73,8 @@
<input type="text" class="o_domain_debug_input"/>
</label>
</t>
</div>
<t t-name="DomainNode.ControlPanel">
</div>
<t t-name="DomainNode.ControlPanel">
<t t-if="widget.options.partialUse">
<div t-if="!widget.readonly &amp;&amp; !widget.noControlPanel" class="o_domain_node_control_panel" role="toolbar" aria-label="Domain node">
</div>
@ -86,8 +86,8 @@
<button class="btn o_domain_add_node_button" title="Add branch" aria-label="Add branch" data-branch="1"><i class="fa fa-ellipsis-h"/></button>
</div>
</t>
</t>
<div t-name="DomainLeaf" t-attf-class="o_domain_node o_domain_leaf o_domain_selector_row #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
</t>
<div t-name="DomainLeaf" t-attf-class="o_domain_node o_domain_leaf o_domain_selector_row #{widget.readonly ? 'o_read_mode' : 'o_edit_mode'}">
<t t-call="DomainNode.ControlPanel"/>
<div t-if="!widget.readonly" class="o_domain_leaf_edition">
@ -154,8 +154,8 @@
set
</t>
</div>
</div>
<div aria-atomic="true" t-name="ModelFieldSelector" t-attf-class="o_field_selector#{!widget.options.readonly ? ' o_edit_mode o_input' : ''}">
</div>
<div aria-atomic="true" t-name="ModelFieldSelector" t-attf-class="o_field_selector#{!widget.options.readonly ? ' o_edit_mode o_input' : ''}">
<div class="o_field_selector_value" tabindex="0"/>
<t t-if="!widget.options.partialUse">
<div class="o_field_selector_controls" tabindex="0">
@ -175,5 +175,5 @@
<input type="text" class="o_input"/>
</div>
</div>
</div>
</div>
</templates>
Loading…
Cancel
Save