Skip to Content
Menu
This question has been flagged
2 Replies
1905 Views

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!

  


 


 

  

 


Avatar
Discard
Best Answer

it is not working!!!

Avatar
Discard
Best Answer

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

Avatar
Discard
Related Posts Replies Views Activity
2
May 25
928
1
Jan 25
935
1
Mar 24
1206
0
Oct 24
1211
3
Mar 24
1478