Tuesday, September 19, 2023
1 change
Code cleanup and technical improvements
The point-of-sale order view has been standardized across key screens, reducing duplicated behavior and making future updates more reliable. This also improves consistency for staff using product, ticket, split bill, and related POS flows.
Original PR description
At the moment, the pos displays the selected order in multiple screens, such as the `ProductScreen`, the `TicketScreen`, the `SplitBillScreen`, the `self_order` app, but uses completely different…
At the moment, the pos displays the selected order in multiple
screens, such as the `ProductScreen`, the `TicketScreen`, the
`SplitBillScreen`, the `self_order` app, but uses completely
different implementations for each. This means that when
a change needs to be made to the one, it generally needs to be made
to the other as well, which is error-prone.
In this commit we create generic `OrderWidget` and `Orderline` components,
that have not dependencies on POS objects and we refactor the `ProductScreen`,
the `TicketScreen` and the `SplitBillScreen` to use these components.
The `OrderSummary` component was removed and it's contents are now in the
`OrderWidget`.
We also introduce a very simple new component called `CenteredIcon` that
can be used whenever we want to show an icon that fills a whole div. In this
commit we use it for showing the cart icon when the order is empty.
In a future commit, the `pos_self_order` will be refactored in order
to use the same `OrderWidget` and `Orderline` compoenents as the POS.
Task: 3470365
In addition, this commit solves the issue from the task 3491303.
https://github.com/odoo/odoo/pull/132248