Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在开发 Odoo (v8) 模板,并且只想为客户显示联系人姓名。目前有效的是:
<span t-field="o.partner_id.child_ids" t-field-options='{"widget": "contact", "fields": [ "name"], "no_marker": true}' />
输出是:
Cathirine,Tak
我的问题是:我怎么写才能只显示联系人姓名:
Tak
你可以做
class SaleOrder(models.Model): _inherit = 'sale.order' contact_id = fields.Many2one('res.partner', 'Contact', domain="[('parent_id','=',partner_id)]")
然后打电话
<strong>Dear: <span t-field="o.contact_id.name"/></strong><br/>