Commit Graph
87 Commits
Author SHA1 Message Date
Gorash 774a3fad0e [REF] base,all: Update modifier syntax: view migration
Apply of the migration script to update all view modifiers.

Part-of: odoo/odoo#104741
2023-08-18 09:49:13 +02:00
Rémy Voet (ryv) 3c62ca1eb9 [REM] core: remove name_get API
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
2023-06-28 17:41:19 +02:00
dasz d832fcf0ce [IMP] hr_*: standardise UI displaying of employees accross all hr apps by using the widget avatar_user
Appraisal: done, fix  chat widget issue
Employee: done, removed unused view
Attendance: done
Expense: done
Time Off: done
Fleet: done
Payroll: done
Referall: done
Lunch: done

task-313272

closes odoo/odoo#111817

Related: odoo/enterprise#36663
Related: odoo/upgrade#4310
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-04-13 15:25:46 +02:00
Kevin Baptiste 9950101b7b [FIX] lunch: show translated description
The records' description in the cashmove report was showing the raw json
data, now it's showing the English translation.

closes odoo/odoo#101927

X-original-commit: bcc9b5504f84729ccb5522742a2b6404c14be2d1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-03 15:19:26 +02:00
Romeo Fragomeli 1fcd098af5 [REF] *: BS5: migration
Automated change made by a lot of RegEx to change all think that is
possible to automate.

https://getbootstrap.com/docs/5.1/migration

Task ID: 2766483

Part-of: odoo/odoo#95450
2022-07-07 13:30:24 +02:00
Yannick Tivisse 7778031977 [IMP] lunch: Remove lunch.product.report model
The cross join with res.users caused dramatic performances issues.

TaskID: 2586326
2021-07-16 12:02:56 +02:00
dht-odoo 5ce7ad709c [IMP] hr: improves field type from text to html
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
2021-06-07 05:24:08 +00:00
Raphael Collet 93d2321b6b [REF] core: simplify definition of concurrency field 2021-04-21 13:36:52 +00:00
Barad Mahendra 231eaa0fd8 [IMP] lunch: Improve the views and multi-company behaviour
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>
2020-06-16 13:18:06 +00:00
Vishnu Thuletiya 9a830432db [IMP] various: Use the new avatar widget in kanban view
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>
2020-05-13 12:37:48 +00:00
Lucas Lefèvre 35c144c28a [FIX] lunch: Cache lunch product images
Images of the lunch dashboard are not cached by the browser.

closes odoo/odoo#47427

X-original-commit: fec2e2a49faa69d2ce554e62a3de196573fa3656
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-03-11 16:05:07 +00:00
Lucas Lefèvre 983edd2fcc [FIX] lunch: Apply real multi company ir.rule
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

closes odoo/odoo#46630

X-original-commit: b77d2bde9431ae549779a466a76dae7c3173d8a6
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
2020-03-02 08:57:10 +00:00
nje-odoo 92472fbf9c [IMP] lunch : make field translatable.
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
closes odoo/odoo#41206

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-12-31 12:17:26 +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
Yenthe666 d05e5bef32 [FIX] lunch: fix typo in widget definition
closes odoo/odoo#40902

X-original-commit: cf7017ea92c34a98bc670860ba89677bb8697c0b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-11-26 13:50:13 +00:00
RomainLibert c0f6e50fdd [FIX] lunch: avoid rewriting ids
The wrong order was used in the row_number call, which lead to ids
changing when writing on `is_favorite`

closes odoo/odoo#38278

X-original-commit: 28ebe6d4849a692d234b4c256332525aa71132e5
Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-10-09 12:20:08 +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 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
RomainLibert 9a27710aa7 [FIX] lunch: fix lunch product report
closes odoo/odoo#35904

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-08-21 11:04:28 +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
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
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'`
2019-07-17 14:13:12 +02: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
Nicolas Seinlet 691b0e7e6f [FIX] lunch : row_number with order
row_number without order is not invariant depending on the readed
fields. The order by clause on the partition solve this.

closes odoo/odoo#33573

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-05-22 13:28:04 +00:00
Nicolas Seinlet 1b045d0ed4 [FIX] lunch: improved view speed
left join lateral is the postgresql optimized way to use parameters in
sub queries.

closes odoo/odoo#33526

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-05-21 12:06:35 +00:00
Toufik Ben Jaa 2a7652307e [FIX] lunch: missing products on lunch order page
- 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.

closes odoo/odoo#33336

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-14 09:57:56 +00:00
Toufik Ben Jaa c42ccf2ca7 [FIX] lunch: performance issue when retrieving lunch orders
- 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.

closes odoo/odoo#32908

Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
2019-04-24 09:56:09 +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
qsm-odoo ece1e3d93f [FIX] *: BS4, restore right-aligned columns
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.
2018-08-19 16:57:14 +02:00
Martin Geubelle 9dbf815dd8 [REF] *: modify templates to allow smoother modifications
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.
2018-08-13 17:09:28 +02:00
qsm-odoo d48b8593dd [REF] *: BS4, 'pull-left/right' -> 'float-left/right' 2018-07-27 12:36:54 +02:00
qsm-odoo 6e223b9273 [REF] *: BS4, adapt tables (and list view)
`table-condensed` -> `table-sm`

Also SCSS variables were renamed.
Also restore list view design.
2018-07-27 12:36:54 +02:00
qsm-odoo ed1b18f103 [REF] *: BS4, adapt col-related classes
col-lg-* -> col-xl-*
col-md-* -> col-lg-*
col-sm-* -> col-md-*
col-xs-* -> col-*

col-lg-offset-* -> offset-xl-*
col-md-offset-* -> offset-lg-*
col-sm-offset-* -> offset-md-*
col-xs-offset-* -> offset-*

col-lg-pull-* -> order-xl-1
col-md-pull-* -> order-lg-1
col-sm-pull-* -> order-md-1
col-xs-pull-* -> order-1

col-lg-push-* -> order-xl-2
col-md-push-* -> order-lg-2
col-sm-push-* -> order-md-2
col-xs-push-* -> order-2
2018-07-27 12:36:54 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
Christophe Matthieu 032122484e [TYPO] qweb: use the same option attribute for t-esc t-raw and t-field
t-options instead of t-field-options
2016-07-05 18:44:58 +02:00
Christophe Matthieu 78b52fb637 [FIX] templates: remplace true by True for t-field-options
t-field-options is a python dictionary.
'true' is evaluated as None because the qweb did not find any value for 'true' key.
2016-06-14 14:26:42 +02:00
Christophe Matthieu d9efca0908 [IMP] qweb: t-field-options is a python dict, safe_eval for compile template, not need to eval in field methods 2016-06-14 13:12:14 +02:00
Nicolas Martinelli 3d63c15a56 [MIGR] lunch: migration to the new API, cleaning and new
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
2015-04-23 10:27:08 +02:00
Thibault Delavallée 058d403309 [MOV] lunch: moved files according to new specifications in order
to prepare the migration to the new API. Some files have not been renamed
because they will disappear soon.
2015-04-23 10:27:08 +02:00
Leonardo Donelli 4a0b13ed92 [REF] remove vim modelines and resulting trailing blank lines
Let 2015 be a year without modelines!
cf #4174
2014-12-31 15:52:13 +01:00
Jaydeep Barot 026e38b48f [REM] Unnecessary size parameters on char fields 2014-06-25 17:13:43 +02:00
Simon Lejeune 106d06ce5d [IMP] account* reports: removed unused class/report/commented code/test, added the abstract_report wrapper on all old style report classes + some fixes on views and wizards in order to use these classes to render the qweb reports
bzr revid: sle@openerp.com-20140402164053-gry12scy8zca68lv
2014-04-02 18:40:53 +02:00
openerp-sle 67fc7252c5 [IMP] Lunch order report converted to QWeb
bzr revid: openerp-sle@openerp-sle.home-20140217140523-591vtpvc5yd6nuuv
2014-02-17 15:05:23 +01:00
Vo Minh Thu e69326ee3b [REF] removed explicit model instanciations.
bzr revid: vmt@openerp.com-20130415102349-vgcrfok2k5y10cwz
2013-04-15 12:23:49 +02:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Arnaud Pineux 2a13ed6338 [REF]English demo, fix report, clear security
bzr revid: api@openerp.com-20121106162907-ir7ujoxowlrqouyt
2012-11-06 17:29:07 +01:00
Arnaud Pineux c0971be90b [FIX]some changes
bzr revid: api@openerp.com-20121106155523-vhpbuw6lfniqqgeu
2012-11-06 16:55:23 +01:00
Arnaud Pineux bffa00134f [MERGE]lunch
bzr revid: api@openerp.com-20121030084701-lgiss30ih4elg4hh
2012-10-30 09:47:01 +01:00
Arnaud Pineux ccdec6f158 [MERGE]Lunch_new application
bzr revid: api@openerp.com-20121024133918-qu0xha3fuaisc0va
2012-10-24 15:39:18 +02:00
Arnaud Pineux e2dcb40cb8 [MERGE]Lunch_new application
bzr revid: api@openerp.com-20121024131713-ur52t1em8822vfo3
2012-10-24 15:17:13 +02:00