Rationale
=========
Since v8, the `display_name` field is present on all models. By default,
`display_name` uses `name_get` which has pretty much the same purpose
(return record name used by the web client). Gradually, many (backend)
developers (and the ORM: https://github.com/odoo/odoo/commit/6da1c3ac4c036eac289597602976538e243cb939)
started using `display_name` (more convenient than
`record.name_get()[0][1]`) but it still had the `name_get` override.
It becomes more complex than necessary and poeple start to misunderstand
the two (and sometimes override both, leading to inconstiencies between
`display_name`/`name_get`).
To simplify the ORM and the API, we decided to keep only one of them,
the `display_name` field:
- It is much more convenient from a backend point of view
(`record.name_get()[0][1]` vs `record.display_name`)
- It is cached during the same transaction (and invalidated if
its dependencies change)
- It can be overridden like any other compute field (override
`_compute_display_name` with any extra dependencies)
- `name_get` is replaced by `read(['display_name'])`
(API perceptive), which can actually be more efficient
(if `display_name`'s depends are correct, the ORM will only fetch the
fields it needs instead of every prefetchable field)
Changes
=======
- Deprecates `name_get` for the v17 and based the method on
`display_name` (the opposite of before)
- Converts all usage of `name_get`
- Overrides of `name_get` are now overrides of `_compute_display_name`
- For `res.partner`, rename the field store `display_name` into
`complete_name` because `display_name` context-dependent and it makes
no sense to have a compute store that is context-dependent.
- Previously, it was possible to return multiple names for the same
record with `name_get`, but it was tricky and most of the usage of
this `name_get` didn't take this into account. The only example of
this is the `name_get` of `product.product`
(now use `", ".join(<names>)`).
Part-of: odoo/odoo#122085
The records' description in the cashmove report was showing the raw json
data, now it's showing the English translation.
closesodoo/odoo#101927
X-original-commit: bcc9b5504f84729ccb5522742a2b6404c14be2d1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Replace text fields to html fields as we have our own 'OdooEditor'.
Indeed, it gives more options to users in the way they format their
content without weighting too much on the UI
(tools appear on demand and not by default).
Models -> Fields
1) fleet.vehicle -> description
2) fleet.vehicle.log.contract -> notes
3) hr.job -> description
4) hr.contract -> note
5) hr.leave.allocation -> notes
6) hr.applicant -> description
7) lunch.product -> description
8) lunch.order -> product_description
9) lunch.product.report -> description
Task Id: 2499504
X-original-commit: afe52b050a7667f3f20696cd48cd922f635a941c
Purpose
=======
Improve the lunch categories and mutli-company environment.
Specifications
============
- Able to archive a product category and this should archive/unarchive
all the products in that category also added the filter for same.
when unrchive the product if category is archived then raise the
Validation to change the category OR unarchive the category.
- add a default image for lunch categories
- Adapt the size of the default image, currently it's too big,
- On lunch order form view if product images is not set then display
the category image same as kanban image.
- Add a company field on the Product categories (it's already there
but it should be visible on the view form). Added the multi company
rule for the product category and if company is not set on category
then it will be sharable by all the company. so default company on
product category null.
also on lunch product and report check the multi company and display
the product accroding to company.
closes odoo/odoo#45797
Taskid: 2200002
Closes: #45797
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The purpose of task is to update the 'user/employee avatar' to the new
widget in all the kanban view across all modules.
The below new widget are introduced for avatar:
- many2one_avatar_user (for user_id fields)
- many2one_avatar_employee (for employee_id fields)
which displays the avatar (i.e. picture) of a user/employee in front
of his name and clicking on the avatar will open a chatbox to message
that specific user/employee.
So in this commit, For each kanban view with a user or employee avatar,
replaced it by the field with the new 'many2one_avatar' widget.
TaskID: 2244928
Related Enterprise PR: https://github.com/odoo/enterprise/pull/10420
closes odoo/odoo#50789
Closes: #50789
Related: odoo/enterprise#10420
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Images of the lunch dashboard are not cached by the browser.
closesodoo/odoo#47427
X-original-commit: fec2e2a49faa69d2ce554e62a3de196573fa3656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The current "mutli-company filter" of lunch product reports is hardcoded
in the SQL view, based on the user's company, ignoring the general
mechanism of multi company rules (env allowed companies).
Task 2202678
closesodoo/odoo#46630
X-original-commit: b77d2bde9431ae549779a466a76dae7c3173d8a6
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Now we can translate name and description field in lunch.product object
and we want that translation in kanban view of 'lunch.product.report'.
So we set related field in 'lunch.product.report' and remove those fields
from init().
Due to related field it will affect on performace of lunch.product.report
kanban view loading.
Task-2068989
closesodoo/odoo#41206
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
The wrong order was used in the row_number call, which lead to ids
changing when writing on `is_favorite`
closesodoo/odoo#38278
X-original-commit: 28ebe6d4849a692d234b4c256332525aa71132e5
Signed-off-by: Romain Libert (rli) <rli@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>
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>
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
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.
Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
- 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>
row_number without order is not invariant depending on the readed
fields. The order by clause on the partition solve this.
closesodoo/odoo#33573
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
left join lateral is the postgresql optimized way to use parameters in
sub queries.
closesodoo/odoo#33526
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
- Since the performance commit @c42ccf2ca7f0a600a0dd7e3b4dd8bacd7a5c6513
the lunch products are displayed only if you have already ordered it.
- Added indexes on `lunch.order` to speed up the SQL request.
closesodoo/odoo#33336
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
- When retrieving lunch orders for specific users, the search could take a
long time to be resolved.
To fix this issue we rewrote the SQL View that retrieves the
information for lunch orders.
closesodoo/odoo#32908
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.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
With BS3, if a column was supposed to be aligned on the right, using
the 'pull-right' class on it did the trick.
With BS4, this is not the case anymore as .row elements use flex.
This commit use one of those 3 solutions case per case:
- If the column was alone on its row, then adding the
'justify-content-end' class on the row.
- If the column was not alone on its row, then adding the 'ml-auto'
class on the column instead.
- If the column was already filling the row, there was no point in
aligning it to the right
Note: this commit does not case about potential xpath which would add
new columns in one of those rows. If any, this can be handled as a fix
later.
With the report editor in Studio, some reports were not easily editable (not
idiomatic XML, too much Python logic in XML, etc.).
These reports have been cleaned up.
widget for displaying previous orders.
Detailed changes :
- previous order is not a computed field, with its own custom widget that has been designed
according the new spec for widgets;
- useless wizards have been removed, and replaced by some server actions that perform the
same action with less code and views;
- removed deprecated or incomplete reporting;
- some renaming to follow the new specifications of module coding