Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
1958 Visualizações

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
Cancelar
Melhor resposta

it is not working!!!

Avatar
Cancelar
Melhor resposta

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
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
2
mai. 25
978
1
jan. 25
976
1
mar. 24
1231
0
out. 24
1264
3
mar. 24
1508