I have added a new character field to the "res.partner" model in my Odoo application named "customer_level". My intention is to make this field visible in the Point of Sale module. This way, when a cashier searches for a customer, they will be able to view the corresponding customer level information.
I was able to add the "customer_level" field to the Point of Sale module in Odoo 15, but I am encountering issues when trying to reuse the same code in Odoo 16.
I will provide codes how did I add to Odoo 15.
my pos.js is located at my custom module, /src/user/my_module/static/src/js/pos.js
`odoo.define('pos.Pos', function (require) {
"use strict";
var models = require('point_of_sale.models');
var fields = models.load_fields('res.partner', 'customer_level');
});`
Here is my pos.xml at /src/user/my_module/static/src/xml/pos.xml
``
Type
Customer Type
`
`
It works perfectly at Odoo 15, I wonder why this code does not work at Odoo 16. I have changed "ClientListScreen" to "PartnerLineScreen" and "ClientLine" to "PartnerLine" accordingly at my codes to work with Odoo 16 but field is not appeared at "PartnerLineScreen". Kindly help me I am stucked.
Here is my pos.xml at /src/user/my_module/static/src/xml/pos.xml
`<?xml version="1.0" encoding="UTF-8"?>
<templates id="pos_subscriber_template" inherit_id="point_of_sale.template" xml:space="preserve">
<!-- ClientListScreenWidget for Customer Type column-->
<t t-extend="ClientListScreenWidget" t-inherit="point_of_sale.ClientListScreen" t-inherit-mode="extension" owl="1">
<xpath expr="//table//thead//tr" position="inside">
<th>Type</th>
</xpath>
</t>
<!-- Getting value for Customer Type colun -->
<t t-extend="ClientLine" t-inherit="point_of_sale.ClientLine" t-inherit-mode="extension" owl="1">
<xpath expr="//tr" position="inside">
<td class="text-center">
<center><t t-esc='props.partner.customer_level or ""' /></center>
</td>
</xpath>
</t>
<!-- Customer Type column at Client Detials Edit -->
<t t-extend="ClientDetailsEdit" t-inherit="point_of_sale.ClientDetailsEdit" t-inherit-mode="extension" owl="1">
<xpath expr="//div[hasclass('client-details-left')]" position="inside">
<div class="client-detail">
<span class='label'>Customer Type</span>
<span> <t t-esc='props.partner.customer_level or ""'/></span>
</div>
</xpath>
</t>
<!-- Customer Type column at Client Detials Edit -->
</templates>
`
good code many thanks