Commit Graph
11279 Commits
Author SHA1 Message Date
3fea5b2136 [REF] mail, *: refactor messaging with OWL
This commit is a significant rewriting of client-side discuss, chatter,
chat window, and messaging menu using OWL. The behavior should be broadly
the same, with some slight functional changes here and there.

From a technical standpoint, the code of messaging is mainly organized in 2
main groups of modules:

- models, which are logical entities that depict the client-side state of
  messaging as a whole.
- components, which are in charge of displaying information from models.

This refactoring also introduces new JS guidelines regarding folder structure
(/static) and naming rules for JS modules.

Community PR: https://github.com/odoo/odoo/pull/39023
Enterprise PR: https://github.com/odoo/enterprise/pull/6249

Task-1914207

This PR is a collaborative work by Alexandre, Julien, Sébastien and Xavier,
with the precious help of Lucas to speed it up towards the end.

closes odoo/odoo#39023

Related: odoo/enterprise#6249
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Co-authored-by: Alexandre Kühn <aku@odoo.com>
Co-authored-by: Julien Giannone <jgi@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
Co-authored-by: Xavier Dubuc <xdu@odoo.com>
2020-06-15 18:12:21 +00:00
4197ebfabc [IMP] web: add options to formatFloatTime
This commit adds noLeadingZeroHour option to formatFloatTime.
The noLeadingZeroHour option can be used to format the value
like 1:30 instead of 01:30

This format behaviour is wanted for fields in web_grid module.

Task 2261853

closes odoo/odoo#52217

Related: odoo/enterprise#10870
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Hardik Prajapati <hap@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
2020-06-15 13:53:21 +00:00
Mathieu Duckerts-Antoine 7002bdb239 [FIX] web: always use filter_domain for search panel counters
The counters for categories were not updated when filter values were
selected. This commit fixes that situation.
This might impact the global performances of the search panel but
there is still room for improvement. Actually, it could be
possible to reload categories and filters less often by carefully
track the internal changes and the categories/filters attributes
(enable counters, expand,...).

closes odoo/odoo#49307

Related: odoo/enterprise#9795
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 13:34:04 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot 46306b95d8 [IMP] web: expand domain != count domain
In the search panel, the domain used to compute the field image values
(when the attribute expand is false) was the same as the domain used
to compute counters (if enabled). The idea was that a value bringing an
empty domain is totally useless and should not displayed.
That being true, it turns out that if one does not allow them and
several fields are used, selecting a value in the search panel will very
often totally transform the search panel. From a UI perspective,
this turns out to be bad: the search panel 'moves'.
Let us give an example:
Let us start from a search panel that looks like to:

first_field
    A  1
    B  3
second_field
    C  1
    D  2 <--- mouse above D
    E  1

with first_field and second_field both with expand="0" and
enable_counters="1". Let us also assume that no record in the global
domain has both first_field=A and second_field=D.
Click on D would make the search panel look like to something like

first_field
    B  1
second_field
    C  1
    D  2
    E  1 <--- mouse here

(the selection of D does not impact the values for the second_field but
does for the other first_field values).

This has led us to use basically only the domain comming from
outside of the search panel to compute field image values.

This means that we might now have value with zero count even if expand
is false. In the above situation, a click on D would give us

first_field
    A
    B  1
second_field
    C  1
    D  2 <--- mouse still above D
    E  1

Task ID: 2154749

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-12 13:34:04 +00:00
Mathieu Duckerts-Antoine 3306a0f414 [IMP] *: limit in search panel
This commit introduces a new attribute 'limit' for search panel fields
that allows to avoid performance issues. That integer attribute (with
default 200) allows to fix a maximal number of values to display for the
fields. When the number of field values to display reaches the limit,
no values will be displayed. Instead, a warning message will be shown
in the corresponding search panel section.
Note it is possible to have no limit using limit="0" on a field.
This commit reintroduces in a better way the principle brought by the
fix 8d57153b34c04952a85f6642951cb2697016da84.

Task ID: 2154749
2020-06-12 13:34:04 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot e5585c078e [IMP] *: expand and hierarchize in search panel
The commit introduces two new attributes for search panel fields:

    - hierarchize: boolean attribute (default True) available for
      many2one fields with select="one". It allows to choose whether
      to hierarchize the field values using the _parent_name (if set)
      on the field comodel.
      Note that a sanitization of the parent hierarchy takes place.
      Basically, it ensures that parent chains are
      completely in the domain (on comodel) accessible by the user.
      See _search_panel_sanitized_parent_hierarchy documentation for
      more information.

    - expand: boolean attribute (default False) available for many2one
      and many2many fields. If set to true, all field values are fetched
      and displayed in the search panel. If set to false, only the
      values that have at least one corresponding value in the field
      model (and in some domain) are fetched.
      An exception in the case of an hierarchized field
      (hierarchize=True and _parent_name set): more/less values can be
      displayed in order to have a good representation of the parent
      hierarchy. That means we complete and sanitize the set of initial
      field image values.

Note that the fix 8d57153b34c04952a85f6642951cb2697016da84 bringing the
notion of limit in search panel has been reverted in the present commit.
An upcomming commit will reintroduce the limit principle in a better way.

Task ID: 2154749

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-12 13:34:04 +00:00
Julien Mougenot f5f0ca843d [IMP] *: enable_counters with false as default
In the search panel, the attribute disable_counters with default False
has been changed to enable_counters with default False.
2020-06-12 13:34:04 +00:00
Aaron Bohy b4ba0fc340 [FIX] *: adapt tests to env rework
This commit adapts tests following recent changes on the helpers.
The main change is that addMockEnvironment (and all functions using
it) are now async, as they need to wait for services to be started.
2020-06-12 09:47:48 +00:00
Aaron Bohy dc260c3241 [IMP] web: tests: rework mock helpers
This commit reworks the test helpers, following recent changes on
services deployed in the Owl env.
2020-06-12 09:47:48 +00:00
Aaron Bohy 26fe23201b [IMP] web,*: properly define env in the frontend
*bus,mail

This commit extracts the common basis of the env to use both in
the frontend and the backend. The public env now contains most of
the features that were previously (only) in the webclient env.

Moreover, the PublicRoot no longer uses the ServiceProviderMixin,
such that services are only deployed once, in the (public) env.

Owl components can now be defined in the website, and rely on a
properly built env. Legacy widgets still works as they access
services through the PublicRoot (via trigger_up) which redirects
those requests to the env.
2020-06-12 08:04:14 +00:00
Julien Mougenot c4786fccfd [IMP] *: update notifications to optional title
closes odoo/odoo#52826

Related: odoo/enterprise#11084
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 09:01:50 +00:00
Julien Mougenot d093fd4236 [IMP] web: close button on non-sticky notifications 2020-06-12 09:01:50 +00:00
Julien Mougenot 7cadc21611 [IMP] web: review notification style 2020-06-12 09:01:50 +00:00
Lucas Perais (lpe) eaa37eaf84 [FIX] web: force webclient to finalize its loading
When the web client is completely ready, it triggers an event "web_client_ready" on the bus
Some Mail OWL components rely on that mechanism to be mounted
i.e. DialogManager and ChatWindowManager

When eveluating the action to display at startup, the webclient mechanism
implies that we push the location hash each time a relevant data is available
e.g. menu_id etc...

Now, before this commit, since the hashchange handler is bound before that evaluation
it is actually triggered each time the JQuery bbq pushed a url state (this is in the API)
doc: http://benalman.com/code/projects/jquery-bbq/docs/files/jquery-ba-bbq-js.html#jQuery.bbq.pushState

This undercuts the initial loading promise chain to finish and the event "web_client_ready" was never triggered
preventing everything that relied on it to be mounted

After this commit, the webclient is artificially finalized, with the help of a new custom event
"webclient_started". So the event web_client_ready is triggered,
signalling to everyone it is in the dom and usable

A lot of bug persist though: the start() of webClient sometimes returns a rejected promise

It is worth noting that the hashchange mechanism is largely outdated and will change
in a more reliable way in the near future with the conversion of the webClient to OWL
the drop of JQuery BBQ and the direct reliance on window.history.pushState
doc: https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#:~:text=The%20state%20object%20is%20a,the%20history%20entry's%20state%20object.
and on the window's "popstate" event
doc: https://developer.mozilla.org/en-US/docs/Web/API/Window/popstate_event

This commit must be applied on the enterprise webclient too

closes odoo/odoo#52892

Related: odoo/enterprise#11114
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-12 08:26:40 +00:00
jvm-odoo 149763f372 [FIX] web: load_translation fallback to url language
Issue

	- Install eCommerce, Sales, Stock, Product availability
	- Install another language & add it to website too
	- Create a product
		- eCommerce tab select 'Availability Show ':
		  inventory below a threshold and prevent
		  sales if not enough stock
	- Go to website, publish it
	- Private tab > go on your website url
	- Open the product page
	Availability text should show up
	- Switch language without debugger open
	Availability text not translated
	- Open debugger with disable cache
	- Refresh
	Availability text translated

Cause

	In this case, we have no user_context,
	but the load_translation is based on
	the user_context language.

	Since lang = undefined, we use the cached language

Solution

	Fallback to the context language if the user_context
	langague is not defined

OPW-2244843

closes odoo/odoo#52868

X-original-commit: a9a756cf75963e0771a05859b29b03f08ae592b1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-06-11 14:53:25 +00:00
Thibault Delavallée 574dd61351 [HACK] crm: allow ordering on my activities deadline
RATIONALE

Activities are a way to organize our daily pipe. Notably in a sales pipeline
salesmen may have multiple leads with activities to perform in the next few
days. We would like to be able to have a list view displaying a list of leads
with "my" deadline, and to order leads based on this field.

PURPOSE

As activities are linked to records through a one2many and as my activities
are only a subset of those activities, it is impossible to store a field
on lead model. Indeed it would depend on the current user which makes storing
it impossible.

However ordering on a column in list view asks for a stored field. As it is
not possible, this commit proposes to hijack the web client and search of lead
model in order to allow it.

SPECIFICATIONS

Introduce a activity_date_deadline_my field, computed and searchable that
behaves like activity_date_deadline. It is filtered on current user activities
instead of being global to the record activities. "My" deadline is the earliest
deadline of my activities, even in the past.

Ordering through web client calls search_read with an order parameter set.
Search_read then calls search. In this commit we therefore override search
to intercept a search without count with an order on activity_date_deadline_my.
In that case we do the search in two steps.

First step: fill with deadline-based results

  * Perform a read_group on my activities to get a mapping lead_id / deadline
    Remember date_deadline is required, we always have a value for it. Only
    the earliest deadline per lead is kept.
  * Search leads linked to those activities that also match the asked domain
    and order from the original search request.
  * Results of that search will be at the top of returned results. Use limit
    None because we have to search all leads linked to activities as ordering
    on deadline is done in post processing.
  * Reorder them according to deadline asc or desc depending on original
    search ordering. Finally take only a subset of those leads to fill with
    results matching asked offset / limit.

Second step: fill with other results. If first step does not gives results
enough to match offset and limit parameters we fill with a search on other
leads. We keep the asked domain and ordering while filtering out already
scanned leads to keep a coherent results.

All other search and search_read are left untouched by this commit to avoid
side effects. Search_count is not affected by this commit.

As web client order availability is simply based on field being stored we
have to allow hijacking its value. A new option 'allow_order' is added that
display the order icon in list view column headers. It allows calling
search_read with an order based on the column but nothing more. Using it
on a not-stored field will give a warning log and ORM ignores it by default.

LIMITATIONS

At least following limitations apply

  * search on "my activities" gives a list of ids that is used for searching
    and ordering. It means that having too much activities on a given user can
    result in poor performances.
    -> we consider that activities assigned to a given user should be kept
    under control. Leads with activities for a given user should be a small
    subset of leads without activities.
  * ordering on activity_date_deadline_my always put those records on the top
    (deadline asc or desc) whatever the actual ordering of order items given
    to search. This is done to avoid complex implementation where deadline
    would be used to order records within groups ordered by another field.
    -> for example: order = 'priority DESC, activity_date_deadline_my ASC'
    actually behaves like 'activity_date_deadline_my ASC, priority DESC'.

WARNING

This implementation is a hack. It has been done by professionals. Do not try
to do it at home.

More seriously this is hackish and should be avoided. IN our case we consider
that the use of activities in sales pipeline is mainly driven by "my activities
deadline", which is not necessarily the case with longer processes like tasks.

Moreover user tests tend to show that this feature could be interesting. It
will improve quality of Odoo CRM and its adoption by improving its daily
use. A framework solution has to be found. Until this is done we keep this
hack and hope it is not duplicated in other applications.

LINKS

Task ID 2276011
Prepares Task ID 2243124 (My activities in CRM)
PR #52232

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-06-11 15:17:52 +00:00
Julien Mougenot 65a952e999 [IMP] web: remove color from 'Start typing' option
closes odoo/odoo#52842

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-11 11:16:32 +00:00
Lucas Lefèvre 997d21a67e [IMP] web: Allow to use a custom control panel
The abilty to use a custom control panel for an action
seems to have been lost with 18e5416.

With this commit the action config can specify a custom
component to use as control panel.

Usefull for o-spreadsheet integration.

Task 2238915

closes odoo/odoo#52807

Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2020-06-11 07:41:02 +00:00
Pierre Rousseau 8878cf45a8 [IMP] web: expose pivot variables
This is useful for integration with spreadsheet.

closes odoo/odoo#52582

Task-id: 2168016
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2020-06-11 05:35:53 +00:00
Pierre Rousseau b906ba08b9 [IMP] web: allow to add buttons to pivot controller
This is useful for the integration of pivot views with spreadsheet

Task-ID: 2168016
2020-06-11 05:35:53 +00:00
Julien Mougenot 4f116a0f9b [REF] web: clean 'M2O._search'
closes odoo/odoo#52347

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-10 14:45:56 +00:00
eacbec1e03 [IMP] web,*: highlight quick create feature to user
Generally, Users are not necessarily aware that they can quick create a most
records by simply typing in their name+enter in the many2xxx field input.
The exact purpose of this commit is to make sure the user discovers the quick
create feature of our many2xxx fields.

For that, when the input is empty, display 'Start typing to create a record...'
at the bottom of the dropdown when can_create is set and no_create_edit option
not set. So the user can easily understand that by typing and pressing enter
will create the new record.
Also "Search and Create" options in the dropdown only been shown to the user
when it type anything in the input box as the same case in the "Create" option.

Task : 2266557

Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-10 13:08:33 +00:00
Julien Mougenot a392da1601 [IMP] web: add 'Create and edit' test helper
Accessing the "Create and edit" option can be bothersome when testing:
- you must click on the m2o dropdown to open it
- input a value
- click on the "Create and edit" m2o item

Now, a helper exists to compile all these tasks into a single helper:
the many2one 'createAndEdit' function.

Usage:
`await testUtils.fields.many2one.createAndEdit('m2o_field', "ABC");`
2020-06-10 13:08:33 +00:00
Julien Mougenot a425c58d99 [IMP] web: mock server: enhance default get
Before this commit, the mock server "_mockDefaultGet" method was a bit
naive:
- it accepted any 'default_' field coming from the 'kwargs.context'
  regardless of the existence of the field
- it accepted any value for these fields

Now the method is looks a bit more like its original server-side
counterpart:
- the context keys are added if they correspond to actual fields
- a pseudo validation removes many2one fields values not corresponding
  to any record
2020-06-10 13:08:33 +00:00
Hardik Prajapati e1e9e8c780 [IMP] web: replace property field icon with tooltip
PURPOSE
The purpose of this task is to improve the interface by removing the
fa-building icon which is automatically appended by the property field
(i.e. company-dependent) and, instead, indicates that a field has
company-specific values in the tooltip of the field.

closes odoo/odoo#52313

Taskid: 2266519
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-10 12:25:42 +00:00
Mathieu Duckerts-Antoine a758f8f307 [FIX] web: don't forget initial registry entries
The entries comming from the optional parameter 'mapping' passed at the
instantiation of a registry were never considered when returning the
registry keys or entries. This is no longer the case.

closes odoo/odoo#52768

X-original-commit: e094ddd0ffaf3357e64ca5941ffc2e0454c24ab7
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2020-06-10 11:57:54 +00:00
Dhruv Patel 3288304f59 [IMP] web,*: make notification title optional
*odoo_referral,portal

Currently, it is not possible to have one line notification,
when you are not passing the title parameter as an option when
generating the notification,then it will display the blank div
with the default button icon only. so it is not possible to have
one-line notifications since the title is mandatory.

So the purpose of the task is to make the title optional, allowing
for more minimalistic notification.

Also removed some unnecessary titles from the notification and
some stying change.

This commit also increase the autoclose delay of non sticky
notifications, from 2.5s to 4s.

task : 2264749

closes odoo/odoo#52229

Related: odoo/enterprise#10981
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Dhruv Patel <dhp@odoo.com>
2020-06-10 08:36:05 +00:00
Julien Mougenot a3e5ac19b2 [REF] web: update control panel doc
Class documentation for the control panel component has been updated
to reflect the changes on the comparison menu and the advanced search.

closes odoo/odoo#52662

Related: odoo/enterprise#11022
Signed-off-by: Mathieu Duckerts-Antoine <Polymorphe57@users.noreply.github.com>
2020-06-09 09:24:21 +00:00
Michael Mattiello (mcm) 1019e1529c [FIX] web: update owl to last version
This commit updates owl from v1.0.8 to v1.0.9.

closes odoo/odoo#52657

X-original-commit: 584b1f428ace121b125699ee93ee500fe069a5bd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-09 08:04:03 +00:00
Mohammed Shekha 030d8ec6f0 [FIX] web: hide list selection box after multi record save
Before this commit, list selection box was not hidden after multi
record edition.

task-2266999

closes odoo/odoo#52590

X-original-commit: ac46e9f82b7cbfc55f395b66b2011399b9f972f1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-08 11:29:59 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot 087724fa9e [IMP] *: adapt tests to comparison menu
Tests have been adapted accross all affected modules to support the new
"comparison" menu component.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-04 19:32:52 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot 271dfe9ba3 [IMP] web: adapt test_utils_control_panel
The control panel test helpers related to the "time range" menu have
been removed and a new helper for the "comparison" menu has been added.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-04 19:32:52 +00:00
Mathieu Duckerts-AntoineandJulien Mougenot be5a51a345 [IMP] web: Comparison menu
This commit replaces the "time range menu" in the control panel by a new
component: the "comparison menu".

Its purpose is roughly the same: compare a period of data in a reporting
view with the previous period or the previous year.

Its implementation is a bit simpler: it will only appear if at least one
date filter is selected in the search view, and will suggest to compare
each selected date option with the previous period or the previous year.

Task ID: 2245719

Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Julien Mougenot <jum@odoo.com>
2020-06-04 19:32:42 +00:00
Julien Mougenot 884ef9f7ee [REF] web: force dropdown menu icon through getter
Before this ref, the dropdown menu got his icon directly from his props.
This means that any inheriting class had either to define its icon with
the 'default_props' key or to have its parent giving it in the props.

Now, the icon is retrieved from the props via a getter (same as title
and items) and can be overridden to force a fixed icon on the class.
2020-06-04 19:32:01 +00:00
Michael Mattiello (mcm) b7840dde39 [IMP] web: add nolabel to list view
This commit adds the support of nolabel attribute on fields
in list view. This attribute can be used to empty the column header.

Example of use:

<record id="module_example_tree_view" model="ir.ui.view">
  <field name="name">module.example.tree.opportunity</field>
  <field name="model">module.example</field>
  <field name="arch" type="xml">
    <tree>
      <field name="name"/>
      <field name="tag_ids" widget="many2many_tags" nolabel="1"/>
    </tree>
  </field>
</record>

Result:

This will create a tree view with 2 columns.
The second column will have an empty header and won't be sortable.

Name    |
--------+--------------
Record1 | [tag1]
Record2 | [tag1][tag2]
Record3 | [tag2]

closes odoo/odoo#52302

Task: 2269315
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-04 06:02:32 +00:00
Sébastien Theys 499bbfd5c3 [IMP] web: various Popover improvements
Close can now be requested by children (slot content) with the event
`o-popover-close`. This feature is necessary if we want a "close" button inside
the popover itself, which is the case for mail.activity "Mark Done".

Clicking on the popover target now acts as a toggle, which is also a feature
that was expected from the previous popover implementation.

Add a specific class (`o_is_open`) when the popover is displayed to be able to
style its target depending on whether it is displayed or not.

Ensure computed position is whole number of pixels to prevent flicker issue on
Firefox.

Remove forced width to let the component grow with its content.

Add appropriate z-index to prevent overlap issue with the rest of our interface.

closes odoo/odoo#50850

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-15 14:05:55 +00:00
Julien Mougenot d5df0cddf4 [IMP] web: add spacing to list buttons
A slight margin has been added between list view buttons to improve
clarity.

closes odoo/odoo#52254

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-06-03 08:39:13 +00:00
qsm-odoo 00f70f7936 [IMP] website, *: allow to use a color preset for menu and footer
*: web_editor, web

Also now allows to control the copyright section color.

This commit also allows to use color name alias when the user choose
one of the 5 main colors or a gray color for one component (e.g. if the
user picks 'o-color-1' as the color for its text in preset 4, then it
will no longer be linked to the current css color of 'o-color-1' but to
'o-color-1' directly; meaning that if that color changes in the future,
so will the text of preset 4).

Part of https://github.com/odoo/odoo/pull/52223
task-2197038
2020-06-02 12:17:23 +00:00
qsm-odoo 66c99b86b3 [IMP] web, *: stop automatic color for text for transparent bg classes
* web_editor

Now, if the opacity of the bg color for a bg classes is lower than x
(currently 0.3), the class will only control the bg and not the text
and other components anymore. This behavior is disabled for presets
though (otherwise the text color would be "undefined").

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
qsm-odoo 55c90cc9fa [IMP] website, *: allow presets user edition
*: web, web_editor

Now, the user can edit each individual component of each color preset
thanks to the third tab of the left panel. The edition of the first
preset is the same as the others for the users but it is actually
also used for "no-preset" areas, meaning that they impact the whole
website by default (*without impacting the other presets*). The website
thus appears as areas using presets, preset 1 being the default (in the
future all areas will be customizable with a different preset). The only
difference between "using preset 1 explicitely" and "not using a preset"
will be that background color is transparent in no-preset, leaving the
body background appear. If the body background has no image, then there
is no difference at all as the background color of the body is set to be
the background color of the preset 1. In boxed mode, that color is used
for the "box" and the website body uses a different customizable color.

Note: before this commit, the "text" color edition was used to set the
main text color and one of the constrasting color for the color-yiq
function (the darkest if a dark color or the lightest if a light color).
That last part has been removed and automatic colors will now always
use $gray-900 and $white as contrasting colors, unless changed by the
theme explicitely. This needed to be removed as now the "text color"
edition has been moved in the "preset 1" config and should thus only
impact the "no-preset / preset 1" areas instead of all the presets.

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
qsm-odoo 69190959ce [IMP] website, *: introduce new classes to color snippets
*: web, web_editor, website_blog, website_event

New o_cc${xxx} classes where ${xxx} is a number [1-5] to style snippets:
they come with a background color, a text color, headings colors, a
link color, primary button colors and secondary button colors which
will later be possible to customize by the user.

The classes are made so that they are working on two levels. So if a
column receives a color class and the snippet too, everything will work
fine. More than 2 levels are not supported and the editor is made so
those cases should not appear. See o_colored_level class.

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:19 +00:00
stefanorigano (SRI) 6aa93a9c06 [FIX] web: set the right text-muted from rgba value for o-bg-color mixin
Correctly generate a text-muted color starting from an rgba value.
The 'scale-color' function will take in account the source color's
alpha, decreasing its value.

e.g.
```
$color: rgba(#fff, 0.7);

$muted: rgba($-yiq-color, 0.7);
  -> rgba(#fff, 0.7) (same as source value)

$muted: scale-color($-yiq-color, $alpha: -30%);
  -> rgba(#fff, 0.42) (correct)
```

Part of https://github.com/odoo/odoo/pull/45856
task-2197038
2020-06-02 09:42:18 +00:00
qsm-odoo 78d5b744f5 [IMP] website, *: introduce a way to define outline buttons by default
*: web, web_editor

Disable the automatic generation of bootstrap color buttons and do it
ourself with a tweak: we introduce btn-fill-* (working as the normal
btn-* classes (in opposition to btn-outline-* classes). We then map
btn-* classes to either btn-fill-* or btn-outline-* classes depending
on the configuration (with a sass extend).

Part of https://github.com/odoo/odoo/pull/52220
task-2197038

closes odoo/odoo#52220

Related: odoo/design-themes#288
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-06-01 10:48:53 +00:00
qsm-odoo 18294864ab [IMP] website, web: add link decoration option
Also extend bootstrap to not use that style on specific elements like
btn, dropdown-items, etc.

Part of https://github.com/odoo/odoo/pull/52220
task-2197038
2020-06-01 10:48:22 +00:00
qsm-odoo be6a8cfde7 [IMP] website, web, *: allow to choose website font-size
*: web_editor

Note: this work also prepare the code to be able to support different
font configs per font family.

Part of https://github.com/odoo/odoo/pull/52220
task-2197038
2020-06-01 10:48:08 +00:00
Romeo Fragomeli 16fabc8227 [REF] web: allow override tooltip options
Before this commit, the options of the tooltip where set inline.

After this commit, the options are returned by a function.
This allow us to adapt these options in another module.

Task ID: 2152124

closes odoo/odoo#52170

Related: odoo/enterprise#10864
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-05-29 13:31:31 +00:00
Mohammed Shekha ed2f14784d [IMP] web: cursor pointer on hover graph legend
Before this commit: hovering on graph legend shows cursor default
here hovering on legend should display cursor pointer, so user
can easily understand it is clickable element

After this commit, hovering on graph legend will display cursor
pointer.

task-2263703

closes odoo/odoo#52030

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-28 05:58:39 +00:00
Dhruv Patel bf9890f98c [FIX] web: force refresh on expired session popup button click
Currently, when the session expired then it generates the popup that
"Your odoo session expired. Please refresh the current page."
Now once you click on the "Ok" button only close the popup and user have to
manually do refresh the page.

with this commit, we have changed the text of the popup to
"Your odoo session expired. The current page is about to be refreshed." and
when user click on "Ok" button forcefully refresh the page.

Task : 2241744

closes odoo/odoo#50710

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-29 08:00:01 +00:00
Aaron Bohy 042b4060bd [IMP] web: list: display adjacent buttons in same column
Adjacent buttons in the arch are now displayed in a single column
in list views (main and x2many views). As soon as there is a node
in-between (even if it is invisible="1"), the rule doesn't apply
anymore and buttons placed before/after that node are rendered in
a separated column.

Task 2261774

closes odoo/odoo#51970

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-29 07:40:24 +00:00
jvm-odoo 0ef9289238 [FIX] web: fix IE/Edge dropdown clear
Issue

	- Have IE 11 or not chromium-based Edge
	- Install Contacts
	- Add a salesperson on any contact
	- Save
	- Try to remove the salesperson with
	  the cross icon on the input
	- Save

	The value comes back

Cause

	We do not handle this feature in dropdowns

Solution

	Remove the dropdown cross icon

OPW-2262749

closes odoo/odoo#52083

X-original-commit: cdb072372bfaa3cdc85e7b6d79ad848e8d071e00
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-05-28 11:34:36 +00:00