Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
2 Risposte
1964 Visualizzazioni

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
Abbandona
Risposta migliore

it is not working!!!

Avatar
Abbandona
Risposta migliore

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
Abbandona
Post correlati Risposte Visualizzazioni Attività
2
mag 25
992
1
gen 25
987
1
mar 24
1251
0
ott 24
1273
3
mar 24
1537