Hello, I'm trying to create a custom field in the POS tickets of version 16 of Odoo, but it keeps saying undefined
I have created this field and this function in the pos_order.py file (I don't know if it is the correct file)
total_impuestos_personalizado = fields.Float(compute='_impuestos_personalizados')
def _compute_custom_taxes(self):
for order in self:
taxes = order.fiscal_position_id.map_tax(order.taxes_ids)
result_1 = order.total_amount / (1 + taxes.amount)
order.total_tax_custom = order.total_amount - result_1
and I have put these lines of code in the OrderReceipt.js file
Inside the configuration
this._addCustomFields(this._receiptEnv);
Below the setup
_addCustomFields(envreceipt) {
receiptSend.receipt.total_tax_custom = receiptSend.order.total_tax_custom;
}