Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

10.0 pos ms issues 3 #1035

Merged
merged 4 commits into from
Jun 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🚑 order loss for multiple multisessions working at the same time
  • Loading branch information
KolushovAlexandr committed Jun 25, 2019
commit 07425500a391b4a58418439556a1690e8b578228
1 change: 1 addition & 0 deletions pos_multi_session_sync/doc/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
`1.0.5`
-------
- **Fix:** Cross multi-sesion messaging in case the same pos was assigned to a different multi-session
- **Fix:** Possible loss of orders for multiple multi-sessions working simultaneously when another new one starts

`1.0.4`
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def prepare_new_session(self, message):
self.write({
'run_ID': run_ID,
})
old_orders = self.env['pos_multi_session_sync.order'].search([('state', '=', 'draft'),
old_orders = self.env['pos_multi_session_sync.order'].search([('multi_session_ID', '=', self.multi_session_ID),
('state', '=', 'draft'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

('run_ID', '<', run_ID)])
if old_orders:
old_orders.write({'state': 'unpaid'})
Expand Down Expand Up @@ -165,7 +166,7 @@ def set_order(self, message):
order = order.create({
'order': json.dumps(message),
'order_uid': order_uid,
'multi_session_ID': self.id,
'multi_session_ID': self.multi_session_ID,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

'run_ID': run_ID,
'nonce': message['data']['nonce']
})
Expand Down Expand Up @@ -211,8 +212,8 @@ def get_sync_all(self, message):
orders.append(msg)
else:
for order in self.env['pos_multi_session_sync.order'] \
.search([('multi_session_ID', '=', self.id), ('state', '=', 'draft'),
('run_ID', '=', run_ID)]):
.search([('multi_session_ID', '=', self.multi_session_ID), ('state', '=', 'draft'),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

('run_ID', '=', run_ID)]):
msg = json.loads(order.order)
msg['data']['message_ID'] = pos.multi_session_message_ID
msg['data']['revision_ID'] = order.revision_ID
Expand Down