Revise the Solution:
To get the product's other field access you need to do customization in the JS
& XML
template.
JS Code:
odoo.define('ypour_app.your app', function (require) {
"use strict";
var models = require('point_of_sale.models');
var OrderlineSuper = models.Orderline;
models.Orderline = models.Orderline.extend({
export_for_printing : function() {
var data = OrderlineSuper.prototype.export_for_printing.call(this);
// this.get_product() => you can have here all the product data [barcode/default_code/ etc.]
data.product_default_code = this.get_product().default_code;
return data;
}
});
});
XML Code:
<t t-extend="OrderReceipt">
<t t-jquery="t[t-foreach*='receipt.orderlines']" t-operation="append">
<b>Default Code </b>: <t t-esc="line.product_default_code"/>
</t>
</t>