All lunch locations were showing regardless of the company the user is
logged in.
Now only the lunch locations of the current company are showing.
closesodoo/odoo#81603
Taskid: 2710417
X-original-commit: 3e87770bb8faf2a58ba0b429148f64256537a4da
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Remove t-raw of alert messages:
* Add alert testing to one of the existing tests.
* Transform widget data straight in `_fetchWidgetData` so the widget
itself only ever sees the "proper" shape of things (to come), this
includes the existing parsing and reformatting of `wallet`, as well as
the new wrapping of all alerts' `message` in a `Markup`.
Note: conditional updating of `alerts` because while the endpoint
actual always sets it, test data doesn't necessarily do so (?).
The previous work on adding support for native JS modules needs to adapt
some existing files, which have an incompatible name (with a '/').
Also, we convert a few JS file in /web to the native JS module system,
to show that it can work.
Part of PR 63177
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Before this commit, the return value of some of the dispatch actions of
the lunch model extension was wrapped inside a promise with the use of
the "async" keyword. This caused the synchronous aspect of all these
methods to be delayed.
Now they are not longer asynchronous.
Conversion of the lunch kanban model to a proper search extension.
Now that the view search model supports model extensions, it has become
more convenient to provide additional domain informations by appending
new extensions.
This is why the lunch "location" logic (locationId and userId) has been
shifted to a new model extension ("Lunch Model Extension") which
provides an additional domain part to the other search extensions.
Part of task 2228968
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Some changes in AbstractModel have been done to ease the
implementation of the sample data feature. This commit reverberates
those changes in other addons.
Part of task 2232801
X-original-commit: dd8069a3c80570e7fa03a80dbb100ab0a182692a
- Move code from kanban view that is common with list view in common files
- Add action to add selected products to cart
- Add/update tests
closesodoo/odoo#47556
Taskid: 2160048
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the SearchPanel widget was given a single unified domain coming
from the view/controller. The issue was that some modules injected additional leaves
in this domain and there was no way to remove them/separate them from the original
view/controller domain.
Now, another paramater (the `viewDomain`) is given to the SearchPanel, containing
the distinct domain related to the view. The Lunch module has been adapted to give
the `location` domain through this new key.
Note that some tests steps had to be inverted since the method retreiving the
domain of the view/controller is asynchronous (needed by Lunch to give time to the
model to be loaded). It mainly concerns the RPC order which does not matter in this
case.
Task 2239706
closesodoo/odoo#49720
X-original-commit: e895e553899933be14c8abfd8c676b44a7f534d8
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
There are too many image sizes. Since they are stored resized this takes time to
generate when saving a new image, it's more rows on the attachment table, more
files on the disk, ...
64px is close enough to 128px that it can be removed without a big impact on
download size.
It will even reduce download and number of requests when both images are
displayed because now only one has to be downloaded and then benefit from cache.
The difference between the two is typically around 1.5kB which is negligible
these days, especially when the request overhead is around 0.5kB already, not
even taking into account other factors such as latency.
If a 64px image must absolutely be returned, it is still possible to pass the
size parameters to the image route. But the current guideline is to handle
resizing in the views when necessary.
Views
=====
- remove width and height attributes when existing CSS rules are overriding them
(eg. `.oe_kanban_avatar` in the right context)
- add CSS rules instead of width and height attributes when possible
- use `object-fit: cover;` where width and height are forced to avoid distortion
of non-square images
- for products, use `object-fit: contain;` instead, keep ratio but without crop
- add new CSS rules where the expected size was max 64px*64px before due to the
image size itself
- remove `img-fluid` where using size classes to avoid conflicting rules
task-2060865
closesodoo/odoo#36147
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
In case the last location of a user was NULL in databse, lunch was
crashing because lunch_kanban was adding an undefined leaf to the load
domain.
closesodoo/odoo#36571
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The default image for the lunch product should be the one from the
category (added an image on the categories).
In case there is no image either on the product either on the category,
in the kanban view there should be a specific image (fork and knife
image)
Added some data in order to always have something displayed in the
kanban view
Fixed the layout of the dashboard
Bug fix, in `_check_wallet` there was a flush missing
Bug fix, `product_id` should be a many2one, not an integer field and the
orm should be used in order to avoid problems when favoriting products
This is a back2basics task
Task 2048246
closesodoo/odoo#35632
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Open the Lunch kanban view
Before this commit, the counts for each product were the counts
across all location
This was before the location domain from the lunch widget was not sent
After this commit, the counts displayed on startup are the ones
of the right user location
OPW 2053044
closesodoo/odoo#35976
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
- On mobile grouping by a field crashes.
This is due to the code assuming a function parameter
is always passed where it is actually an optional parameter.
closesodoo/odoo#33891
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
- Reorganize configure your order screen
- Alert users through chat: Alerts can now be configured to
send a chat message to the employees.
- Replace toppings by extras
closesodoo/odoo#34470
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
SearchPanel widget in kanban views has been introduced in commit
https://github.com/odoo/odoo/pull/30517/commits/25c9355c02485e85914430188f3281246fc54cda.
But this feature was disabled for mobile.
This commit removes unneeded differentiation between desktop and mobile
for the SearchPanel.
It also adapt related tests to reflect this change.
Task ID: 1917277
This module didn't worked on mobile: user cannot select the products or
see their cart.
This commit reworks the LunchKanbanWidget template and introduces a
dedicated template for mobile. This template introduces a button at the
bottom of the screen to toggle the "cart" widget on mobile (hiding it by
default).
It tries to make the best use of the existing Bootstrap classes allowing
to have a more responsive layout and reducing the custom CSS required by
this module (both in desktop and in mobile).
This commit adds a decent JS tests-suite (mobile & desktop) to this
module as the existing one left substential parts of the UI untested
(opening wizard when clicking on a kanban record, cart's lines content,
clear cart button, widget structure and content based on the state...).
Those tests are also less based on DOM nodes order/tag names and use
instead dedicated classnames.
It also modifies the LunchKanbanRecord click handling to had a dedicated
event handler instead of overriding the default _onGlobalClick() and
make it more testable.
Task ID: 1945032
The Widget's init function is synchronous.
The 'then' will execute after the end of the function so
self.group_portal_id will not be set immediately.
Also, RPC's in the init function is really not a good idea, it should be
putted in the willStart.
Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13closesodoo/odoo#31508
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Installing the 'lunch' module add css rules to the generic list view
styling, modifying the styling of all the list views by the simple fact
of being installed.
The goal of those rules is that in list view a table cell with the
o_text_overflow class should still be displayed as a table-cell (and not
a block/inline-block).
Without the lunch module a list view's cell with the o_text_overflow
class is narrower and break the alignment between this column and the
headers.
This commit moves the necessary rule (display property) to the web
module and apply them globally.
Remark: module's css rules shouldn't override globally the one from
'web'.
Original commit: https://github.com/odoo/odoo/commit/855c6dac25fccaf9312543022001ed0b360d6e13closesodoo/odoo#31506
This rev. updates the 'New order' kanban view to make it use a
searchPanel.
Minor changes on the custom lunch_kanban view were necessary to
- obtain the desired layout,
- correctly combine the lunch widget (top bar) domain with the
searchPanel domain.
Part of task 1892462
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
We would like to automatize lunch as currently all orders are manually ordered and validated,
and a cash move has to be manually created each time you want to credit the wallet of some user.
1/ In this commit we add a new widget that comes with the kanban view
and will allow to take orders in a friendly manner.
2/ We also add a lunch.supplier model this also allows you to configure an
automatic ordering via email.
3/ Introduces new lunch.location model to replace res.partner on suppliers
4/ New mail template for automatic ordering
5/ Add the concept of new products (mark a product as new until some date)
6/ The toppings are now defined by product category
7/ Lunch.order removed, lunch.order.line renamed into lunch.order
8/ New SQL report to get the wallet content (aggregate of lunch.cashmove and lunch.order)
9/ New setting to allow negative wallet (aka overdraft)
10/ Application now remembers what notes and toppings you last ordered with your product
11/ You can change your location using the widget on the kanban view
12/ Edition of the order can be done until the order is arrived
TaskID: 1856876
TaskID: 1916105
closesodoo/odoo#30028
We want to be able to use alerts in order to display a message to the
users.
We want to have a minimal display in the wizard.
We want to link the toppings to the categories instead of the suppliers.
closesodoo/odoo#29301