[FIX] point_of_sale: prevent sequence jump when loading the paid orders
Before this commit: the order sequence jumped if the paid orders from previous sessions were loaded. Steps to reproduce the issue: 1. Open a POS session and create some orders 2. Close the session and open a new one 3. Open the ticket screen, and filter paid orders 4. Click the new order button => the sequence jumps equal to the number of loaded paid orders The solution is not to increase the sequence if it is loading the paid orders. opw-2979271 closes odoo/odoo#100906 X-original-commit: f948b2eb8273f28ba3a30307a626ec469c3625a2 Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com> Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit is contained in:
@@ -2329,7 +2329,9 @@ class Order extends PosModel {
|
||||
*/
|
||||
init_from_JSON(json) {
|
||||
let partner;
|
||||
if (json.pos_session_id !== this.pos.pos_session.id) {
|
||||
if (json.state && ['done', 'invoiced', 'paid'].includes(json.state)) {
|
||||
this.sequence_number = json.sequence_number;
|
||||
} else if (json.pos_session_id !== this.pos.pos_session.id) {
|
||||
this.sequence_number = this.pos.pos_session.sequence_number++;
|
||||
} else {
|
||||
this.sequence_number = json.sequence_number;
|
||||
|
||||
Reference in New Issue
Block a user