Commit Graph
309 Commits
Author SHA1 Message Date
Brieuc-brd b4e96e7230 [FIX] board, web: fix dashboard icon SVG
Prior to this commit the knowledge icon from the same dropdown was
turned into an inline-svg but the dashboard one was not.

This commit aims to use an inline-svg for that icon and ensure it
renders correctly.

task-3072562

closes odoo/odoo#138279

X-original-commit: 4df55bbc7bfe0bbe62605cd88887d45460814964
Related: odoo/enterprise#48734
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-16 09:21:17 +00:00
Brieuc-brd 538fdab99b [IMP] *: fine-tune app icons
The aim of this commit is to improve the impact and rendering of app
icons in bright and dark mode. It also reduces the size of svg files.

To achieve that, this commit updates the colors to flat colors. This
change will make the icons stand out and improve their readability.

task-3072562

X-original-commit: 667a19162b74fb6554a2389ba9c6e69de4ff5113
Part-of: odoo/odoo#138279
2023-10-16 09:21:17 +00:00
Mathieu Duckerts-AntoineandMathieu Notté 6428aef678 [IMP] *: improve domain selector edition, dom, and style
We improve various aspects of the domain selector:

- We make the domain selector be able to display all domains accepted by the class Domain (domain.js)
- We improve the edition/selection of values, e.g. for the operators in/not in
- We improve/simplify the style/dom

Task IDs: 3507123, 3508940

closes odoo/odoo#128680

Related: odoo/enterprise#48324
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Mathieu Notté <mano@odoo.com>
2023-10-13 06:27:42 +00:00
Romeo Fragomeli 9c970b13b7 [REF] board,web: adapt useSortable to be used natively
This commit removes Owl hooks from the sortable hook builder file and
introduces a new parameter attribute (`setupHooks`) to specify which
functions must be used to set up, update and tear down the draggable
hook.

This has been done to allow using the hook function in environments
where Owl is not available.

Part-of: odoo/odoo#137527
2023-10-10 01:59:35 +00:00
Jorge Pinna Puissant ef424a9dc2 [REF] *: remove owl from linter's accepted global variables
Before this commit, owl was in the linter's accepted global variables.
This allowed  direct access to owl global object.

For instance, to use xml from owl, you could do :
`const { xml } = owl;`
or you could use it directly:
`owl.xml`

Now, owl is not accepted on linter's global variables anymore, so to
import xml, now you need to use a proper import:

`import { xml } from "@odoo/owl";`

task-id 3498859

closes odoo/odoo#137517

Related: odoo/enterprise#48364
Related: odoo/design-themes#709
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-10-05 10:21:53 +00:00
Aaron Bohy cc3a3a328d [REF] web,*: simplify arch manipulation and parsing logic
*board,mail,project

This commit aims to simplify the XMLParser logic and the way archs
are manipulated in views, motivated by [1] where we had to
modify the arch in View to insert access right information.

First, the xml utils have been reworked. The XMLParser class has
been removed. The xml utils module already exported a parseXML and
a serializeXML functions, this commit adds visitXML, s.t. the whole
XMLParser feature is fully replaced by the 3 functions.

Second, concrete views now receive the arch in props as an
XMLDocument, as the arch is parsed once for all in View. With this,
we were able to remove serializing/parsing back and forth at several
places, where we needed to extract information for sub-parts of an
arch individually (e.g. View, x2many subviews, list view groupby).

Third, even though this change has been driven by the one above and
wasn't initally wanted, the view compiler cache and API have been
simplified. The cache is now flat, there's an entry in the cache for
each template that has been compiled. Moreover, the useViewCompiler
hook no longer takes the cache key in params, as it can directly
compute it itself (the key being the outerHTML of the template).

[1] odoo/odoo#135145

closes odoo/odoo#136376

Related: odoo/enterprise#47808
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-10-04 08:39:12 +00:00
Jorge Pinna Puissant 006ee1fc47 [REF] web, *: remove legacy cookie utils and cookie service
The cookie service was replaced by a utils file in core. This was done
to be able to use the cookies without the need of environment.

"Om Nom Nom Nom" - Cookie Monster

part-of task-id 3439226

closes odoo/odoo#136782

Related: odoo/enterprise#48005
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-03 20:17:40 +00:00
luvi 5124feae97 [IMP] web, *: improve UX of custom group by menu
*: board, website

This commit simplifies the UX of the 'Custom Group by' menu. Before this
commit, many clicks were needed to apply another filter, from an accordion
menu.

Now, a select element is used instead, allowing a better user experience, by
enabling such group by directly, when an option is selected.

Some tests have been adapted to the new selectors and behaviors, and the
applyGroup and toggleAddCustomGroup has been removed, since groups are applied
when selected, and the value can be modified directly with selectGroup.

task-3458519

closes odoo/odoo#132006

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-03 19:19:53 +00:00
Hubert Van de Walle (huvw) 04eed39aa8 [FIX] board: Add to dashboard no longer saves default filters
When adding a view to the dashboard, we already save the domain.
We don't want to save the default filters as they can have an opposite
domain as the one selected, meaning no records will be matched when
going to the dashboard.

---

opw-3385248

closes odoo/odoo#134610

X-original-commit: 16ab99eece9b36b1bb2958bb0f8ec45cbf8b83d3
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-07 09:00:37 +00:00
Aaron Bohy 2a121a32a2 [REF] *: rename unity_web_search_read into web_search_read
Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Aaron Bohy 573516e9c1 [REF] web,board: remove /web/dataset/search_read
Part-of: odoo/odoo#133617
2023-08-31 09:04:58 +00:00
Pierre Pulinckx (pipu) c07181b20b [REF] *: Replace env._t() by _t()
In this commit, all usages of env._t() are replaced by _t().
In templates files, env._t() didn't work because terms used
in attributes where not extracted into the translation files.
Only string are exported from .xml files to translation files.
So, to make it works, we set a variable that is then used
in attributes.
For example :

<t t-set="string_to_translate">String to translate</t>
<Dialog title="string_to_translate>...</Dialog>

task-3292454

closes odoo/odoo#131390

Related: odoo/enterprise#45631
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-08-18 19:17:16 +02:00
Jorge Pinna Puissant e338487028 [REF] *: remove owl="1" from the templates
As all the templates are now imported in the owl app, there is not need
anymore to specify the owl="1" attribute in the templates.

Part of task~3443861

Part-of: odoo/odoo#130467
2023-08-11 14:32:30 +02:00
Louis Wicket (wil) f1722c7334 [IMP] *: unify sprintf and gettext
Improve gettext to directly handle value injection within translations,
removing the need for sprintf.

closes odoo/odoo#123932

Related: odoo/enterprise#45370
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-10 18:14:04 +02:00
Pierre Pulinckx (pipu) 60fe2e9b17 [REF] *: remove _lt()
In a previous commit 8bfa76a, _lt() returns _t().
So, in this commit, all usages of _lt() are replaced by _t().

task-3292454

closes odoo/odoo#130179

Related: odoo/enterprise#44906
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-01 13:51:17 +02:00
Bastien PIERRE 65242e31e9 [IMP] *: Remove alias in JS files
Rename all imports with alias old system to the new js module system
Task ID: 3266759

closes odoo/odoo#127414

Related: odoo/design-themes#671
Related: odoo/enterprise#43716
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-07-27 11:58:34 +02:00
218ad8456a [REF] *: adapt codebase to new RelationalModel
This commit adapts the code in addons w.r.t. the introduction of
the RelationalModel.

Main changes that were requested are:
 - record datapoints no longer always have an "id" key in their
 data (they still do if the id field is in the view), so we use
 record.resId instead
 - the new model is based on fined-grained reactivity, so several
 components that previously relied on onWillUpdateProps to update
 their internal state no longer worked. Typically, using the hook
 "observeRecord" is the way to go now.
 - specialdata are no longer handled in the model, so the components
 needing specialData can use the hook "useSpecialData"
 - more generally, all overrides of models (RelationalModel or
 KanbanModel) needed to be reworked.

Part of task~3179751

Part-of: odoo/odoo#114024
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: FrancoisGe <fge@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
Co-authored-by: Pierre Rousseau <pro@odoo.com>
2023-07-24 20:17:50 +02:00
25f43c2161 [FIX] web, *: cogMenu visual flaws
*: account, base_import, board, website

This PR enhances the "cog menu" by fixing several UX flaws.
Notable improvements include:
- Reordering entries in a more logical manner, enhancing user intuitiveness.
- Assigning icons to common actions for quick comprehension.
- Grouping both print actions and module-specific actions for better organization.

Enterprise:
- https://github.com/odoo/enterprise/pull/41851

task-3337951
task-3355224 (milk post-merge fixes)
part of task-3326263

closes odoo/odoo#124413

X-original-commit: 596772885a87016d29f002cd4e41b5a973965e40
Related: odoo/enterprise#42212
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2023-06-09 17:01:06 +02:00
Romain Estievenart 46992fa90f [FIX] board: display all data when force 1 column layout on small screen
Before this commit, on a dashboard having a multi-column layout, the
user couldn't see all those columns' actions when the layout fallback to
the "1 column" on a small screen.

This commit fixes it by, not only keeping the fallback to "1 column" to
optimize the screen's real-estate, but also properly bringing the hidden
columns' actions in the single column, so they become accessible by the
user.

Steps to reproduce:

- Create My dashboard on PC with two views set one next to the other
- Open My dashboard on mobile devices, and you see only the action
inside the column on the left and not the action inside the columns on
the right => bug

opw-3145706

closes odoo/odoo#124360

X-original-commit: fa1da53af1d327c4fafd944547dbf3c7312a93b4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-06-08 23:01:23 +02:00
Romain Estievenart 34dc70ae5a [FIX] board: use single column layout on small screen
Steps to reproduce:

- Create My dashboard on PC with two views set one next to the other
- Open My dashboard on mobile devices, and you see the desktop view
  => bug

On small screens, we don't have enough available space on the screen to
allow other layout then "1".

opw-3145706

closes odoo/odoo#123561

X-original-commit: 9e1f79156e9440b953e9d476a608f9ce117c0d5b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-02 23:39:19 +02:00
Brieuc-brd 8b15ce6652 [FIX] board: remove duplicate viewbox of svg icon
Prior to this commit, the svg icon of `board` had duplicate `viewBox`
that breaks the svg.

This commit fixes this issue.

task-3343278
Part of task-3326263

closes odoo/odoo#123067

X-original-commit: 48c8c6b32951e6393e41f2705dbdd9020dae971b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-05-31 15:54:15 +02:00
Paul Morelle c01b4a9f3c [FIX] board: avoid double-escaping in domain
This reverts commit bfadb8e491fe2acda63a79f9577eaaec8a1c8d9c.

Since that commit, the domain may be double-encoded in the database if
the user reorganizes the layout of his dashboard: once by the JavaScript
code, and once by the serialization of the innerHTML property.

However, there is no need to have it double-encoded, and some tools such
as the upgrade scripts will fail upgrading the domain.

With this commit, we are serializing the document to XML instead of HTML
and therefore the produced output is valid XML that will be correctly
interpreted by all the tools.

However, double-encoded domains might still be present in existing
databases, so we also need to take this into account when reading the
domain.

OPW-3130117

closes odoo/odoo#123045

X-original-commit: dd8f2640a281b86b73d3b296dd0a5aec7664eb4f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
Signed-off-by: Paul Morelle (pmo) <pmo@odoo.com>
2023-05-31 14:23:37 +02:00
Brieuc-brd fa60bac197 [IMP] *: app icons : add viewBox attribute
Prior to this commit, the SVG's viewBox attribute was missing, which
prevented svgs from being scaled.

This commit fixes this issue.

task-3326633
Part of task-3326263

X-original-commit: 30300c373ad1c63a6cf8b035cae0785a09c6933f
Part-of: odoo/odoo#121886
2023-05-22 13:54:08 +02:00
Mathieu Duckerts-Antoine 5304d8fc64 [REF] *: remove legacy search models/components
There is no action that uses the search models/components available in
the legacy control panel. We remove those.

closes odoo/odoo#121433

Related: odoo/enterprise#41078
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-16 15:55:24 +02:00
Pulinckx Pierre (PIPU) f4f0f78318 [REF] *: Replace underscore.js function by native JS
Before this commit : The library underscore.js and
underscore.string.js were used in the ODOO solution.
After this commit : Every usages of a function from
underscore.js lib has been replaced with native javascript.
The goal is to remove all usages of underscore.js and to
not use anymore this library in ODOO.
---
TaskId : 3246238

closes odoo/odoo#120437

Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-05-15 09:37:48 +02:00
Pierre Paridans eef262abf4 [FIX] *: adapt QUnit tests and tours
[FIX] *: selectors in tours

[FIX][TMP] account: CogMenu selector in tours

[FIX][TMP] web*: Breadcrumb targetting in tours

Adds a `o_breadcrumb` class to target the whole breadcrumb, no matter
how much elements it contains (collapsed parts, visible path, single
name...).

add classname on last breadcrumb item

[FIX][TMP] project: View buttons selector in tours (moved away from CP)

[FIX][TMP] project: Kanban selectors in tours (quick create)

[FIX][TMP] *: SearchBar selectors in tours (toggle menu)

[FIX][TMP] *: ButtonBox selector in tours

[WIP][IMP] web: add toggleSearchBarMenu in search helpers

adapt and unskip 3 list tests

adapt and unskip calendar tests

unskip web_tour test that actually pass

post rebase fix

allow to lose cell focus after multi edition (given to searchbar) - bug reported, to check later

post rebase fixes

fix

Part-of: odoo/odoo#116641
2023-05-12 22:59:22 +02:00
Pierre Paridans ffc359dc5c [IMP] web,*: CP's CogMenu rework to add misc items from favorite
Part-of: odoo/odoo#116641
2023-05-12 22:59:17 +02:00
Brieuc-brdandElisabeth Dickinson 21d87a3da5 [REF] *: milk graphical assets
- apps icons
- base: replace demo avatars Mitchell, Marc and Joel
- mail: replace odoobot avatar

Part-of: odoo/odoo#116641
Co-authored-by: Elisabeth Dickinson <edi@odoo.com>
2023-05-12 22:59:14 +02:00
Pulinckx Pierre (PIPU) 608e90e998 [REF] *: Replace underscore functions by native JS
Replace _.map(), _.flatten(), _.delay(), _.contains(), _.pluck(), _.isUndefined(), _.isEmpty(), _.isString(), _.isEqual(), _.isBoolean(), _.memoize(), _.invoke(), _.bind(), _.escape(), _.debounce(),
_.str.sprintf(), _.str.repeat(), _.str.startswith(), _.str.trim(),
_.str.escapeHTML(), _.str.escapeRegExp(), _.str.startsWith(), _.str.include()

closes odoo/odoo#118012

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-04-20 11:57:29 +02:00
Mathieu Duckerts-AntoineandMichaël Mattiello 1c374b9b05 [IMP] web: Advanced Search
The old submenu "Add Custom Filter" of the menu "Filters" is now replaced
by a menu item "Advanced Search". Click on that item will open an
"Advanced Search" dialog in which the current search domain is displayed
in a domain selector. It is then possible to easily add/remove/edit some
parts of that domain before make a new search with the edited domain.

Task ID: 3269923

Part-of: odoo/odoo#118057
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Michaël Mattiello <mcm@odoo.com>
2023-04-13 17:57:13 +02:00
Michael (mcm) ff0d6dd580 [REF] *: replace odoo module by native one
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.

task id: 3162300

closes odoo/odoo#117305

Related: odoo/enterprise#39118
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-04-03 17:07:24 +02:00
Victor Piryns (pivi) 0a755b9a43 [FIX] board: not crash on views with domains and custom layout
Current behaviour:
If you export a view with a (some) filters and you set a custom
layout in the dashboard, you will get a traceback, preventing
you for accessing your newly exported dashboard.

Expected behaviour:
Should not crash when trying to view your exported view,
even with a custom domain.

Steps to reproduce:
- Install Dashboard, Sales
- Export from Sales > List View with a filter Creation Date before
  XX:XX (date is irrelevant)
- Go to Dashboard > My Dashboard > Change Layout to something else
- Exit the page and retry to reopen it, a stacktrace is shown.

Reason for the problem:
When preprocessing the arch of the view in the dashboard, which is an
xml string, there is the domain included, which contains symbols that
are unparsable by `etree` unless escaped (like `<`).

Fix:
Escape the domain client side before being sent and saved in the database,
so when requesting it we don't have a parsing error. Then we unescape it when
the clients reads the domain from the server. The unescaping before
escaping is to avoid problem of double escaping when changing subsequently
the layout of the board view.

Affected versions:
- 16.0
- saas-16.1
- master

opw-3130117

closes odoo/odoo#112334

X-original-commit: bfadb8e491fe2acda63a79f9577eaaec8a1c8d9c
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-02-09 19:07:08 +01:00
Ivan Yelizariev 910cacd262 [FIX] board: use correct tree view id
`board` module allows adding current tree view to My Dashboard menu. It copies
some settings (context, domain, etc.), but not the list view id. Because of
that, default list view is used. However, the default list view might be
different from what user sees in original menu. For example, there are two tree
views for `purchase.order`:

`purchase_order_tree`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase/views/purchase_views.xml#L535

`purchase_order_view_tree`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase/views/purchase_views.xml#L599

But only one of them has field `receipt_status`
https://github.com/odoo/odoo/blob/6b101d5ff0ad78b9ae2ad312f362c2224e7af457/addons/purchase_stock/views/purchase_views.xml#L91

So, that field wasn't available in the Dashboard, which is quite annoying.

Fix it by forcing `viewId`.

STEPS:
- Click on Purchase App > Go to 'Purchase Orders'
- enable all the columns to show in listview (from that 2 arrows of listview on right side corner)
- Once you enable visibility of all columns in listview for Purchase orders list. Just Go to Favourites -> Save to Dashboard, give any name
- Reload the browser.
- Open Dashboard , go to My Dashboard
- Now see the customer dashboard which you create with certain columns is not visible in this Dashboard listview. and no way to make it visible even.

opw-3130088

closes odoo/odoo#111913

X-original-commit: 7e41555d86a9e91176dc024c6e95ec1e748a08f7
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-02-03 19:49:15 +01:00
Aaron Bohy af948c6acf [FIX] board: better display graphs in dashboard
In the legacy implementation of the dashboard action, there was a
scss rule that set the height of the canvas of graph views inside
the dashboard to 300px. During the conversion to owl, this rule has
been lost. As a consequence, graphs in the dashboard look squashed.
This commit restores the scss rule to fix the issue.

Bug reported in the feedback pad after migrating odoo.com to 16.0.

closes odoo/odoo#110352

X-original-commit: 833f7394ecd88825990eb7d1b338e21bfbab55b5
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-01-19 09:13:17 +01:00
Walid HANNICHE (waha) 7f3a4fbb2d [FIX] board: dashboard darkmode
Steps to reproduce:
- add elements to dashboard
- enter dashboard and enable darkmode

Bug:
titles are unreadable because background is white

Fix:
remove CSS property

closes odoo/odoo#110201

X-original-commit: 5b56f1891d618008678d70ad125ad1393abe352b
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-01-18 13:25:51 +01:00
Walid HANNICHE (waha) bcd8081cb4 [FIX] board: prevent add to dashboard with no actionID
Steps to reproduce:
- Go to Purchase -> Reporting -> Dashboard
- click on the "expand" arrows of the pivot view
- favorites - add to dashboard

Bug:
adding a view with no actionID causes the dashboard to crash on load
this [commit] prevents adding a view with no actionID

Fix:
added a default value of False to add_to_dashboard actionId
only display the option to add_to_dashboard for views that have actionId

opw-2965036

[commit]:https://github.com/odoo-dev/odoo/commit/7180d948f084d4f68d1660cb884c95aaf41288fa

closes odoo/odoo#106093

X-original-commit: ff926a5b4390b38db339440c18dd2d5380df7d61
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-11-18 19:42:14 +01:00
FrancoisGe e50bee88c4 [FIX] web: touch a record in a x2m
Before this commit, if a touchstart event is performed on a row in an
x2many, then a crash is displayed.

We also use this commit to rename the hasSelector props to allowSelector.
allowSelector is true if checkboxes can be present.

How to reproduce:
- go to a form view in mobile mode with an x2many field
- touch a row in the x2many (trigger an event touchstart)

Before this commit:
    An error is displayed

After this commit:
    Nothing happens.

closes odoo/odoo#98893

Related: odoo/enterprise#30773
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-30 03:44:56 +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
Mathieu Duckerts-Antoine fb5815edfd [FIX] web,board: remember list orderBy
When adding a (new) list view to the Dashboard app, the list orderBy (if
any) was lost. We fix that.

Part-of: odoo/odoo#92475
2022-06-30 09:29:51 +02:00
Géry Debongnie 3c782440ab [REF] board: rewrite board action in owl
This commit rewrites the board action in owl. Legacy actions are
still supported inside this new board thanks to a compatibility
layer.

Part-of: odoo/odoo#92475
2022-06-30 09:29:45 +02:00
Lucas Perais (lpe) 2cafc7be88 [REF] web, base, website_sale_loyalty: remove unnecessary flags on action
action act_window can have a "flags" field which contains tweaking parameter for the views.
A little inventory:
- ation_buttons: if true displays on List and Kanban the buttons that trigger action
  in the control-panel bottom left area. It is true by default in JS.
- withControlPanel: whether to display the ControlPanel as a whole. True by default.
- search_view: not used or dealt with.
- mode ("readonly"|"edit") whether to initiate a form view in that mode.
  (used and practical -- but will be outdated when the edit mode by default is implemented)

This commit removes the occurences of those flags keys that are useless

closes odoo/odoo#94078

Related: odoo/enterprise#28620
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-06-22 14:28:43 +02:00
Aaron Bohy f573e93bb2 [REF] web,mail: adapt code to new load_views API
Part-of: odoo/odoo#87522
2022-04-29 09:57:44 +02:00
Achraf (abz) cfccd028b3 [FIX] board, project: Allow user to add project_graph to dashboard
If we add the graph view of project in the dashboard
And we access the dashboard a traceback appears

Cause: Unable to evaluate the context because the following information
is missing: "active_id" which is used in the domain

https://github.com/odoo/odoo/blob/4d864c05dfa8f9be25d41bbae318f75a61d0cde2/addons/board/static/src/legacy/js/board_view.js#L254

the solution is to add `globalContext` to the `contextToSave`

https://github.com/odoo/odoo/blob/7e77bb74bfa1bfef92c6d385dedc2d89e0040780/addons/board/static/src/add_to_board/add_to_board.js#L37-L43

`View` is `undefined` because the `project_graph` view is made with OWL
and board is still in legacy

https://github.com/odoo/odoo/blob/4d864c05dfa8f9be25d41bbae318f75a61d0cde2/addons/board/static/src/legacy/js/board_view.js#L274

Since https://github.com/odoo/odoo/pull/84864

The solution is to add a legacy version of the `project_graph`

Apply the same fix for `project_pivot`

opw-2791672

closes odoo/odoo#87883

X-original-commit: 8999277e668f666bc650d508384c4a07ea6c711e
Signed-off-by: Achraf <abz@odoo.com>
2022-04-04 14:45:26 +02:00
Michael (mcm) b81861233d [REF] *: use LegacyComponent
This commit replaces Component by LegacyComponent when the component
uses removed features from owl 1 like getting its `el` or `trigger` an event.
It also adds `useService("rpc")` when component needs it.

closes odoo/odoo#85389

Related: odoo/enterprise#24745
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-03-01 09:57:39 +00:00
Audric Onockx (auon) 73f873ab4c [FIX] board : drag task between personnal stages in dashboard
Steps :
Install Project and Dashboard.
Project > My task > Favorites (search zone) > Add to Dashboard.
Notice you can drag task between stages.

Issue :
Dashboard > Notice you cannot.

Cause :
m2m groupby normally (in kanban_renderer.js) does not allow drag.
project_kanban overrides its _setState() method to allow it for parsonnal
stages, because they "become m2o" with a user.
Yet, in the dashboard, we pass through the default method, because the
wrong view is created.

Fix :
Take into account the js_class in the arch to create the view.

opw-2752072

closes odoo/odoo#85033

X-original-commit: 4d864c05dfa8f9be25d41bbae318f75a61d0cde2
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-26 09:18:51 +00:00
Fabien Pinckaers 10a5796d4b [IMP] speed up load_menus() by using SVG icons instead of png
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.

Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)

closes odoo/odoo#84280

Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>
2022-02-12 08:55:18 +00:00
+2 318cdcc0b8 [REF] *: adapt code to owl 2
Owl 2 changelog: https://github.com/odoo/owl/blob/a9f29c4caad4f32d06be1ec4780572825781cd9b/CHANGELOG.md

Part-of: odoo/odoo#80156
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Géry Debongnie <ged@odoo.com>
Co-authored-by: Samuel Degueldre <sad@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Simon Genin (ges) <ges@odoo.com>
Co-authored-by: Francois (fge) <fge@odoo.com>
Co-authored-by: Michael Mattiello (mcm) <mcm@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
Co-authored-by: luvi <luvi@odoo.com>
Co-authored-by: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2022-02-10 07:46:13 +00:00
Aaron Bohy f3e71d01ee [REF] web: rework env.config
The motivation of this commit comes from breadcrumbs.

Breadcrumbs work as follows: for each controller in the stack of
the ActionService, there is an entry in the breadcrumbs. Except
for the last entry (which corresponds to the currently displayed
controller), the value to display is computed by the ActionService
and stored in this.env.config.breadcrumbs. For the last entry,
we use the displayName set in this.env.config.

When a view wants to update its displayName (e.g. the form view
when we switch to another record), it updates the displayName in
the config, which thus correctly updates the breadcrumbs. However,
this doesn't change the internal values in the ActionService, so if
another controller is stacked over the current one, the penultimate
entry is wrong. To update the internal state of the ActionService,
the event 'controller-title-updated' must be triggered as well,
which is cumbersome. Note that we don't really face the issue yet
because among already converted views, none of them need to update
its displayName in the breadcrumbs.

This commit aims at uniformizing the way the (n-1) first entries
and the last one behave, by making the "breadcrumbs" key encode
all breadcrumbs entries (the n-1 first ones, and the last, current
one). We also replace the "displayName" key by "getDisplayName"
such that it uses a single source of truth, located in the
ActionService, and we provide a function "setDisplayName" to update
it. Finally, this commit introduces the notion of "default config"
which ensures that standalone views, or views in tests, have a
valid config with expected keys.

closes odoo/odoo#81031

Related: odoo/enterprise#22799
Signed-off-by: Géry Debongnie <ged@odoo.com>
2021-12-13 12:24:50 +00:00
Mathieu Duckerts-Antoine 64c8e4eadd [FIX] board: graph height
The commit 3862d5aae1df72d3585f915e8a2a2626322e74ad has changed the class
set on the root node of the graph renderer but has not adapted a css rule
used in the board app to ensure that the graph views have the correct
height. We fix that situation.

closes odoo/odoo#80047

X-original-commit: b08bc57d5ba2e0da17a452189d584574fb2f9832
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-11-23 06:46:52 +00:00
Mathieu Duckerts-Antoine e0cbf4739d [FIX] board: save correct domain
Since 40f1ae87e1436192a70a8a7432eb72d379cfa6dc, a view added to the board application would not
have the correct domain:
    - the action domain was not kept in the saved domain
    - the saved domain was kept dynamic, leading to possible crashes
      e.g. a condition like ("user_id", "=", uid) in the saved domain
      would make crash the dashboard app.
We fix the problem and add a test.

X-original-commit: 7e77bb74bfa1bfef92c6d385dedc2d89e0040780
Part-of: odoo/odoo#80047
2021-11-23 06:46:52 +00:00