[IMP] point_of_sale, pos_discount: hide discount product in point of sale

This commit prevent the discount product to be shown in the frontend of
the PoS and abling him to download demo data on the flight if he does
not have other products available.

closes odoo/odoo#143154

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
This commit is contained in:
Adrien Guilliams (adgu)
2023-11-22 23:58:16 +00:00
parent 5941411376
commit 7527e66daa
2 changed files with 4 additions and 3 deletions
+3 -1
View File
@@ -836,4 +836,6 @@ class PosConfig(models.Model):
return False
def _get_special_products(self):
return self.env.ref('point_of_sale.product_product_tip', raise_if_not_found=False) or self.env['product.product']
default_discount_product = self.env.ref('point_of_sale.product_product_consumable', raise_if_not_found=False) or self.env['product.product']
default_tip_product = self.env.ref('point_of_sale.product_product_tip', raise_if_not_found=False) or self.env['product.product']
return default_tip_product | default_discount_product
+1 -2
View File
@@ -34,5 +34,4 @@ class PosConfig(models.Model):
def _get_special_products(self):
res = super()._get_special_products()
default_discount_product = self.env.ref('point_of_sale.product_product_consumable', raise_if_not_found=False) or self.env['product.product']
return res | self.env['pos.config'].search([]).mapped('discount_product_id') | default_discount_product
return res | self.env['pos.config'].search([]).mapped('discount_product_id')