This question has been flagged

Hi. I need to add custom field in pos customer view. I added this field in my Contacts app, and now i need to view info from this field in my pos customer view. Ho i can implement this?

Avatar
Discard
Author Best Answer

Thank you for answer. So, if my custom field have name x_card_number the code were:

<div class='client-detail'>
    <span class='label'>Card Number</span> 
    <t t-if='partner.x_card_number'>
        <span class='detail client-custom-field'><t t-esc='partner.x_card_number' /></span>
    </t>
    <t t-if='!partner.x_card_number'>
        <span class='detail client-custom-field empty'>N/A</span>
    </t>
</div>
Avatar
Discard

yes, check whether it is working or not

Author

Don't work. I posted in file pos->static-> src-> xml -> pos.xml two block's of code after Tax ID block's:

<div class='client-detail'>

<span class='label'>Card Number</span>

<input class='detail client-x_card_number' name='x_card_number' t-att-value='partner.x_card_number || ""'></input>

</div>

and

<div class='client-detail'>

<span class='label'>Card Number</span>

<t t-if='partner.x_card_number'>

<span class='detail client-x_card_number'><t t-esc='partner.x_card_number' /></span>

</t>

<t t-if='!partner.x_card_number'>

<span class='detail client-x_card_number empty'>N/A</span>

</t>

</div>

Now, i see my custom field but there is no data. But if i write something in this field and click save button, data write to DB. I see changed data in Partner module in my custome field. So i do something wrong with reading data from DB. Any suggestion?

Author

And did not solve the problem. Anyone have any ideas?

Best Answer

Hi Link,

To add the custom field value to the Customer view from POS screen,  you can can add following code to pos->static-> src-> xml -> pos.xml, or you can add it  by extending the same template.

Thank You

<div class='client-detail'>
<span class='label'>Test</span>
<t t-if='partner.custom_field'>
<span class='detail client-custom-field'><t t-esc='partner.custom_field' /></span>
</t>
<t t-if='!partner.custom_field'>
<span class='detail client-custom-field empty'>N/A</span>
</t>
</div>
Avatar
Discard