Commit Graph
18 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
Yannick Tivisse b5e3fd73ed [FIX] lunch: Don't erase lunch location when set
closes odoo/odoo#77621

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-10-01 15:26:55 +00:00
alt-odoo 1aaef7614d [FIX] lunch: use correct timezone when retrieving today's lines order
On the kanban view to order your lunch, we are retrieving today's order lines for
the current user. In _get_current_lines, we are using today's date without taking
into account the timezone of this user, which can prevent him to see/modify his
order of today in case it was ordered very early.
2021-08-25 06:03:39 +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
Leonardo Pavan Rocha c53724ebc3 [IMP] *: adds generic user avatar
Description of the issue/feature this PR addresses:
It is currently quite difficult to differentiate users. Most of the time, people
don't take the time to upload an actual avatar so everybody looks the same. This
PR generates a custom avatar with the users initials and random color to
differentiate them. For res.users, res.partner and hr.employee, image fields now
hold the binary image and avatar are used to show the image or svg.

Current behavior before PR:
Avatar had only random colors and was being saved in database, being inefficient

Desired behavior after PR is merged:
A new mixin defines image fields and in case no image is set, it generates an
SVG image with the user's initials and random color.

closes odoo/odoo#69819

Task: 2404630
Related: odoo/enterprise#18199
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-01 14:36:23 +00:00
Martin Trigaux d9287caf94 [IMP] *: convert to private methods
render, render_template, load, activity_schedule_with_view,
get_website_pages should all be private:
It should not be possible to render an aribtrary template only with
its name or id

Still need to render some qweb views from js so the method
render_template is kept public.
This explains why the website editor still need read access on
ir.ui.view as we want to allow any snippet to be rendered.
2020-05-14 13:59:10 +02:00
Swapnesh Shah 147e61a3bc [FIX] lunch: Add required argument location_id
This commit fixes Tracbacki coming when the user removes a location on New order.
It is because of location_id was not passed on Route.

closes odoo/odoo#38023

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-06 17:50:38 +00: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
RomainLibert 9ef2157d17 [IMP] lunch: location multi company
closes odoo/odoo#36331

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-09-04 07:26:43 +00:00
Sébastien Theys 58a2ffa26f [IMP] *: rename image fields
image_original => image_1920 (now resized to 1920)
image_big => image_1024
image_large => image_256
image_medium => image_128
image_small  => image_64
image replaced by image_1920 (when writing) or by image_1024 (when displaying
	what was previously the big size)

+ add new intermediate format:
image_512

PR: #34925
2019-08-02 16:47:58 +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
RomainLibert 4ae4af623d [FIX] lunch: make sure that user has a last_lunch_location
We should have the frontend and backend in sync on the last_location
of the user

closes odoo/odoo#33608

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-23 15:27:17 +00:00
RomainLibert dc694e9fb5 [IMP] lunch: make sure you can write the last location
closes odoo/odoo#33338

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-17 13:46:26 +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
RomainLibert f727b8f0b5 [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.

In this commit we add a new widget that comes with the kanban view and will allow to take orders
in a friendly manner.

We also add a lunch.supplier model and an integration with the hr module in order to filter what
products you can order depending on your working location, this also allows you to configure an
automatic ordering via email.

TaskID: 1856876
2018-12-04 11:56:21 +01:00