تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
2 الردود
1956 أدوات العرض

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
مايو 25
976
1
يناير 25
972
1
مارس 24
1230
0
أكتوبر 24
1258
3
مارس 24
1504