@@ -360,11 +360,7 @@ def test_loyalty_free_product_loyalty_program(self):
360
360
'points' : 100 ,
361
361
})
362
362
363
- self .start_tour (
364
- "/pos/ui/%d" % self .main_pos_config .id ,
365
- "PosLoyaltyChangeRewardQty" ,
366
- login = "pos_user" ,
367
- )
363
+ self .start_pos_tour ("PosLoyaltyChangeRewardQty" )
368
364
369
365
def test_loyalty_free_product_zero_sale_price_loyalty_program (self ):
370
366
# In this program, each $ spent gives 1 point.
@@ -1340,7 +1336,7 @@ def test_promotion_program_with_loyalty_program(self):
1340
1336
1341
1337
self .main_pos_config .open_ui ()
1342
1338
1343
- self .start_pos_tour ("PosLoyaltyPromotion" , login = "pos_admin" )
1339
+ self .start_pos_tour ("PosLoyaltyPromotion" )
1344
1340
1345
1341
def test_promo_with_free_product (self ):
1346
1342
self .env ['loyalty.program' ].search ([]).write ({'active' : False })
@@ -1669,11 +1665,7 @@ def test_loyalty_program_with_tagged_buy_x_get_y(self):
1669
1665
})
1670
1666
1671
1667
self .main_pos_config .open_ui ()
1672
- self .start_tour (
1673
- "/pos/ui/%d" % self .main_pos_config .id ,
1674
- "PosLoyaltyTour12" ,
1675
- login = "pos_user" ,
1676
- )
1668
+ self .start_pos_tour ("PosLoyaltyTour12" )
1677
1669
1678
1670
def test_promotion_with_min_amount_and_specific_product_rule (self ):
1679
1671
"""
@@ -1714,11 +1706,7 @@ def test_promotion_with_min_amount_and_specific_product_rule(self):
1714
1706
})
1715
1707
1716
1708
self .main_pos_config .open_ui ()
1717
- self .start_tour (
1718
- '/pos/ui/%d' % self .main_pos_config .id ,
1719
- 'PosLoyaltyMinAmountAndSpecificProductTour' ,
1720
- login = 'pos_user' ,
1721
- )
1709
+ self .start_pos_tour ('PosLoyaltyMinAmountAndSpecificProductTour' )
1722
1710
1723
1711
def test_gift_card_price_no_tax (self ):
1724
1712
"""
@@ -1748,11 +1736,7 @@ def test_gift_card_price_no_tax(self):
1748
1736
gift_card_program .coupon_ids .code = '043123456'
1749
1737
1750
1738
# Run the tour. It will use the gift card.
1751
- self .start_tour (
1752
- "/pos/ui/%d" % self .main_pos_config .id ,
1753
- "GiftCardProgramPriceNoTaxTour" ,
1754
- login = "pos_user"
1755
- )
1739
+ self .start_pos_tour ("GiftCardProgramPriceNoTaxTour" )
1756
1740
1757
1741
def test_physical_gift_card_sale (self ):
1758
1742
"""
@@ -1767,11 +1751,7 @@ def test_physical_gift_card_sale(self):
1767
1751
gift_card_program = self .create_programs ([('arbitrary_name' , 'gift_card' )])['arbitrary_name' ]
1768
1752
1769
1753
# Run the tour
1770
- self .start_tour (
1771
- "/pos/ui/%d" % self .main_pos_config .id ,
1772
- "PhysicalGiftCardProgramSaleTour" ,
1773
- login = "pos_user"
1774
- )
1754
+ self .start_pos_tour ("PhysicalGiftCardProgramSaleTour" )
1775
1755
1776
1756
expected_coupons = {
1777
1757
"test-card-0000" : 125 ,
@@ -1833,11 +1813,7 @@ def test_dont_grant_points_reward_order_lines(self):
1833
1813
})
1834
1814
1835
1815
self .main_pos_config .open_ui ()
1836
- self .start_tour (
1837
- "/pos/ui/%d" % self .main_pos_config .id ,
1838
- "PosLoyaltyDontGrantPointsForRewardOrderLines" ,
1839
- login = "pos_user" ,
1840
- )
1816
+ self .start_pos_tour ("PosLoyaltyDontGrantPointsForRewardOrderLines" )
1841
1817
1842
1818
loyalty_card = loyalty_program .coupon_ids .filtered (lambda coupon : coupon .partner_id .id == partner .id )
1843
1819
@@ -1874,11 +1850,7 @@ def test_points_awarded_global_discount_code_no_domain_program(self):
1874
1850
})
1875
1851
1876
1852
self .main_pos_config .open_ui ()
1877
- self .start_tour (
1878
- "/pos/ui/%d" % self .main_pos_config .id ,
1879
- "PosLoyaltyPointsGlobalDiscountProgramNoDomain" ,
1880
- login = "pos_user" ,
1881
- )
1853
+ self .start_pos_tour ("PosLoyaltyPointsGlobalDiscountProgramNoDomain" )
1882
1854
self .assertEqual (loyalty_card .points , 90 )
1883
1855
1884
1856
def test_points_awarded_discount_code_no_domain_program (self ):
@@ -1921,11 +1893,7 @@ def test_points_awarded_discount_code_no_domain_program(self):
1921
1893
})
1922
1894
1923
1895
self .main_pos_config .open_ui ()
1924
- self .start_tour (
1925
- "/pos/ui/%d" % self .main_pos_config .id ,
1926
- "PosLoyaltyPointsDiscountNoDomainProgramNoDomain" ,
1927
- login = "pos_user" ,
1928
- )
1896
+ self .start_pos_tour ("PosLoyaltyPointsDiscountNoDomainProgramNoDomain" )
1929
1897
self .assertEqual (loyalty_card .points , 135 )
1930
1898
1931
1899
def test_points_awarded_general_discount_code_specific_domain_program (self ):
@@ -1978,11 +1946,7 @@ def test_points_awarded_general_discount_code_specific_domain_program(self):
1978
1946
})
1979
1947
1980
1948
self .main_pos_config .open_ui ()
1981
- self .start_tour (
1982
- "/pos/ui/%d" % self .main_pos_config .id ,
1983
- "PosLoyaltyPointsDiscountNoDomainProgramDomain" ,
1984
- login = "pos_user" ,
1985
- )
1949
+ self .start_pos_tour ("PosLoyaltyPointsDiscountNoDomainProgramDomain" )
1986
1950
self .assertEqual (loyalty_card .points , 100 )
1987
1951
1988
1952
def test_points_awarded_specific_discount_code_specific_domain_program (self ):
@@ -2040,11 +2004,7 @@ def test_points_awarded_specific_discount_code_specific_domain_program(self):
2040
2004
discount_product .available_in_pos = True
2041
2005
2042
2006
self .main_pos_config .open_ui ()
2043
- self .start_tour (
2044
- "/pos/ui/%d" % self .main_pos_config .id ,
2045
- "PosLoyaltyPointsDiscountWithDomainProgramDomain" ,
2046
- login = "pos_user" ,
2047
- )
2007
+ self .start_pos_tour ("PosLoyaltyPointsDiscountWithDomainProgramDomain" )
2048
2008
self .assertEqual (loyalty_card .points , 90 )
2049
2009
2050
2010
def test_points_awarded_ewallet (self ):
@@ -2130,11 +2090,7 @@ def test_points_awarded_giftcard(self):
2130
2090
})
2131
2091
2132
2092
self .main_pos_config .open_ui ()
2133
- self .start_tour (
2134
- "/pos/ui/%d" % self .main_pos_config .id ,
2135
- "PosLoyaltyPointsGiftcard" ,
2136
- login = "pos_user" ,
2137
- )
2093
+ self .start_pos_tour ("PosLoyaltyPointsGiftcard" )
2138
2094
self .assertEqual (loyalty_card .points , 100 )
2139
2095
2140
2096
def test_archived_reward_products (self ):
@@ -2191,20 +2147,12 @@ def test_archived_reward_products(self):
2191
2147
self .product_b .active = False
2192
2148
product_c .active = False
2193
2149
2194
- self .start_tour (
2195
- "/pos/ui/%d" % self .main_pos_config .id ,
2196
- "PosLoyaltyArchivedRewardProductsInactive" ,
2197
- login = "pos_user" ,
2198
- )
2150
+ self .start_pos_tour ("PosLoyaltyArchivedRewardProductsInactive" )
2199
2151
current_session_id = self .main_pos_config .current_session_id
2200
2152
current_session_id .post_closing_cash_details (100.0 )
2201
2153
current_session_id .close_session_from_ui ()
2202
2154
product_c .active = True
2203
- self .start_tour (
2204
- "/pos/ui/%d" % self .main_pos_config .id ,
2205
- "PosLoyaltyArchivedRewardProductsActive" ,
2206
- login = "pos_user"
2207
- )
2155
+ self .start_pos_tour ("PosLoyaltyArchivedRewardProductsActive" )
2208
2156
2209
2157
def test_change_reward_value_with_language (self ):
2210
2158
"""
@@ -2243,11 +2191,7 @@ def test_change_reward_value_with_language(self):
2243
2191
loyalty_program .reward_ids .update_field_translations ('description' , {'en_US' : 'A en_US name which should not be displayed' })
2244
2192
2245
2193
self .main_pos_config .open_ui ()
2246
- self .start_tour (
2247
- "/pos/ui/%d" % self .main_pos_config .id ,
2248
- "ChangeRewardValueWithLanguage" ,
2249
- login = "pos_user" ,
2250
- )
2194
+ self .start_pos_tour ("ChangeRewardValueWithLanguage" )
2251
2195
2252
2196
def test_loyalty_reward_product_tag (self ):
2253
2197
"""
@@ -2280,11 +2224,7 @@ def test_loyalty_reward_product_tag(self):
2280
2224
})
2281
2225
2282
2226
self .main_pos_config .open_ui ()
2283
- self .start_tour (
2284
- "/pos/ui/%d" % self .main_pos_config .id ,
2285
- "PosLoyaltyRewardProductTag" ,
2286
- login = "pos_user" ,
2287
- )
2227
+ self .start_pos_tour ("PosLoyaltyRewardProductTag" )
2288
2228
2289
2229
def test_gift_card_rewards_using_taxes (self ):
2290
2230
"""
@@ -2308,11 +2248,7 @@ def test_gift_card_rewards_using_taxes(self):
2308
2248
gift_card_program .payment_program_discount_product_id .taxes_id = self .tax01
2309
2249
2310
2250
self .main_pos_config .open_ui ()
2311
- self .start_tour (
2312
- "/pos/ui/%d" % self .main_pos_config .id ,
2313
- "PosLoyaltyGiftCardTaxes" ,
2314
- login = "accountman" ,
2315
- )
2251
+ self .start_pos_tour ("PosLoyaltyGiftCardTaxes" , login = "accountman" )
2316
2252
self .main_pos_config .current_session_id .close_session_from_ui ()
2317
2253
2318
2254
def test_customer_loyalty_points_displayed (self ):
@@ -2425,11 +2361,7 @@ def test_apply_reward_on_product_scan(self):
2425
2361
'pos_config_ids' : [Command .link (self .main_pos_config .id )],
2426
2362
})
2427
2363
self .main_pos_config .with_user (self .pos_admin ).open_ui ()
2428
- self .start_tour (
2429
- "/pos/ui/%d" % self .main_pos_config .id ,
2430
- "PosRewardProductScan" ,
2431
- login = "pos_admin"
2432
- )
2364
+ self .start_pos_tour ("PosRewardProductScan" , login = "pos_admin" )
2433
2365
2434
2366
# Check that there should be one paid order with reward line and not draft order
2435
2367
current_session_id = self .main_pos_config .current_session_id
@@ -2444,11 +2376,7 @@ def test_apply_reward_on_product_scan(self):
2444
2376
# check the same flow with gs1 nomenclature
2445
2377
self .env .company .nomenclature_id = self .env .ref ('barcodes_gs1_nomenclature.default_gs1_nomenclature' )
2446
2378
self .main_pos_config .with_user (self .pos_admin ).open_ui ()
2447
- self .start_tour (
2448
- "/pos/ui/%d" % self .main_pos_config .id ,
2449
- "PosRewardProductScanGS1" ,
2450
- login = "pos_admin"
2451
- )
2379
+ self .start_pos_tour ("PosRewardProductScanGS1" , login = "pos_admin" )
2452
2380
2453
2381
# Check that there should be one paid order with reward line and not draft order
2454
2382
current_session_id = self .main_pos_config .current_session_id
@@ -2531,11 +2459,7 @@ def test_gift_card_program_create_with_invoice(self):
2531
2459
self .env ['res.partner' ].create ({'name' : 'A Test Partner' })
2532
2460
2533
2461
self .main_pos_config .with_user (self .pos_user ).open_ui ()
2534
- self .start_tour (
2535
- "/pos/ui/%d" % self .main_pos_config .id ,
2536
- "GiftCardProgramInvoice" ,
2537
- login = "pos_user" ,
2538
- )
2462
+ self .start_pos_tour ("GiftCardProgramInvoice" )
2539
2463
self .assertEqual (len (gift_card_program .coupon_ids ), 1 )
2540
2464
2541
2465
def test_refund_product_part_of_rules (self ):
@@ -2561,11 +2485,7 @@ def test_refund_product_part_of_rules(self):
2561
2485
})
2562
2486
2563
2487
self .main_pos_config .with_user (self .pos_user ).open_ui ()
2564
- self .start_tour (
2565
- "/pos/ui/%d" % self .main_pos_config .id ,
2566
- "RefundRulesProduct" ,
2567
- login = "pos_user" ,
2568
- )
2488
+ self .start_pos_tour ("RefundRulesProduct" )
2569
2489
2570
2490
def test_cheapest_product_tax_included (self ):
2571
2491
tax_01 = self .env ['account.tax' ].create ({
@@ -2623,11 +2543,7 @@ def test_next_order_coupon_program_expiration_date(self):
2623
2543
})
2624
2544
2625
2545
self .main_pos_config .with_user (self .pos_user ).open_ui ()
2626
- self .start_tour (
2627
- "/pos/ui/%d" % self .main_pos_config .id ,
2628
- "PosLoyaltyNextOrderCouponExpirationDate" ,
2629
- login = "pos_user" ,
2630
- )
2546
+ self .start_pos_tour ("PosLoyaltyNextOrderCouponExpirationDate" )
2631
2547
2632
2548
coupon = loyalty_program .coupon_ids
2633
2549
self .assertEqual (len (coupon ), 1 , "Coupon not generated" )
@@ -2704,11 +2620,7 @@ def test_physical_gift_card_invoiced(self):
2704
2620
gift_card_program = self .create_programs ([('arbitrary_name' , 'gift_card' )])['arbitrary_name' ]
2705
2621
2706
2622
# Run the tour
2707
- self .start_tour (
2708
- "/pos/web?config_id=%d" % self .main_pos_config .id ,
2709
- "test_physical_gift_card_invoiced" ,
2710
- login = "pos_user" ,
2711
- )
2623
+ self .start_pos_tour ("test_physical_gift_card_invoiced" )
2712
2624
2713
2625
self .assertEqual (len (gift_card_program .coupon_ids ), 1 , "Gift card not generated" )
2714
2626
self .assertEqual (gift_card_program .coupon_ids [0 ].code , "test-card-1234" , "Gift card code not correct" )
0 commit comments