fb6d300a6e83fafe97002f34fbe0ec00a77248aa
4
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
fa111d449d |
[IMP] point_of_sale,*pos*: configure pos from general settings
Purpose: - Move PoS settings in general settings to be consistent with the rest of Odoo (PoS being the only app where settings are split in two locations) - Clean settings by enabling obvious settings or dropping unnecessary ones. closes odoo/odoo#84719 Task-id: 2753430 Related: odoo/upgrade#3260 Related: odoo/enterprise#24425 Signed-off-by: Masereel Pierre <pim@odoo.com> |
||
|
|
8fb53c53c3 |
[REF] point_of_sale,*pos*: remove Backbone.js, single loading request
This commit accomplishes multiple objectives: 1. Loading of model data for the POS UI is now done in single request (with some exemptions). 2. Backbone.js is removed and is replaced by reactivity.js authored by the js framework team. 3. Better organization of assets in the `__manifest__.py` Data Loading ------------ One request per model -- that's always been how the data is loaded in POS UI. Now, we move the aggregation of data to the backend which simplified the data loading. In the frontend, data loading is initiated in `load_server_data` which makes the single rpc call to the `load_pos_data` defined in `pos.session` model. There remains some rpc calls during loading but the number is greatly reduced. This change result to faster loading of the POS UI. However, there is no more progress bar during the loading. Notable entry points: - .js: `PosGlobalState.load_server_data` - .py: `pos.session.load_pos_data` It is possible to make customizations in the loading, but is done in several steps: 1. Override `_pos_ui_models_to_load` to include the new model to load. 2. Define `_loader_params_<model_name>` to define the `search_params` and optional `context`. 3. Define `_get_pos_ui_<model_name>` to return the data that will be included in the full `loaded_data`. Perform the organization in this method whenever necessary. 4. Override `_pos_data_process` for further post processing. The final form of `loaded_data` in this method will be sent to the frontend. Removal of Backbone.js ---------------------- POS is no longer dependent from `Backbone.js`, but it's replaced by a new dependency -- `reactivity.js`. It's invented by the js framework team which will be available in owl v2. The consequences of this change are the following: 1. The old `PosModel` is renamed to `PosGlobalState`. 2. The name of the other models are kept (except Paymentline which is renamed to Payment). 3. The name `PosModel` is now used as the base model of the data models. This is symmetric to our use of `PosComponent`. 4. The instance of `PosGlobalState` is made reactive in `Chrome` (the root component). As a result, whatever mutation made in that instance, `Chrome` will rerender. But rendering is batched so multiple mutations in a single sychronous function call will only result to a single render call. 5. `PosModel`s can be extended in the `Registries` the same way as we extend the `PosComponent`s. ```js // E.g. Registries.Component.extend(Chrome, PosResChrome); Registries.Model.extend(Order, PosResOrder); ``` Reorganization of assets declaration ------------------------------------ This is a simple change that replaced the explicit enumeration of loaded .js and .xml files. Also, we now have regions in the manifest separating: 1. Augmentations of dependencies 2. Assets for `point_of_sale.index` 3. Assets for the qunit test (soon will be improved) Other notable changes --------------------- - Automatic call to `Order.save_to_db` is batched. - Instances of `devices.DeviceProxy` (`proxy`), `devices.JobQueue` (`proxy_queue`) and `BarcodeReader` (`barcode_reader`) are moved to `point_of_sale.env`. Together with `posbus` and `posMutex` (previously `flush_mutex`). - `ActivePrograms` is now passed a props. - `cashier` is no longer saved to `localStorage`. - `pos_cache` is overhauled. - `cache` is taken out from `PosDB` to prevent infinite rendering loop whenever `cache` is mutated. It's now called `CACHE` in the `db.js` file. - reactive version of `posmodel` is exposed globally when in debug mode. This means that calling when calling a mutator, the UI will react. - Added control buttons in the `ProductScreen` is sorted during `Chrome` setup. As a result, we don't need to worry on the loading order of the control buttons components. - Model can be simply instantiated using `BaseModel.create(obj)`. This takes into account the extensions. - `pos_coupon`: rewards are now updated whenever set_order is called. - Component unit tests were removed. It wasn't useful and it just blocks the development. We'll be introducing better unit testing later. closes odoo/odoo#82461 Related: odoo/enterprise#23344 Signed-off-by: Masereel Pierre <pim@odoo.com> Co-authored-by: Jacky (trj) <trj@odoo.com> |
||
|
|
f72a016389 |
[FIX] pos_hr: barcode and pin code access rights
Since groups added on fields 'barcode' and 'pin' on hr employee in
rev:
|
||
|
|
f14092cbfa |
[IMP] point_of_sale: Connect with Employee on PoS
=========
PURPOSE
=========
{Any employee can work on a PoS session, even if he has no user. This decreases the cost of PoS App.}
We are not competitive enough on the PoS Market because customers have to pay one user per cashier while they expect to pay one user per cash station.
===============
SPECIFICATIONS
===============
pos.config
- Add a checkbox : "Login with Employees"
- If set to TRUE, an "Allowed Employees" many2many appear
- If employees many2many is empty, all employees can log on this PoS
- If set to FALSE, can only log in with the currently logged user
hr.employee
- The barcode and pin fields were be moved to the hr.employee
- Set a barcode (not pin) by default at the creation of any employee
- No Employees module with PoS > dependency to hr
Open the PoS if "Log in with Employees" = FALSE
- Same behaviour than now, when I open the PoS, I'm logged in with the current user and can start working at once. The only difference is that it is not possible to switch users anymore.
- The button to close the session is visible
Open he PoS if "Log in with Employees" = TRUE
- When I open the PoS, the first screen I see is the login screen.
(a) I choose my employee and enter my pin code (if there is pin code on my employee, otherwise not required) (I can only see employees that have access to that PoS)
(b) I scan my barcode
(c) I scan my rfid card (future development)
- When I click on the employee name, I can log in with another employee
- If the employee is linked to a user that has the pos user/manager access right, I can see the button the close the session. Otherwise I cannot close the session (and thus cannot access backend).
- Add field employee on all records created by PoS (and replace the field user by that one) (on pos.orders)
Lock Screen
- Improve the PoS Interface
- Add a new feature to allow to "lock" the session. When a session has been locked, the user/employee has to re-log-in to access the PoS
- When I try to re-log-in, by default suggest the last employee logged in in the login screen
Migration
Plan a migration strategy > barcode and pin is now on the employee and not on the user anymore
closes odoo/odoo#28567
|