diff --git a/addons/beyond_pos_theme/__manifest__.py b/addons/beyond_pos_theme/__manifest__.py index c7de08b..5f4445c 100644 --- a/addons/beyond_pos_theme/__manifest__.py +++ b/addons/beyond_pos_theme/__manifest__.py @@ -33,6 +33,7 @@ El veredicto del spike está en docs/adr/ADR-001-spike-pos.md. 'beyond_pos_theme/static/src/empleados_linea/empleados_linea.xml', 'beyond_pos_theme/static/src/numpad_mx/numpad_mx.js', 'beyond_pos_theme/static/src/numpad_mx/numpad_mx.xml', + 'beyond_pos_theme/static/src/control_buttons/sin_nota.xml', ], }, 'demo': [ diff --git a/addons/beyond_pos_theme/static/src/control_buttons/sin_nota.xml b/addons/beyond_pos_theme/static/src/control_buttons/sin_nota.xml new file mode 100644 index 0000000..5401f0a --- /dev/null +++ b/addons/beyond_pos_theme/static/src/control_buttons/sin_nota.xml @@ -0,0 +1,19 @@ + + + + + + + diff --git a/addons/beyond_pos_theme/tests/test_theme_assets.py b/addons/beyond_pos_theme/tests/test_theme_assets.py index f3a2f1d..0bc8fc0 100644 --- a/addons/beyond_pos_theme/tests/test_theme_assets.py +++ b/addons/beyond_pos_theme/tests/test_theme_assets.py @@ -1,4 +1,5 @@ # Part of Beyond. Collina Systems proprietary module. +import pathlib from odoo.modules.module import get_manifest from odoo.tests import TransactionCase, tagged from odoo.tools import file_open @@ -45,3 +46,17 @@ class TestBeyondPosThemeAssets(TransactionCase): contenido = handle.read() self.assertIn('t-inherit="point_of_sale.ProductCard"', contenido) self.assertIn('t-inherit-mode="extension"', contenido) + + def test_el_boton_de_nota_sale_de_la_barra(self): + """No hay ajuste que lo apague: se retira por herencia de plantilla. + Se verifica que la pieza viaje al paquete del POS y que apunte a la + plantilla del core, que es lo comprobable sin navegador.""" + paquete = self.env['ir.qweb']._get_asset_bundle('point_of_sale._assets_pos') + archivos = [f['url'] for f in paquete.files if 'sin_nota' in f['url']] + self.assertEqual(len(archivos), 1, 'la pieza no llegó al paquete del POS') + contenido = pathlib.Path( + '/mnt/extra-addons/beyond_pos_theme/static/src/control_buttons/sin_nota.xml' + ).read_text() + self.assertIn('t-inherit="point_of_sale.ControlButtons"', contenido) + self.assertIn('//InternalNoteButton', contenido) + self.assertIn('position="replace"', contenido)