diff --git a/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.js b/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.js index a406ada3a33..c443060a968 100644 --- a/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.js +++ b/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.js @@ -38,6 +38,11 @@ export class BaseProductAttribute extends Component { extra, }; } + + getFormatPriceExtra(val) { + const sign = val < 0 ? "- " : "+ "; + return sign + this.env.utils.formatCurrency(Math.abs(val)); + } } export class RadioProductAttribute extends BaseProductAttribute { @@ -57,6 +62,10 @@ export class RadioProductAttribute extends BaseProductAttribute { } } +export class PillsProductAttribute extends BaseProductAttribute { + static template = "point_of_sale.PillsProductAttribute"; +} + export class SelectProductAttribute extends BaseProductAttribute { static template = "point_of_sale.SelectProductAttribute"; } @@ -71,7 +80,7 @@ export class MultiProductAttribute extends BaseProductAttribute { setup() { super.setup(); this.state = useState({ - attribute_value_ids: [], + attribute_value_ids: {}, custom_value: "", }); @@ -91,6 +100,7 @@ export class ProductConfiguratorPopup extends AbstractAwaitablePopup { static template = "point_of_sale.ProductConfiguratorPopup"; static components = { RadioProductAttribute, + PillsProductAttribute, SelectProductAttribute, ColorProductAttribute, MultiProductAttribute, diff --git a/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.xml b/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.xml index 8e9e1076d39..1db839957a3 100644 --- a/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.xml +++ b/addons/point_of_sale/static/src/app/store/product_configurator_popup/product_configurator_popup.xml @@ -3,21 +3,46 @@
-
+
- - -
+ +
- + +
-
+
+ +
+ +
+
+
+ + +
+
+ +
+ + +
+
@@ -29,12 +54,12 @@
- @@ -49,13 +74,20 @@
  • - + - + + +
    + + + +
    +
@@ -64,15 +96,25 @@
-
-
-
-
-
- +
+
+ +
+
+ + diff --git a/addons/point_of_sale/static/tests/tours/helpers/ProductConfiguratorTourMethods.js b/addons/point_of_sale/static/tests/tours/helpers/ProductConfiguratorTourMethods.js index 5cd553a5836..30dea9d7d8e 100644 --- a/addons/point_of_sale/static/tests/tours/helpers/ProductConfiguratorTourMethods.js +++ b/addons/point_of_sale/static/tests/tours/helpers/ProductConfiguratorTourMethods.js @@ -4,7 +4,7 @@ export function pickRadio(name) { return [ { content: `picking radio attribute with name ${name}`, - trigger: `.product-configurator-popup .attribute-name-cell label[name='${name}']`, + trigger: `.product-configurator-popup div.attribute-name-cell:contains('${name}') input`, }, ]; } diff --git a/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.js b/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.js index 187ec2e7a7c..66dbc9087a3 100644 --- a/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.js +++ b/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.js @@ -147,6 +147,7 @@ export class AttributeSelection extends Component { getfPriceExtra(value) { const priceExtra = this._getPriceExtra(value); - return this.selfOrder.formatMonetary(priceExtra); + const sign = priceExtra < 0 ? "- " : "+ "; + return sign + this.selfOrder.formatMonetary(Math.abs(priceExtra)); } } diff --git a/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.xml b/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.xml index f6ebfeb36c9..0f6e66694da 100644 --- a/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.xml +++ b/addons/pos_self_order/static/src/app/components/attribute_selection/attribute_selection.xml @@ -17,7 +17,7 @@
- + +