跳至内容
菜单
此问题已终结
2 回复
5229 查看

In the Sales order document report the Company Name & Contact person name is displayed as in the Order form view i.e. XYZ Company, Mr. John and then address, phone and fax. I am unable to change it to Only Company Name and then Contact Person's information eg,

XYZ Company

Address    

Phone

Fax 

Mr John

Email of MR. John 

Mobile No. of Mr. John

 Can some one please explain how the this syntax works, (Excuse me if some one has already asked this question before.)

<div t-field="doc.partner_invoice_id" t-field-options="{&quot;widget&quot;: &quot;contact&quot;, &quot;fields&quot;: [&quot;address&quot;, &quot;name&quot;, &quot;phone&quot;, &quot;fax&quot;], &quot;no_marker&quot;: true, &quot;phone_icons&quot;: true}"/>  

                                              



形象
丢弃
编写者

Thankyou very much Ray. Your solution worked for me very nicely.

最佳答案

Make sure you test for the cases where you are selling to:

  • a Company

  • a Contact

  • a Contact at a Company

You probably want most of these fields:

<div t-field="doc.partner_invoice_id.parent_id.name" /> <div t-field="doc.partner_invoice_id.parent_id.street" /> <div t-field="doc.partner_invoice_id.parent_id.street2" /> <div t-field="doc.partner_invoice_id.parent_id.city" /> <div t-field="doc.partner_invoice_id.parent_id.state_id.code" /> <div t-field="doc.partner_invoice_id.parent_id.zip" /> <div t-field="doc.partner_invoice_id.parent_id.country_id" /> <div t-field="doc.partner_invoice_id.parent_id.phone" /> <div t-field="doc.partner_invoice_id.parent_id.fax" /> <div t-field="doc.partner_invoice_id.name" /> <div t-field="doc.partner_invoice_id.email" /> <div t-field="doc.partner_invoice_id.mobile" />

形象
丢弃
最佳答案

remove address,fax from the fields Like:

t-field-options='{"widget": "contact", "fields": ["name","phone"]}'
形象
丢弃