Commit Graph
90 Commits
Author SHA1 Message Date
Kevin Baptiste fbc7b78036 [FIX] lunch: show only company locations
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.

closes odoo/odoo#81603

Taskid: 2710417
X-original-commit: 3e87770bb8faf2a58ba0b429148f64256537a4da
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-12-17 16:07:37 +00:00
Martin Trigaux 293d3765fa [IMP] lunch: avoid a call to ir.model.data
Not needed to do it via a specific call, can be included in the
controller data
2021-08-10 13:49:04 +02:00
Xavier Morel b451441e58 [IMP] lunch: de-traw-ify
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 (?).
2021-07-20 05:41:35 +00:00
Xavier Morel ce50728aa0 [REM] lunch: outdated / unused file
lunch.xml apparently stoped being used in
855c6dac25, but was never deleted.

Finally drop it, and its t-raw.
2021-07-20 05:37:41 +00:00
Yannick Tivisse d7ddd5de53 [IMP] lunch: Store the lunch location on lunch orders 2021-07-16 12:02:56 +02:00
Yannick Tivisse 01ae6a69f2 [IMP] lunch: Improve general UX (back2basics)
TaskID: 2586326
2021-07-16 12:02:56 +02:00
Francois (fge)andSimon Genin d29666c04c [IMP] web, *: adapt some JS files to new module system
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>
2021-02-15 10:18:11 +01:00
Julien Mougenot 6e780b2e4f [IMP] lunch: Make dispatch actions synchronous
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.
2020-08-04 12:44:18 +00:00
Julien MougenotandMathieu Duckerts-Antoine 3162141e4d [IMP] lunch: Conversion of model to extension
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>
2020-07-23 08:21:10 +00:00
Aaron Bohy 8abbc5a3b5 [REF] *: adapt code to web changes
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
2020-06-22 13:04:02 +00:00
Julien Mougenot f5f0ca843d [IMP] *: enable_counters with false as default
In the search panel, the attribute disable_counters with default False
has been changed to enable_counters with default False.
2020-06-12 13:34:04 +00:00
Anh Thao Pham (pta) 8b6b09fc26 [IMP] lunch: add list view for lunch.product.report
- 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

closes odoo/odoo#47556

Taskid: 2160048
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-30 11:40:39 +00:00
Julien Mougenot 7ace5a986a [FIX] web,lunch: separate search panel domain
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

closes odoo/odoo#49720

X-original-commit: e895e553899933be14c8abfd8c676b44a7f534d8
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-04-17 14:21:02 +00:00
Kevin Baptiste 6cbe824871 [REV] web: reverts update to fontawesome 5.11.2
This reverts commit ff1c35513a.

closes odoo/odoo#41480

X-original-commit: 116057b26e71db4692280463669f3e80d813ddcc
Related: odoo/enterprise#7110
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-09 10:33:36 +00:00
Kevin Baptiste ff1c35513a [IMP] web: update to fontawesome 4.7.0 to 5.11.2
FontAwesome 5 introduced new names for some icons as described on
https://fontawesome.com/how-to-use/on-the-web/setup/upgrading-from-version-4#name-changes

This commit replaces the old names to the new ones.

closes odoo/odoo#35826

Taskid: 2050241
Related: odoo/enterprise#5180
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-11-28 10:05:12 +00:00
RomainLibert 69319bba3e [IMP] lunch: get rid of the lunch_order_temp wizard
Replace lunch.order.temp wizard by lunch.order (fp request)

closes odoo/odoo#35585

Taskid: 2048667
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-18 12:37:52 +00:00
RomainLibert d4fb89cd25 [IMP] lunch: back2basics
closes odoo/odoo#38899

X-original-commit: f4dbee9b844015e95afd5edf892489582cf1f397
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-10-16 16:39:16 +00:00
Christophe Simonis 58a83d1222 [MERGE] forward port branch saas-12.4 up to 4a1321bc99
closes odoo/odoo#37127

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-20 14:33:54 +00:00
Christophe Simonis 080f8b1f96 [MERGE] forward port branch saas-12.3 up to d8ce75466e 2019-09-17 17:49:09 +02:00
Sébastien Theys b6288e5446 [IMP] *: remove image_64 and clean views
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

closes odoo/odoo#36147

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2019-09-19 10:23:39 +00:00
Florimond Husquinet (fhu) 6abfdd37b2 [FIX] lunch: add test for domain generation when location false
Fine tuning of 988e201d2e

closes odoo/odoo#36628

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-09-10 14:47:11 +00:00
RomainLibert 988e201d2e [FIX] lunch: allow location_id to be NULL
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.

closes odoo/odoo#36571

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-09 14:04:12 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
RomainLibert ba8bdcfaf2 [IMP] lunch: improve lunch again 2019-09-04 07:26:43 +00:00
RomainLibert c0febb02d8 [IMP] lunch: Improve the product dashboard
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

closes odoo/odoo#35632

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-11 08:59:12 +00:00
Lucas Perais (lpe) 466b97c594 [FIX] lunch: lunch search panel right domain on start
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

closes odoo/odoo#35976

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-08-23 14:42:44 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Christophe Simonis 34a8754d4f [MERGE] forward port branch saas-12.2 up to 498b4b4350 2019-06-14 15:20:01 +02:00
Christophe Simonis 25e3f27062 [MERGE] forward port branch saas-12.3 up to 48a9f5a633 2019-06-17 13:20:35 +02:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Christophe Simonis 0f9823e216 [FIX] lunch: correct forward-port of a5b56e5498
closes odoo/odoo#33878

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-06-05 14:58:20 +00:00
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02:00
Toufik Ben Jaa dac369453c [FIX] lunch: on mobile crashes when grouping by field
- 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.

closes odoo/odoo#33891

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-06-05 07:50:56 +00:00
Aaron Bohy f6eed05da6 [REF] lunch: adapt code to searchpanel changes
Part of task 1985921
2019-07-19 08:39:07 +00:00
Kevin Baptiste 50163143a9 [IMP] lunch: Improve the general UX (back2basics)
- 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

closes odoo/odoo#34470

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-16 11:44:35 +00:00
Aaron Bohy a5b56e5498 [FIX] lunch: remove flickering of lunch widget
closes odoo/odoo#33685

Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com>
2019-05-27 12:18:31 +00:00
Pierre Paridans 4d1cce97a9 [IMP] lunch,web: don't disable SearchPanel on mobile
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
2019-05-23 13:12:58 +00:00
Pierre Paridans bdc0b4b892 [FIX] lunch: make it work on mobile
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
2019-03-19 09:26:08 +00:00
Pierre Paridans 6506cfd775 [FIX] lunch: remove unused code 2019-03-18 08:36:42 +00:00
Pierre Paridans ad8a6afa4f [FIX] lunch: rpc call cannot be performed in Widget.init()
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/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31508

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2019-03-13 09:14:47 +00:00
Pierre Paridans c0f8690d1b [FIX] lunch,web: display correctly list's cell with text overflow
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/855c6dac25fccaf9312543022001ed0b360d6e13

closes odoo/odoo#31506
2019-02-28 15:08:15 +00:00
Christophe Simonis 5df4746c9a [MERGE] forward port branch saas-12.2 up to 230ad8c381
closes odoo/odoo#32088

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-25 11:13:41 +00:00
Christophe Simonis 44515bc7be [MERGE] forward port branch saas-12.2 up to c9f832d9f0
closes odoo/odoo#31790

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13 14:24:51 +00:00
aa900d976f [REF] lunch: adapt code after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Aaron BohyandMathieu Duckerts-Antoine d6fa1a65f0 [IMP] lunch: use searchPanel in New Order kanban view
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>
2019-02-13 12:23:28 +00:00
Aaron Bohy a2350c77c3 [REF] lunch: linting pass on lunch_kanban widgets 2019-02-13 12:23:28 +00:00
RomainLibert 855c6dac25 [IMP] lunch: automatize lunch orders
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

closes odoo/odoo#30028
2019-01-18 15:33:04 +00:00
Yannick Tivisse d1c3948a05 Revert "[IMP] lunch: automatize lunch orders"
This reverts commit f727b8f0b5.
2019-01-08 13:12:33 +01:00
Yannick Tivisse 3729ebf34d Revert "[IMP] lunch: reintroduce lunch_alerts, change display of wizard"
This reverts commit 6f5dc5733f.
2019-01-08 13:10:55 +01:00
RomainLibert 6f5dc5733f [IMP] lunch: reintroduce lunch_alerts, change display of wizard
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.

closes odoo/odoo#29301
2018-12-06 09:33:30 +00:00