I am using odoo 15 ; I am trying to customize receipt in point_of_sale module I have a problem regard access the custom filed in company module as following :
My customized module : custom/models/res_company.py
class rescompany(models.Model):
_name = "res.company"
_inherit = "res.company"
#customized fields
x_industry = fields.Char(string='Compnay Industry', translate=True)
my customized view in xml : custom/static/src/xml/custom_pos.xml
<xpath expr="//t[@t-if='receipt.company.logo']" position="before">
<div>
<span style="font-size: smaller;float: left">
<t t-esc="receipt.company.name" />
</span>
</div>
<div>
<div>
<span style="font-size: smaller;float: left">
<t t-esc="receipt.company.x_industry"/>
</span>
</div>
</div>
</xpath>
</t>
</templates>
manifest.py
...
'assets': {
'web.assets_backend': [
"custom/static/src/js/OrderReceipt.js",
],
'web.assets_qweb': [
'custom/static/src/xml/custom_pos.xml',
],
},
...
Now, I don't know how to access x_industry in OrderReceipt.js ? I tried to follow this link : Odoo PoS not showing custom fields in receipts but it is in odoo 13 and I did not understand the parameters I should add to be modified correctly ;