title: How to create a dynamic label for a form field in Odoo 12?
body: <p>I have a form view. I added to it the field <code>main_field</code>, but I want to change its label dynamically, depending on the value of other field named <code>conditional_field</code>. This is my main attempt:</p>
  
  <pre><code>&lt;group&gt;
      &lt;group name="xxx"&gt;
          &lt;field name="conditional_field" invisible="1"/&gt;
          &lt;label for="main_field" string="AAA" attrs="{'invisible': [('conditional_field', '!=', 'A')]}"/&gt;
          &lt;label for="main_field" string="BBB" attrs="{'invisible': [('conditional_field', '!=', 'B')]}"/&gt;
          &lt;div&gt;
              &lt;field name="main_field" class="oe_inline"/&gt;
          &lt;/div&gt;
      &lt;/group&gt;
  &lt;/group&gt;
  </code></pre>
  
  <p>The problem of this solution is that the labels are always there, just invisible, but actually they are taking space.</p>
  
  <p>If <em>BBB</em> is hidden, <code>main_field</code> appears under the label <em>AAA</em>, because <em>BBB</em> is invisible but taking place at the right of <em>AAA</em>.
  If <em>AAA</em> is hidden, <code>main_field</code> appears under the label <em>BBB</em>, and <em>BBB</em> is at the right side, because at the left side is the invisible <em>AAA</em> taking place, so it looks even uglier.</p>
  
  <p>The problem is that Odoo is setting <code>display: none;</code> to labels, but is preserving the style of the cell they are in, so my method does not work properly.</p>
  
  <p>Any ideas? I am trying to avoid create auxiliary fields for each label because I have to do this with a lot of labels and that would be a mess. Thank you!</p>