Commit Graph
19 Commits
Author SHA1 Message Date
Jacky (trj) 442f856bb8 [IMP] point_of_sale: opening cash control and closing session in POS UI
The opening cash control has been refactored and the closing of the session is now happening in the POS UI. This also leads to a cash control in the UI during the closing.

The advanced cash control is no longer a setting to activate in the config by the user but a computed field based on the presence of a cash payment method. We force the user to always have it now.

The opening cash control has been revamped with the addition of a new money calculator (`MoneyDetails`) allowing the user to easily compute how much money does he have based on his bills.

The closing control has been converted into a popup which allows the users to get an overview of his session details (about orders, payments, payment methods, cash moves, ...). If the `cash_control` has been set to `True`, the user still needs to count his money by introducing it or using the new calculator.

When trying to close the session, if it fails, depending on the error the user get, he can be redirected to the back end to manually close the session. At this point, the user is not able to open the POS UI.
(In order to fully bring the closing of the session in the front end, all the error handlings need to be brought to the front end as well which takes a lot more time.)

Rescue session can only be closed through the back end and the closing cash control is automatically being computed without the user's involvement. This avoid any cash profit/loss in the journals.

The session chatter is being logged with all the details regarding the opening and closing. This give the user a better view of his cash flow in a specific session.

task-2456424

closes odoo/odoo#73464

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-09-28 09:28:50 +00:00
Joseph Caburnay 92e70b8392 [IMP] point_of_sale,pos_*: refund orders thru POS UI
* Perform refunds in the POS UI.
* Select orderlines and quantity to refund.
* Add refund orderlines in the active order.

closes odoo/odoo#75322

Task-id: 2481561
Related: odoo/enterprise#20358
Related: odoo/upgrade#2753
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-31 17:11:56 +00:00
Joseph Caburnay a2ff6d5383 [IMP] point_of_sale,pos_*: combine ticket and management screens
We are referring to TicketScreen and OrderManagementScreen.
The two screens almost serves the same purpose. There is not much reason
to keep them separate. We combine the two in this commit. Basically,
we remove OrderManagementScreen and its components. Some are kept and
moved to the TicketScreen.

Task-id: 2481404
Part-of: odoo/odoo#75322
2021-08-31 17:11:56 +00:00
Jacky (trj) 629a4f34ea [IMP] point_of_sale: Added customer_note on order lines
In some use cases, the seller in point of sale needs to add a note on an
order line that has to be displayed on the receipt. So we've added a
field on the order line to set a note.

The note is also set on the invoice if the order is invoiced.

closes odoo/odoo#71598

Task-id: 2556994
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-08-03 06:16:37 +00:00
Jacky (trj) 13843f8545 [IMP]: point_of_sale UI: NumberPopup and NumberBuffer can pre-select input which will change the value upon triggering a key
The user doesn't need to delete the current input before changing it. He can now write
hiw new value which will erase the current one.
The guest popup from the `pos_restaurant` module and the global discount popup from the
`pos_discount` module benefit from this and have their input pre-selected.

Before: when opening the guest or discount popup, the user always has to delete the curent
value before changing it. Let's say that the current value was `5`, the user needs to either
press the `Delete` or `Backspace` button/key before entering his new value.

After: the user doesn't need to press the `Delete` or `Backspace` button/key and can now directly
enter his new value

Task ID: 2419637
2021-02-25 09:47:50 +00:00
Joseph Caburnay 85b9dbaa45 [FIX] pos_restaurant: order remained after deletion
There is a situation in pos_restaurant such that when an order
is deleted from the ticket screen, it persists to show when the
table is opened. To reproduce:

1. Create an order in T1 then add items to it.
2. Get out of the table (back to floor).
3. Open ticket screen.
4. Delete the order in T1.
5. Close the ticket screen.
6. Open T1, the order is still there (bug).

This commit fixes this behavior such that in step 6, new order should
show and not the deleted order.

Note that we also made a change in the template in order to allow
checking the number of synced orders during testing. We want to make
sure that the table is clicked when the sync finishes to prevent
concurrency issue during testing.

closes odoo/odoo#62488

X-original-commit: e6e2a7392a5dd518c3f0df1c1ac0f90b0cba78f4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-11-27 09:30:03 +00:00
Joseph Caburnay fd4a42a7d6 [FIX] pos_restaurant: remove ambiguity to prevent runbot error
This random runbot error happens when the tour manager is steps ahead of
the rendering:
1. clicks Second Floor button
2. checks T1 - this won't fail even if the Second Floor hasn't finished
rendering because Main Floor has tables that start with `T1`.
3. clicks a table in Main Floor with T1 in name
4. Then error because the back to floor button should be Second Floor.

Tables that start with `T1` is created in Main Floor during the tour,
however, we also have one in Second Floor. To make sure that the runbot
correctly waits and clicks for the right table, we use T3 in Second
Floor instead of it's T1.

closes odoo/odoo#59170

X-original-commit: 8e65a220cadefe41df9fcc2172d60ff90ea5b584
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2020-10-06 06:25:36 +00:00
Joseph Caburnay 0cf51928ac [FIX] pos_restaurant: runbot random error on clicking table
Checking the log of the runbot error, there is an extra `create_from_ui`
rpc call for `restaurant.floor`. This is because when table T4 is clicked,
it is still an `EditableTable`. It is possible that the full rendering after
toggling edit mode isn't complete and the tour proceeds because it sees
table T4 in the dom, when in fact the table we want to click should not be
`EditableTable` instead a `TableWidget`. This is random because the tour
may proceed as long at it sees the trigger element, even if the owl
rendering is not finished.

In this commit, we make sure that we click the correct element which is an
unselected table. So we check if table T4 is unselected before clicking
table T4 to open the product screen.

To reproduce, follow instructions here: https://gist.github.com/caburj/ef311076a24d898132ed9c6b99367581

closes odoo/odoo#58151

X-original-commit: 238a65f59202d279d2c9327dd7937f125d80175b
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-09-21 14:42:20 +00:00
Joseph Caburnay cab75e7969 [FIX] pos_restaurant: order management screen random runbot error
Initial rendering of order management screen shows the list of orders
based on the previous render. This is done so that during fetching of
new orders from the server, a list of orders are already shown.

This optimization causes a random runbot error when transferring an
order from one table to the other. The moment the order management
screen is open, it will render orders with the old table, but right
after fetching of orders, the listed orders are immediately updated.

To rectify the random error, we modify the test so that instead of
immediately clicking the transferred order, we wait for its new table
to show before selecting it.

closes odoo/odoo#57104

X-original-commit: 713dd3777ca0ce9d121d5162a3d63de3237509f4
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-09-04 14:27:25 +00:00
Joseph Caburnay a654fdf839 [FIX] pos_restaurant: check product screen, not floor screen
After clicking a table, ProductScreen should show, not FloorScreen.

closes odoo/odoo#57025

X-original-commit: 0a9f6f81525b12e6e3b30eb6d875c8f36db509ee
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-09-03 11:36:40 +00:00
Joseph Caburnay d8e210e8e1 [FIX] point_of_sale,pos_restaurant: remove step_delay in pos test tours
Tours with `step_delay` potentially hide errors because of missing tour steps.
This is mainly caused by unfinished renders within the `step_delay` between
two steps. It is possible that the render after the 1st trigger is not yet
finished but the 2nd step trigger already existed in the screen. Because the
render result of 1st step is late and the 2nd step is already triggered, the
3rd step will fail. Note that the 3rd step will occassionally fail because
render of the 1st step is most of the time faster than step_delay but
there is no guarantee that the render is always faster because of occassional
cpu slow downs.

Runbot will eventually catch these tour errors which it did with the ticket
screen tour.

In this commit, we removed the `step_delay` in the pos tours. We also
supplemented the missing step in the ticket screen tour which was the cause
of random runbot error when there was `step_delay`.

We also figured that value property of input element is not observed by the
tour service's mutation observer, which result to an indeterministic error
in a step in tip screen. To fix this, we introduce an attribute to the input
element which is used in the step trigger.

closes odoo/odoo#56961

X-original-commit: 2ef73bb64cd0730d1e078a47f2ea9e1290b0df6c
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Joseph Caburnay (jcb) <caburj@users.noreply.github.com>
2020-09-02 13:56:44 +00:00
Antoine Prieels 3f138b9d3c [IMP] point_of_sale, pos_*: Enable HTTPS in POS
HTTPS had been disabled on SaaS to allow the use of the IoT Box that
had no valid SSL certificate. As of V13.0, IoT Boxes connected to
Enterprise DBs have a valid certificate. POS can then use HTTPS.

Nginx is configured to redirect all requests to `/pos/web` to HTTP,
so we change the POS URL to `/pos/ui`, except when using a Six
payment terminal as it only works in HTTP.

closes odoo/odoo#56933

Taskid: 2191878
X-original-commit: 8aee4992778fee5e2f146c4cff8b35e83c7f56b3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Antoine Prieëls <aprieels@users.noreply.github.com>
2020-09-02 10:53:34 +00:00
Joseph Caburnay 7f06412484 [FIX] point_of_sale,pos_restaurant: tipping workflow
This commit fixes the tipping workflow. It includes the following changes:
1. Instead of directly setting tip when clicking a tip amount in tip screen,
we set the input amount to that selected tip. Then we introduce validate
validate button to confirm setting of tip.
2. The tip screen is only shown for non-cash payments. This behavior can be
overridden in extension module in cases where the showing of the tip screen
is only available for certain type of payments.
3. We introduce a way a settle tips for multiple orders in the ticket list.
When the user filters by 'Tipping' status, an editable tip-amount column
appears which can be editted for each order. When tip amounts are final,
settle button will set tip for each order in tipping status.

closes odoo/odoo#56198

Task-id: 2322683
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-21 10:41:49 +00:00
Joseph Caburnay 96e27f0900 [FIX] point_of_sale,pos_*: indeterministic tour tests failures
closes odoo/odoo#56062

Related: odoo/enterprise#12487
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-19 07:34:04 +00:00
Joseph Caburnay b0107e9230 [IMP] pos_restaurant,point_of_sale: set tip after payment
1. Introduce an option in restaurant config to allow setting tips after payment.
2. Tip form is shown in bills so the customers can choose/set their tips.
3. Validated orders are kept in TipScreen (access via TicketScreen) so that at the
end of the day, the user/cashier can set the tips for each validated order.

closes odoo/odoo#55488

Task-id: 2117029
Related: odoo/upgrade#1606
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-12 09:17:34 +00:00
Joseph Caburnay 9ea0aca6ea [IMP] point_of_sale,pos_*: top bar improvements and ticket list
The following changes are made in this task:

1. Remove order tabs and replace with ticket list.
2. Top bar color change.
3. Search bar in the product screen is moved in the top bar.
4. List of sub-categories are now in the same line as the category
breadcrumbs.

closes odoo/odoo#55100

Task-id: 2276678
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-08-05 13:35:08 +00:00
Joseph Caburnay b2f8170d88 [IMP] point_of_sale,pos_*: allow users to manage orders in the pos frontend
We now allow invoicing of finalized orders in an open session in this first
iteration of order management in the pos frontend. Additionally, receipt
reprinting is also introduced. With this feature, we can now reprint the
receipt of old orders.

closes odoo/odoo#51141

Task-id: 1981354
Related: odoo/enterprise#11690
Related: odoo/upgrade#1472
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-17 10:00:04 +00:00
Joseph Caburnay 800fa0812a [FIX] pos_restaurant: split bill screen responsive
The layout of the split bill screen is broken after the responsive pos ui.
This fixes the split bill screen and make it also responsive.

New classes are introduced because reusing proved to be very difficult.
One benefit of declaring a new classes (then styling them) is that we can
target the particular elements that we wanted to change without the concerns
that another elements are changed.

closes odoo/odoo#54529

X-original-commit: 51f0c6a1be912192d910d47b79ac2cb3c5b42784
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2020-07-15 15:29:11 +00:00
Joseph Caburnay d8726778b6 [REF] pos_restaurant: migration to OWL framework 2020-05-12 12:48:58 +00:00