odoo/odoo#194666

Created by Bugfix, Sarah Bellefroid (sbel)
Merged at 40b819ded20f769b0a63b73abfefebbdaca390df

Statuses:

label
odoo-dev:18.0-opw-4435140-closing_session_numbers-sbel
head
53f7c7d5cce95864f4d2803fac8799ac2c7556ac
merged
8 months ago by POS IoT, Joseph Caburnay (jcb)
odoo/odoo
18.0 #194666
saas-18.1 #200589
saas-18.2 #201046
saas-18.3
saas-18.4
19.0
master #201148

[FIX] point_of_sale: start order tracking number at 1

Currently, when you make a os order, close the session an then re-open it without going through the backend, the starting tracking number is related to the previous session.

Steps to reproduce:

  • Open pos shop
  • Make an order and pay it
  • Select New order
  • Close the session, do not go in the backend
  • Re-open the session
    > Observation: The tracking number is like X03. If we make an order,
    the tracking number will then be (X+1)01.

Why the fix:

When closing the register the current order is marked as cancelled and a reloading of the page is done. When reloading, the onMounted of the product screen is triggered which creates a new order.

We will condition the effect of the onMounted in a useEffect so that we don't create new orders when we are closing the session.

opw-4435140