summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/tests
diff options
context:
space:
mode:
authorJoseph Caburnay <jcb@odoo.com>2020-08-13 07:28:02 +0000
committerJoseph Caburnay <jcb@odoo.com>2020-08-17 10:49:05 +0000
commit4bd9ced6bfd833199d0380de61b1a5012b470890 (patch)
tree400c4d4ead25a3bd8ca2814491eedc89db4309dc /addons/point_of_sale/tests
parent9f835a30df5c17d8a4f7630770655bb8f3175116 (diff)
[IMP] point_of_sale,pos_*: new receipt screen
Aside from new look, we also move the email option from payment screen to receipt screen. This allows emailing the receipt to a customer that is not in the contact list. We also removed invoicing in the receipt screen during failed invoicing from payment screen as it is removed in here: bc48e0033e2166728ae72739b72076ea67e86e74 closes odoo/odoo#55868 Related: odoo/enterprise#12395 Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/tests')
-rw-r--r--addons/point_of_sale/tests/test_frontend.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/addons/point_of_sale/tests/test_frontend.py b/addons/point_of_sale/tests/test_frontend.py
index 71b93b4181c..4f99b032abf 100644
--- a/addons/point_of_sale/tests/test_frontend.py
+++ b/addons/point_of_sale/tests/test_frontend.py
@@ -43,8 +43,8 @@ class TestPointOfSaleHttpCommon(odoo.tests.HttpCase):
# Archive all existing product to avoid noise during the tours
all_pos_product = self.env['product.product'].search([('available_in_pos', '=', True)])
discount = self.env.ref('point_of_sale.product_product_consumable')
- tip = self.env.ref('point_of_sale.product_product_tip')
- (all_pos_product - discount - tip)._write({'active': False})
+ self.tip = self.env.ref('point_of_sale.product_product_tip')
+ (all_pos_product - discount - self.tip)._write({'active': False})
# In DESKS categ: Desk Pad
pos_categ_desks = env.ref('point_of_sale.pos_category_desks')
@@ -475,6 +475,11 @@ class TestPointOfSaleHttpCommon(odoo.tests.HttpCase):
class TestUi(TestPointOfSaleHttpCommon):
def test_01_pos_basic_order(self):
+ self.main_pos_config.write({
+ 'iface_tipproduct': True,
+ 'tip_product_id': self.tip.id,
+ })
+
# open a session, the /pos/web controller will redirect to it
self.main_pos_config.open_session_cb(check_coa=False)
@@ -493,6 +498,10 @@ class TestUi(TestPointOfSaleHttpCommon):
for order in self.env['pos.order'].search([]):
self.assertEqual(order.state, 'paid', "Validated order has payment of " + str(order.amount_paid) + " and total of " + str(order.amount_total))
+ # check if email from ReceiptScreenTour is properly sent
+ email_count = self.env['mail.mail'].search_count([('email_to', '=', 'test@receiptscreen.com')])
+ self.assertEqual(email_count, 1)
+
def test_02_pos_with_invoiced(self):
self.main_pos_config.open_session_cb(check_coa=False)
self.start_tour("/pos/web?config_id=%d" % self.main_pos_config.id, 'ChromeTour', login="admin", step_delay=50)