diff --git a/addons/point_of_sale/static/src/js/field_text_html.js b/addons/point_of_sale/static/src/js/field_text_html.js new file mode 100644 index 0000000000000000000000000000000000000000..27b378801c90b58c38051ef1608bb704b6fd4870 --- /dev/null +++ b/addons/point_of_sale/static/src/js/field_text_html.js @@ -0,0 +1,20 @@ +odoo.define('point_of_sale.fieldtexthtml', function (require) { + 'use strict'; + + var FieldTextHtml = require('web_editor.backend').FieldTextHtml; + + FieldTextHtml.include({ + // avoid '414 Request-URI Too Large' errors to + // /point_of_sale/field/customer_facing_display_template by + // filtering out biggest fields + getDatarecord: function () { + var datarecord = this._super(); + if (this.model === 'pos.config') { + datarecord = _.omit(datarecord, function (val, key) { + return _.isObject(val) || key === 'customer_facing_display_html'; + }); + } + return datarecord; + }, + }); +}); diff --git a/addons/point_of_sale/views/pos_templates.xml b/addons/point_of_sale/views/pos_templates.xml index 79a214758d7a202c82bada4f58f3b2e25b8e6647..110b3fd03d2050bd8fc437af9f3b68397cf4bc52 100644 --- a/addons/point_of_sale/views/pos_templates.xml +++ b/addons/point_of_sale/views/pos_templates.xml @@ -72,6 +72,12 @@ </script> </template> +<template id="pos_editor_fieldtexthtml_assets" inherit_id="web.assets_backend"> + <xpath expr="." position="inside"> + <script type="text/javascript" src="/point_of_sale/static/src/js/field_text_html.js"/> + </xpath> +</template> + <template id="pos_editor_assets" inherit_id="web_editor.assets_editor"> <xpath expr="//script[last()]" position="after"> <script type="text/javascript" src="/point_of_sale/static/src/js/pos.web_editor.js"/>