跳至內容
選單
此問題已被標幟
2 回覆
1967 瀏覽次數

Hello
I'm seeking assistance with a coding challenge I've encountered in my project. I've recently added a new field for the date of birth (dob) in the res.partner model, and I'm looking to display this field in the list view of the Point of Sale (POS) screen.

So far, I've managed to integrate the dob field into the header section successfully. However, I'm struggling to display it within the table body (tbody) content. Despite my best efforts, I haven't been able to find a solution on my own.

Could someone please provide suggestions or guidance on how to address this issue? Any assistance or insights would be greatly appreciated.

Thank you in advance for your help!

  


 


 

  

 


頭像
捨棄
最佳答案

it is not working!!!

頭像
捨棄
最佳答案

Hi,


To display a field in the list view of the Point of Sale (POS) screen, you need to first inherit from 'point_of_sale.PartnerLine'. Then, use XPath to specify where you want to add the field and add your custom field.


Here's an example:


<t t-name="your_module_name.CustomPartnerLine"

t-inherit="point_of_sale.PartnerLine"

       t-inherit-mode="extension" owl="1">


<xpath expr="//td[hasclass('edit-partner-button-cell')]" position="before">

        <td>

<div class="partner-line-custom-field" t-if="props.partner.custom_field">

<t t-esc="props.partner.custom_field" />

            </div>

        </td>

    </xpath>

</t>


Replace "your_module_name.CustomPartnerLine" with your desired template name. Also, replace 'edit-partner-button-cell' with the class name of the td after or before which you want to add your custom field. Then, specify the position depending on whether you want to add the custom field after or before the specified td. Finally, replace "custom_field" with the name of your custom field (dob).


Hope it helps

頭像
捨棄
相關帖文 回覆 瀏覽次數 活動
2
5月 25
997
1
1月 25
1021
1
3月 24
1257
0
10月 24
1283
3
3月 24
1572