Commit Graph
15 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 234db70d86 [IMP] *: Use the new API of _read_group for backend use
Part-of: odoo/odoo#110737
2023-04-19 21:58:27 +02:00
Martin Trigaux 69f911d994 [IMP] *: enforce usage of Markup in mail
When using message_post, the body format must be explicitly specified.
If html is expected, a Markup object should be used.
If text is given, the content will be escaped.

Before this PR:
message_post was unaware if the content of a message was HTML or
text. This lead to multiple situation where the content was
incorrectly considered as HTML and led to display errors.
In
  self.message_post(body="Hello %s!" % self.name)
if the name contained HTML, it would be evaluated.

In
  self.message_post(body="Contact Raoul <raoul@caramail.be>")
the email would not be displayed as considered as unknown HTML and
discarded by the sanitizer

Now each call must explict the type of content.
Use the escape() helper to properly combine Markup and translations.
It would also be acceptable to use Markup() to wrap a static
translation but escape is better as one can not guarantee the content
of a translation.

closes odoo/odoo#111850

Related: odoo/documentation#3612
Related: odoo/enterprise#36728
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-04-13 16:39:48 +02:00
Andrew Gavgavian 4771963f7c [FIX] various: change domain on aml for move_id.state queries
`Account.move.line` contains a stored related field called `parent_state` which relates to `move_id.state`. This allows for performance improvements by accessing that instead of `move_id.state`.

However, across odoo and enterprise `account.move.line` is domained against `move_id.state`.

This can produce an unnecessary left join on SQL queries for reports or other queries when instead it could use the stored field directly.

To accomplish this fix, we adjust domains to refer to 'parent_state' instead of `move_id.state`

While this PR will adjust multiple modules to fix this domain, it should improve SQL queries over large tables when a left join is no-longer necessary.

opw-3178866

closes odoo/odoo#116679

X-original-commit: c94d57edc002e499e317d04b2864d22acb5f40fa
Related: odoo/enterprise#38808
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-27 19:13:37 +02:00
Fabien Pinckaers 3363e55cac [IMP] cleanup of help messages in all modules
This commit aims at removing unuseful help message to:
1/ reduce translators work, to focus on more useful translations
2/ not sending unuseful information in load_views
3/ reduce help message to useful messages, so that we can mark
   fields having a tooltip in the future UI.
4/ some cleanup of existing messages too

The main use cases:
- REMOVED: help redundant with the field name, providing no extra info
- MOVED TO COMMENT: technical help messages, that should not be in UX

closes odoo/odoo#97279

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-08-02 00:26:53 +02:00
Victor Feyens 00ed6aa042 [IMP] mail,* : uniformized API for chatter links
* Enforce html escaping of record title
* Avoid translating html content as much as possible, to reduce translation errors.
* Uniformize/Factorize link generation, easing future tasks, code maintenance, ...

Enterprise PR: https://github.com/odoo/enterprise/pull/25357

closes odoo/odoo#84866

Related: odoo/enterprise#25357
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-03-31 12:32:47 +02:00
Vincent Schippefilt 05fc9a6733 [IMP] *: use _read_group instead of read_group
This commit modifies most of the usages of read_group and uses
_read_group instead. _read_group doesn't join automatically on the
many2one fields when no order_by is specified, making it more performant
when the "name" of the many2one is not relevant, which is the case for
most back-end cases

closes odoo/odoo#84908

Task-id: 2479334
Related: odoo/enterprise#24877
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-03-02 17:10:48 +00:00
Raphael Collet a1904aa6f6 [IMP] core: field index names
The possible index names have been renamed "btree", "btree_not_null"
(instead of "not null") and "trigram" (instead of "gin").

Task 2742526

Part-of: odoo/odoo#83274
2022-01-28 14:10:01 +00:00
John Laterre (jol) 16872e63a4 [IMP] account_fleet: assets/fleet/DNA/accounting
The goal is to improve the way Disallowed Expenses (DNA - Dépenses Non Admises)
and Assets (vehicles in particular) work.

This should help integrate the Accounting and Fleet modules.

closes odoo/odoo#76684

Task: 2641494
Related: odoo/upgrade#3067
Related: odoo/enterprise#20950
Signed-off-by: William André (wan) <wan@odoo.com>
2022-01-25 09:56:59 +00:00
Fabien Pinckaers eedf37d6e2 [IMP] Better handling of indexes
Three supported types:
- btree (default for index=True)
- btree not null (when >90% of the data are null)
- gin trigram search (for char fields)

Review of indexes on all objects.

closes odoo/odoo#83015

Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-01-19 16:52:23 +00:00
Nicolas (vin) a4061afe0d [FIX] account_fleet: Improve performances
Performances issues have been noticed in account_fleet when computing
the move_ids of vehicles.
This change has been made in order to fix this issue.

Task id #2700407

closes odoo/odoo#80755

X-original-commit: 2860051b3cbfa7bcd7df76d05b4e5770e9a4c2d0
Signed-off-by: William André (wan) <wan@odoo.com>
2021-12-02 13:43:19 +00:00
Philippe Wauthy 9661c28994 [IMP] fleet: New fields in Bills tree view
When the bills linked to a vehicle are displayed, the creation date is not always relevant. Sometimes, the Invoice/Bill Date is more interesting.
To avoid confusion, "Date" is renamed "Creation Date" and the column "Invoice/Bill Date" is added between "Creation Date" and the "Number" (bill number) columns.

Summary of the changes:
On the bills tree view for a specific car:
- "Date" is renamed in "Creation Date"
- "Invoice/Bill Date" is added between the "Creation Date" and the "Number" columns, the default is optional:show

task-2629316

closes odoo/odoo#75582

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-08-27 18:46:02 +00:00
Nicolas Lempereur 1d20e9780c [FIX] account_fleet: export multiple fleet_vehicle moves
The compute field for fleet_vehicle().account_move_ids can be using
self.id where self might be a recordset with more than one record.

opw-2630226

closes odoo/odoo#75541

X-original-commit: c5e14bee56d2f36499088e217e86df3be0fb0fb0
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-08-26 13:56:31 +00:00
Goffin Simon ba1d2b754f [FIX] account_fleet: Field vehicle_id unavailable on vendor refund
The fleet vehicle_id must be visible on vendor refund

opw:2471784

closes odoo/odoo#67280

X-original-commit: 7144321c3fd13f83241ae7e4be71a9a4d576a871
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-04 16:16:25 +00:00
Martin TrigauxandXavier Morel 49838338e0 [FIX] *: sanitize action content reading
The open_action_with_context was not using _for_xml_id, producing an
error when reading the action content.

In open_action, the action_name was taken from the context and needs
sanity checks. Ensure only actions from the account module can be
read and only if the user has access to the target model.
This is a limitation of the previous behaviour but, at the moment, all
known calls are made refering to an action from the account module.
Limit the scope of this method while the 14.0 is still early to avoid
having a door open to ready any action, and difficult to close later.

Remove old action fetching from the context in create_move that is no
longer used.

closes odoo/odoo#61602

X-original-commit: a39e94f7e4dc74e850650ac90bbc5f85af130bc8
Related: odoo/enterprise#14695
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Xavier Morel <xmo@odoo.com>
2020-11-10 16:04:29 +00:00
william d1c0a97c18 [ADD] account_fleet: manage accounting with fleet
Task: 2186429

Add a vehicle on account.move.line to help create reports.
When a vehicle is set, log a service log on the vehicle.

closes odoo/odoo#49675

Related: odoo/upgrade#1357
Related: odoo/enterprise#8480
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-08-19 14:22:48 +00:00