0

I am currently working on Odoo (v8) template and want to show contact person name only for customer. What currently works is:

      <span  t-field="o.partner_id.child_ids"  t-field-options='{"widget":  "contact", "fields": [ "name"], "no_marker": true}' />  

the output is:

   Cathirine,Tak

My question is: How can I write to show only contact name as:

   Tak
ttds
  • 1
  • 2

1 Answers1

1

You can do

class SaleOrder(models.Model):
    _inherit = 'sale.order'

    contact_id = fields.Many2one('res.partner', 'Contact',
                                 domain="[('parent_id','=',partner_id)]")

Then call

<strong>Dear: <span t-field="o.contact_id.name"/></strong><br/>
Mr. E
  • 2,070
  • 11
  • 23
tate
  • 11
  • 1