-
Notifications
You must be signed in to change notification settings - Fork 114
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
[IMP] pos_customer_display: UI Improvements #2992
[IMP] pos_customer_display: UI Improvements #2992
Conversation
This PR targets the un-managed branch odoo-dev/odoo:master-pos_customer_display_standalone_app-vlst, it needs to be retargeted before it can be merged. |
e609574
to
0654976
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work, it looks really nice ! I left some comments for you 👍
0654976
to
73741ab
Compare
73741ab
to
09ad5fa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a small comment, but overall LGTM !
09ad5fa
to
bd782b1
Compare
a5aaf5d
to
c63513a
Compare
The function `getDisplayData` from the `Orderline` class in `models.js` is responsible for the data that the `Orderline` component needs. This data mostly consists of simple objects and primitives. This is useful because it makes the object more portable, for example it can be used with the *Broadcast Channel API*. The problem is that some keys have been added to the object returned by `getDisplayData` whose values are proxy objects. In this commit we simplify the function such that all the values in the returned object are simple objects. This is very usefull for the folowing commit, where we actually use Broadcast Channel API.
In this pr we refactor the customer display code from pos such that the customer display now becomes it's own standalone owl app. Before, the pos app would generate all the html code for the customer display and it would send this text to the customer display window or to the iot box. This approach was messy and wasteful, as all the data would have to be resent for each change in the order. ( for example if the order consisted of 10 items, each with an image, the pos would render all the html and would send all the 10 images again for just an increase in the quantity of one of the orderlines ) Now, the pos just sends the order details ( product names, quantities, etc. ) and the customer display owl app handles the rendering. This massively simplifies the code and also allows reusability of components between the pos and the customer display. Depending on the configuration, the pos sends the data in the following ways: - Config local: broadcast channel api - Config remote: the pos calls a rpc method on the server and this rpc sends a websocket notification to the customer display - Config proxy: the pos sends a http request to the iot box on the local network; with the new implementation, the amount of data that is sent from the pos browser window to the iot box is immensely diminished. For each change in the order, the pos sends the new order data, but now sends aprox 15 times less data for each change. This is due to the fact that we now only send the actual order data ( an object containing product names, quantities, etc ) instead of the full html representation of the customer display. ( as an example, for an order with 10 items, we now send 3kb of data instead of 47kb ) Task: 3684195
c63513a
to
6d32ef6
Compare
bd782b1
to
c37319c
Compare
When you have time, could you please check this one @stefanorigano |
1103d42
to
a9d5cbf
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello @xlu-odoo , thanks for you work 👍
Code is mostly ok, but I think that the design needs to be reviewed.
I wrote some remarks in the code, but it would be better to iterate a bit on Figma first and apply the design once it's confirmed.
Thanks!
<div class="d-flex align-items-center ps-3 pe-2 py-1 rounded-3 text-bg-dark small">Powered by <OdooLogo style="'width: 3rem;'" monochrome="true"/></div> | ||
</div> | ||
<div class="o_customer_display_main d-flex flex-column flex-grow-1 overflow-auto"> | ||
<div t-if="!order.finalized and order.lines?.length" class="d-flex px-4 py-1 text-bg-dark"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<OrderWidget t-if="!order.finalized" lines="order.lines" t-slot-scope="scope" style="'background-color: #f6f6f6;'"> | ||
<Orderline line="scope.line" class="'bg-white mx-3 my-1 rounded-3' + (scope.line.isSelected ? ' selected' : '')"/> | ||
<OrderWidget t-if="!order.finalized" lines="order.lines" t-slot-scope="scope" class="'bg-300'" style="'scroll-snap-type: y mandatory;'"> | ||
<Orderline line="scope.line" imgSize="'4rem'" infoListClasses="''" class="'o_customer_display_orderline d-flex align-items-center mx-2 my-1 ps-1 pe-3 rounded-3 bg-white fs-3' + (scope.line.isSelected ? ' selected' : '')"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f5b9146
to
a312fe5
Compare
61c1c3f
to
8eb756e
Compare
c37319c
to
6de7286
Compare
7b68786
to
6132171
Compare
6de7286
to
29f4579
Compare
9884568
to
e500258
Compare
29f4579
to
7b32a38
Compare
Prior to this commit, following recent changes integrating Bootstrap to the customer display, the layout was lacking refinement and required a layout overhaul. This update addresses and improves the UI. task-3773289
7b32a38
to
7553468
Compare
Prior to this commit, following recent changes integrating Bootstrap to
the customer display, the layout was lacking refinement and required a
layout overhaul. This update addresses and improves the UI.
task-3773289
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr