-
-
Notifications
You must be signed in to change notification settings - Fork 583
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for ms [IMP] Added "Multi-session Settings" form, [CI] Added unittests, [DEMO] Added unsynchronized POS in Demo, [IMP] added search function for computed field current_session_state, for msr [DEMO] Added floor for unsynchronized POS in Demo [IMP] IMP POSes in Multi-session have one common floor set. Unsynchronized POSes may have its own floor set.
- Loading branch information
1 parent
7f2d8aa
commit 338804a
Showing
16 changed files
with
167 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
Sync POS orders across multiple sessions | ||
======================================== | ||
|
||
The module synchronize orders data between POSes related to a common multi session. Longpolling provides instant updates between POSes in a multi session. | ||
|
||
All work data is stored on server. Offline POS is only able to create new orders, after connecting a POS back, data will be synchronized. | ||
|
||
POSes are able to work without synchronization, like without the module. | ||
|
||
Tests: `<external_tests/README.rst>`__ | ||
|
||
Tested on Odoo 10.0 5a3c43b480b404ca660fe2b0860e0a1572c08017 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<odoo> | ||
<data> | ||
|
||
<record id="multi_session_form" model="ir.ui.view"> | ||
<field name="name">pos.multi_session.form</field> | ||
<field name="model">pos.multi_session</field> | ||
<field name="type">form</field> | ||
<field name="arch" type="xml"> | ||
<form> | ||
<sheet string="Multi-session"> | ||
<label for="name" class="oe_edit_only"/> | ||
<h1><field name="name"/></h1> | ||
<group string="Settings"> | ||
<field name="pos_ids" widget="many2many_tags" domain="[('current_session_state', '!=', 'opened')]" options="{'not_delete': True}"/> | ||
<field name="order_ID" readonly="1"/> | ||
<field name="order_ids" readonly="1"/> | ||
</group> | ||
<group> | ||
<p class="oe_edit_only"> To remove or add a POS to multi-session close its session first </p> | ||
</group> | ||
</sheet> | ||
</form> | ||
</field> | ||
</record> | ||
|
||
<record id="action_multi_session_form" model="ir.actions.act_window"> | ||
<field name="name">Multi-sessions</field> | ||
<field name="res_model">pos.multi_session</field> | ||
<field name="view_type">form</field> | ||
<field name="view_mode">tree,form</field> | ||
</record> | ||
|
||
<menuitem id="menu_pos_ms_settings" name="Multi-session Settings" parent="point_of_sale.menu_point_config_product" sequence="25" action="action_multi_session_form" groups="base.group_system"/> | ||
|
||
</data> | ||
</odoo> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# -*- coding: utf-8 -*- | ||
from . import test_test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import odoo | ||
from odoo import fields | ||
from odoo.tools import float_compare, mute_logger | ||
from odoo.tests.common import TransactionCase | ||
# from odoo.addons.point_of_sale.tests.common import TestPointOfSaleCommon | ||
|
||
@odoo.tests.common.at_install(False) | ||
@odoo.tests.common.post_install(True) | ||
class TestPoSSessionState(TransactionCase): | ||
|
||
def test_current_session_state(self): | ||
|
||
self.pos_config = self.env.ref('point_of_sale.pos_config_main') | ||
|
||
# I click on create a new session button | ||
self.pos_config.open_session_cb() | ||
opened_session_pos = self.pos_config.id | ||
|
||
# Check that this session state is opened | ||
self.assertEqual( | ||
self.pos_config.current_session_state, 'opened') | ||
|
||
# _search_current_session_state function check | ||
poses_with_opened_sessions = self.env['pos.config'].search([('current_session_state', '=', 'opened')]) | ||
poses_with_not_opened_sessions = self.env['pos.config'].search([('current_session_state', '!=', 'opened')]) | ||
third_case = self.env['pos.config'].search([('current_session_state', '>', 'opened')]) | ||
# Checking next cases: operator = '=', operator = '!=' and contradictory case | ||
self.assertIn( | ||
opened_session_pos, poses_with_opened_sessions.ids) | ||
self.assertNotIn( | ||
opened_session_pos, poses_with_not_opened_sessions.ids) | ||
self.assertEqual( | ||
len(third_case), 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters