[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:
@@ -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
|
||||
|
||||
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user