I want to add new fields to POS Receipt.I want to do it by inheriting the js file in my custom module.I don't know js so I don't know how to inherit it.In odoo's file point of sale > static > src > js > pos.js
model: 'res.company',
fields: [ 'currency_id', 'email', 'website', 'company_registry', 'vat', 'name', 'phone', 'partner_id' , 'country_id', 'tax_calculation_rounding_method'],
ids: function(self){ return [self.user.company_id[0]]; },
loaded: function(self,companies){ self.company = companies[0]; },
I edited fields and added my required field say street2
and it is coming in Pos Receipt
I tried inheriting the js file but it is not working.
This is my code
var _super = module.PosModel.prototype;
module.PosModel = module.PosModel.extend({
initialize: function (session, attributes) {
_super.initialize.apply(this, arguments);
this.models.push({
model: 'res.company',
fields: ['street2'],
})
return this;
},
});
I also create an xml file to show the path of js file.
xml
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="assets" inherit_id="point_of_sale.assets">
<xpath expr="." position="inside">
<script type="text/javascript" src="/xn_pos_vat_enhancement_v11/static/src/js/pos_receipt_fields.js"></script>
</xpath>
</template>
</data>
</odoo>
Odoo Version : 11 (Community)