title: How can I show the pricelist discount in a sale order line and make it editable?
body: <p>I would like to show the discount of the pricelist. It matches with the <code>price_discount</code> field of the model <code>product.pricelist.item</code>. </p>
  
  <p>But once I get the discount from that model I want to make it editable. How can I achieve this?</p>
  
  <p>I tried this code with no luck. I make the field <code>discount_percentage</code> invisible, I only use it for recomputing the field.</p>
  
  <pre class="lang-py prettyprint-override"><code>discount_percentage = fields.Float(
      compute='_compute_discount_percentage',
      string=_('Discount (%)'),
      digits=dp.get_precision('Discount'),
  )
  
  discount_manual = fields.Float(
      string=_('Discount dummy (%)'),
      digits=dp.get_precision('Discount'),
  )
  
  @api.one
  @api.depends('product_id', 'product_id.lst_price', 'price_reduce', 'price_unit')
  def _compute_discount_percentage(self):
      _logger.debug('-- COMPUTE DISCOUNT PERCENTAGE --')
      if not self.discount_manual:
          if self.product_id.lst_price:
              disc = (self.product_id.lst_price - self.price_reduce) * 100 / self.product_id.lst_price
          else:
              disc = 0            
          self.discount_percentage = disc
          self.discount_manual = self.discount_percentage
      else:
          self.discount_percentage = self.discount_manual
  </code></pre>
  
  <p>Is there a function where I can get the discount using the <code>product_id</code> and <code>pricelist_id</code>?</p>
  
  <p>Should I use a SQL query in the <code>product_id_change</code> method in order to get the discount?</p>