title: Get last order date customer in odoo partner view
body: <p>How can I get the last confirmed sales order date in my odoo partner view
  for example </p>
  
  <p>Customer J. Do last purchase : 10/03/2018 / 50 days ago
  Is there a module for this or how can I make a computed field with only access to odoo GUI &amp; developer mode. </p>
  
  <p>I tried:</p>
  
  <pre><code>lines = self.env['sale.order'].sorted(
    [('partner_id', '=', company_id),
    key=lambda l: l.date_order, reverse=True)
    self.x_last_order = lines[:1].date_order
  </code></pre>
  
  <p>So I adjusted my compted field to:
  <a href="https://i.stack.imgur.com/7AoQO.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7AoQO.png" alt="enter image description here"></a></p>
  
  <p>But i stil don't get a result or error.</p>