Commit Graph
104 Commits
Author SHA1 Message Date
Elisabeth Dickinson 8a01be5d62 [IMP] base: redesign company image
Align style of company_image.png with avatar_grey.png to keep interface
and usage coherent.

Task-2487489
Task-2688887

closes odoo/odoo#80304

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-24 12:31:17 +00:00
Jérémy Hennecart b785cdc211 [MOV] appointment: rename module to match enterprise part
Rename website_calendar module by appointment in order to match
the changes on the enterprise part.

We now no longer use the website module to manage the basics of
online appointments. The portal module is now used in its place.

For additional info, check the enterprise PR.

task-2427015

closes odoo/odoo#72241

Related: odoo/upgrade#2492
Related: odoo/enterprise#18426
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-08-20 06:50:33 +00:00
William Braeckman 2315b9bf8d [IMP] base: update timesheet_grid icon
The timesheet_grid icon changes when enterprise is present. This changes
the icon from base to the one from enterprise.

Closes: odoo/odoo#72336

Task ID: 2531317
2021-07-07 07:08:33 +00:00
Aaron Bohy a5091fee99 [REF] *: rework webclient test helpers
This commit splits the 'getActionManagerTestConfig' helper into 2:
'setupWebClientServiceRegistry' and 'getActionManagerServerData'.

The first one is now automatically called by the 'createWebClient'
helper, as it properly setups the service registry with all services
required by the WebClient component.

The second one generates a few data (menus, actions, views...) that
can be used in tests. That helper is mainly useful for action tests
(formerly ActionManager tests) in web. With this refactoring, they
are no longer generated for each test in the whole codebase that
spawns a webclient, as before this commit.

closes odoo-dev/odoo#906

Related: odoo-dev/enterprise#161
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-18 21:31:30 +02:00
stefanorigano (SRI) abab4685dd [REF] web, base: settings page, design adaptations
Use predefined variables rather than arbitrary values, fix minor
alignment issues.
2021-06-18 21:31:28 +02:00
+1 14bffd983e [REF] *: adapt code to new owl webclient
This commit adapts the community codebase to the rewriting of the
/web application in owl.

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: Lucas Perais (lpe) <lpe@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
2021-06-18 21:31:27 +02:00
Barad Mahendra 2b55c4f951 [IMP] base,sale_(project): generic improvements for project
Currently, empty help content are not properly added so in this
task add the proper help content on several menu and add module
field service in community.

So in this commit done the below changes:
 - Task form view: change the tooltip of the sale_line_id field
 - Change the empty help content in below menu:
   - reporting > tasks analysis
   - Configuration > Stages
   - Project > Reporting > Project Costs and Revenues
 - base: The industry_fsm module should show up under Apps in community,
with the usual 'upgrade' button

closes odoo/odoo#68940

Taskid: 2465012
Related: odoo/upgrade#2369
Related: odoo/enterprise#17548
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-05-05 06:21:31 +00:00
Michael Mattiello (mcm)andAaron Bohy 54ea956490 [FIX] web,base: save when tab/browser closes
PR [1] introduced the auto save feature (changes in form and list
views are automatically saved when the view is left, e.g. with
the pager, breadcrumbs, stat buttons, menus...).

However, there was one case that had been left aside: when we close
the tab or browser. This commit ensures that we also save the
changes in this case.

The record is saved only if it is valid, otherwise the changes are
simply lost (we don't block the tab/browser from closing itself).

Moreover, the beforeunload handler must be *almost* sync (a few
ms setTimeout seems ok, but definitely not an rpc roundtrip). For
that reason, we cannot wait for onchanges to apply before saving.

part of task 2330101

[1] https://github.com/odoo/odoo/pull/60693

closes odoo/odoo#65561

X-original-commit: 9949ea14e4f27ca8c0fc84d726ad0434e2e216b8
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2021-02-04 15:46:28 +00:00
Michael Mattiello (mcm) d1c56ec7c4 [IMP] web, base: auto save
This commit adds the auto save for editable list and form views
but not for settings.

Now with auto save, changing the pager, going back in the breadcrumb,
going to an other action or clicking on a menu item won't ask to
confirm changes if any but will automatically save them.

In settings, the confirm dialog has been revamped.
We can now decide to "Save" or "Discard" the changes or "Stay Here" to
do nothing.

task 2330101
2021-02-02 12:40:22 +00:00
wan 864f962145 [IMP] base: do not resize module icons
Most of the modules have a square icon but some don't. For instance, the
flags of l10n modules, or other third party modules.
Flags have very specific proportions, and we don't want them to be
resized when rendered.
While we could hardcode a square icon for each problematic icon, it
would be more manipulations, and the flags are already in the repo
without the right proportions; we don't want to duplicate binaries.

The many2many `module_ids` kanban field of the uninstall wizard has also
been updated to look more like the generic kanban view for the modules.

The classes in the kanban view of `fleet_vehicle_model_view_form` seem
to have been copy-pasted and are useless. It has been removed to reduce
future possible side effects of changing css.

closes odoo/odoo#56421

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-01-15 15:56:47 +00:00
Krina Oza 036b7720d0 [IMP] various: Updated App icons for various modules
In this commit icons of the following modules are updated:

-fetmail
-hr_skills
-iap
-mail_bot
-microsoft_calendar
-partner_autocomplete
-payment_alipay
-payment_odoo_by_adyen
-payment_payulatam
-sale_timesheet
-sms
-snailmail
-test_exceptions

TaskID:2378861

closes odoo/odoo#62291

Related: odoo/enterprise#14958
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-11-25 11:09:53 +00:00
Ivan Yelizariev 75e9e55080 [FIX] web: stop showing translation alert in settings
STEPS:
* install module "account"
* activate at least one additional languages
* go to Settings as set value to "Default Terms & Conditions"
* click Save
* again at Settings make any changes in any field
* click Save

BEFORE:
* while page is reloading you see alert "Please update translations of: Terms &
Conditions"
* once page is reloaded the alert is gone
* the alert doesn't depend on weither translations are done or not

AFTER: no annoying alerts

WHY:
* in res.config.settings any field with default values (i.e. almost all fields)
are marked as changed

  https://github.com/odoo/odoo/blob/d652dbb9655d98b4121ac685e6444bbf7e303292/odoo/addons/base/models/res_config.py#L493
  https://github.com/odoo/odoo/blob/93a2e85ae7b11f9a390f40f74e6d78e1ec876fc3/addons/web/static/src/js/views/basic/basic_model.js#L254

* the idea of alert is suggesting to translate just changed fields

  https://github.com/odoo/odoo/blob/93a2e85ae7b11f9a390f40f74e6d78e1ec876fc3/addons/web/static/src/js/views/form/form_renderer.js#L136-L140

* saving settings always leads to reloading
  https://github.com/odoo/odoo/blob/93a2e85ae7b11f9a390f40f74e6d78e1ec876fc3/odoo/addons/base/models/res_config.py#L639-L647

* So, the alert cannot work for Settings page. There is no better option for
stable branch than just disabling it

---

opw-2346644

closes odoo/odoo#62024

X-original-commit: 5c6850788bd453cae82b6a58f99d11266370277a
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2020-11-19 14:15:58 +00:00
Simon Genin (ges) 2d98708f92 [FIX] base: x2many edition on res.config.settings form views
Before this, a one2many relation in a settings view would not work.
After the save, the added data in the field would be cleared.

Now, the data is still present.

With the change made to BaseSettingsModel the 'base_settings_tests' need
to only use the res.config.settings as fake data model. (relations towards
other models are still ok though). The test file is therefore altered
to comply to this new rule.

Note that this commit only validates the good behavior on the frontend side,
as a one2many relation towards a res.settings can't be done simply in
python as it is a transient model (forbidden).

Task ID: 2274168

closes odoo/odoo#57401

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-09-17 14:26:16 +00:00
Victor Feyens 2f3dcb8947 [IMP] base,website*: do not store country flags.
1) Avoid the storage of all country flags as ir_attachment (230+
ir_attachment in a new db) to reduce the filestore of databases.

The country flags are nearly static and not expected to be modified on
Odoo instances.

This change is based on the new "image_url" widget logic (see previous commits).

2) Extend the flag coverage for countries

Add the missing country flags & specify a mapping to provide flags
for overseas administrated countries/territories.
2020-09-02 16:43:45 +00:00
38b7462dcf [REF] web: BasicModel: combine default_get and onchange
This commit adapts the BasicModel to combine calls to `default_get` and
(first) `onchange`.  When creating a new record, we now only call
`onchange`, which thus return default values and potential onchange
values.

Tests (and the MockServer) have been adapted accordingly.

NOTE 1.  If the `default_get` within the `onchange` returns a value for
a field that is not in the view, we ignore it, and it won't be saved.
Before, that value was kept and sent upon save.  This change in behavior
may prove problematic, although the overall risk is small.  Decision has
been made to keep heavy comments and code snippets if we were to revert
back somehow to the previous situation.

NOTE 2.  Putting a context on a many2one field may change the value
returned by `name_get` for that field.  By default, the calls to
`name_get` are done by `onchange`.  If the context on a field must be
used for `name_get`, one has to set the option `always_reload` to `True`
on the field.  In that case, every `onchange` that changes the value
will trigger an extra `name_get`.

NOTE 3.  Suppose that a one2many field has a list view with field A, and
a form view without field A.  When adding a line, we now send all known
fields (main view and inline views) to the `onchange`, which may return
a default value for A.  The value will appear on the list view, but not
in the form view.  The former behavior was to call `default_get` with
the fields that occur in the form view only, and therefore field A would
be left to value `False`.

NOTE 4.  A test surprisingly adds an extra call to `read`.  The test was
actually wrong before.  With the changes in MockServer, we now correctly
receive a command `[6, false, [1]]`, whereas before we received `[1]`,
which isn't a valid command, and which was ignored.  As a consequence,
an extra `read` is done, whereas the test asserts it shouldn't.  But it
already didn't work before (I checked by sending the correct command).
This needs to be bugfixed elsewhere (task-id-2323491): in a o2m with a
onchange and default order records on an other page than the first
should not trigger a `read`.

Task 2261084

Co-authored-by: Raphael Collet <rco@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
2020-08-20 13:39:25 +00:00
Benjamin Vrayandqsm-odoo e41622e16e [IMP] base, *: add a field image flag on the lang model
*: website

Add a field image flag on the lang model because when a language has
no country (like the arabic) we cannot use the country flag as a lang
flag. By default we use this new field and as fallback we use the
country image. We also add an arabic flag image in the website data.

Part of https://github.com/odoo/odoo/pull/55300
task-2203383

closes odoo/odoo#55300

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2020-08-14 17:40:58 +00:00
Kevin Baptiste f1bbc282f8 [IMP] base: replace forecast with planning
This commit replaces the forecast application with planning.

closes odoo/odoo#52822

Taskid: 2253541
Related: odoo/enterprise#11082
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-04 13:12:26 +00:00
Aaron Bohy 721f38b11d [FIX] base: can execute action from settings
Before this commit, when being in a settings form view with at
least two items in the breadcrumbs (the settings view preceeded by
another one), clicking on a button to execute an action didn't
properly work: an history back was done instead, thus returning to
the previous action.

For instance, go to Sales (without demo data), click on 'Set
payments' in the onboarding banner, click 'Go to the configuration
panel', and in the settings view click on 'Install More Packages'.

The issue has been introduced by [1], but we couldn't find a
scenario to reproduce it before saas-13.3.

[1] a3845ae3f0

Issue spotted in task 2277314

closes odoo/odoo#55351

X-original-commit: 6ccb108e9a621a672fde715ea78656ffeb6834e5
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-08-03 16:17:19 +00:00
d5840a9093 [IMP] website_event(_track): improve demo data
RATIONALE

Even will soon gain a major update called Event Online, allowing to better
support full-online events. In order to prepare its merge, preparatory merge
are done to lessen the final diff.

PURPOSE

As new "Online Event" support is about to land, new and improved demo data
is necessary to showcase it. Improve online event demo data: have more tracks,
tags, colors, speakers, partners, descriptions, ... Make it WOW and AMAZING.

Improve demo data, especially track-related demo data: more tracks, better
datetimes, titles, tags, ... in order to have at least one event that looks
like a real event.

LINKS

PR #55260
Task ID-2310491 (Event Online Preparation 5)
Part of Task ID-2252655 (Main Online Event task)
Part of Task ID-2283796 (Event B2Basics / Registration Flow)

Co-Authored-By: Aurélien Warnon <awa@odoo.com>
Co-Authored-By: David Beguin <dbe@odoo.com>
Co-Authored-By: Thibault Delavallée <tde@odoo.com>
2020-07-31 18:05:03 +00:00
51b36c3dbb [IMP] base: add default image for users + placeholder if unassigned
1/ When the new database is created without demo data, the admin has a
   'silhouette' as a default picture. When a new user is created without
   picture given by the current user, the new user will have a 'silhouette'
   as a default profile picture.

2/ web: image for fa-user-slash. This image will be used when a record is
   unassigned.

3/ web, *: Change placeholder by default when record is unassigned.
   We want to have a fa-user-slash icon when a record is unassigned instead
   of 'placeholder.png'. A method is created in the BaseModel to have a
   generic method to change easily the placeholder for other models.

4/ Adapt kanban test to keep the same behaviour. Attention the behaviour is
   a bit different. Because, now the default image is given by the server to
   change easily the default image when a record doesn't have an image.
   Thus, we don't say if it's the default placeholder, but we can say it's
   not the same image of the record (in this test, the record, it's the
   partner).

5/ misc: display 'Unassigned' in the hover on kanban cards if record is unassigned

closes odoo/odoo#41356

Taskid: 2060206
Related: odoo/enterprise#7758
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: jdoutreloux <jud@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2020-01-21 09:22:46 +00:00
Romain Estievenart baf5ec854c [MOV] base,web: move "base settings" mobile related code
This code is not useful since https://github.com/odoo/odoo/commit/9831ed08fe
Note that this part of code will be refactored in web_enterprise.

Task ID: 2085899

closes odoo/odoo#38499

Related: odoo/enterprise#6077
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2020-01-13 13:25:01 +00:00
Prakash Prajapati f1baf1a793 [IMP] *: update import templates to match data model changes
Fields (and selection values) were re-labeled in multiple models but
the corresponding import templates were not updated to match, and are
now non-working (can't straight import the templates themselves which
is inconvenient).

Task 2059779

closes odoo/odoo#39834

X-original-commit: 185edc0165e834edd859b3413f03549f1dc71c69
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-06 08:27:12 +00:00
Mitali PatelandMohammed Shekha a3845ae3f0 [FIX] base: ask to discard before leaving settings
In a settings form view, do some changes, then click on a button
or link in the form (e.g. 'Manage Users' in General Settings).
We now ask if the user wants to discard the changes before leaving
the page.

Task 1921574

closes odoo/odoo#34799

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-09-12 06:21:41 +00:00
Yannick Tivisse 58b3557d6d [IMP] base_import: Improve import general UX (back2basics)
Purpose
=======

Improve error management UX on import.

TaskID: 2049992

closes odoo/odoo#35804

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-20 12:23:08 +00:00
Johan Demaret Rivarola e01d559f9d [IMP] payment: support SEPA Direct Debit acquirer
The purpose of this commit is to expose SEPA Direct Debit acquirer to
the Odoo community edition. The dedicated module, though, is restricted
to the enterprise edition.

Minor changes in following modules:

- base: added ir.module.module record

- payment:
  - added data to expose the new payment acquirer.
  - added 'to_buy' field to track whether the payment acquirer is
    restricted to enterprise users.
  - allow multi word payment acquirer name. It was breaking on the first
    underscore.

task-1870363
closes odoo/odoo#26427
2019-08-16 15:52:39 +00:00
Christophe Simonis 71a50a2214 [MERGE] forward port branch saas-12.3 up to 409679866b 2019-06-06 11:54:35 +02:00
Christophe Simonis c8d7ad9a6b [MERGE] forward port branch saas-12.2 up to 995aa1685e 2019-06-03 15:49:31 +02:00
Christophe Simonis cfe0523714 [MERGE] forward port branch 12.0 up to 8f21148e1a 2019-05-31 14:37:38 +02:00
Parth ChoksiandMohammed Shekha 745c7384e0 [IMP] base: notify user when there are modifications in settings
When user will modify something in settings, there will be a message
shown that will tell the user that he/she has unsaved changes.

task-1917637

closes odoo/odoo#31900

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>


Co-authored-by: Mohammed Shekha <msh@openerp.com>
2019-05-27 09:13:08 +00:00
Priyanka Kakadiya 8ffedf4545 [FIX] sale: fix search issue in settings
Before this rev., we searched for 'label' tagname into the DOM, but
the fields labels are not always inside <label> (sometimes <span>).

However, they always have className 'o_form_label', so we use this
instead.

task 1961427

closes odoo/odoo#33487

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-21 07:34:26 +00:00
Géry Debongnie 578c99475d [IMP] web: various small improvements to form view
This commit is a few small improvement/fixes to the web framework:

- allow placeholder attribute on input tags in form view
- only bind click event handler to buttons managed by the framework, not
  custom ones
- _onExecuteAction method in action manager properly fails if event
  cannot be properly handled

closes odoo/odoo#32458

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2019-05-02 07:14:52 +00:00
Sébastien Theys 0ab1940189 [IMP] base,web: adapt kanban image following image tools changes
Since the images are not guaranteed to be square anymore, the kanban image had
to be adapted to better handle the different image ratios.

Also the placeholder has been moved into the actual image div instead of
being a separate div that acted differently.

The avatar placeholder was white... displayed on top of white. Now it's grey
so we can actually see it.

task-1958000
PR: #31811
2019-04-29 13:45:34 +00:00
Christophe Simonis 71faa19af0 [MERGE] forward port branch saas-12.1 up to 2b3296bbf8 2019-03-11 14:42:34 +01:00
Christophe Simonis 2c5c9b8342 [MERGE] forward port branch 12.0 up to c023d0784f 2019-03-08 17:56:14 +01:00
Thibault Delavallée 7836b99690 [REV] base: revert "Hide Save/Discard on Settings until there are modifications"
Why reverting ?

The fact that the control panel changes width on first edit is confusing to the
user. The whole form shifts down. We want to avoid having elements appearing
and disappearing. The issue that the user does not know if he has to save is
still up to date, and will be addressed in the next saas. We will most likely
use what has been done in this task to only display 'There are unsaved
changes'. Thank you all for your work here!

Original task and revert discussion can be found on task ID 1917637 .

This reverts commit 514d6fb90d.

closes odoo/odoo#31622

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-03-06 09:53:55 +00:00
Baptiste Vergote f3f8430600 [FIX] base: use correct state name in res.partner import template
State from the template was 'CA' for California - not recognized on import
Changed it to 'California' to match with the db data

opw 1943904

closes odoo/odoo#31556

Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
2019-03-07 13:54:17 +00:00
Christophe Simonis 44515bc7be [MERGE] forward port branch saas-12.2 up to c9f832d9f0
closes odoo/odoo#31790

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-03-13 14:24:51 +00:00
99836c1be6 [REF] base: promisify after jQuery update
Part of task 1896658

Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Christophe Matthieu <chm@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Martin Geubelle <mge@odoo.com>
Co-authored-by: svs-odoo <svs@odoo.com>
Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2019-03-06 20:07:17 +01:00
Priyanka Kakadiya f1da58c718 [IMP] base: better onboarding bars on small devices
In small devices, onboarding bars are displayed vertial, which
takes too much screen space, and user has to scroll down
a lot to view actual content.

This commit improves the behavior by showing onboarding bars
horizontally (with scrolling) in small devices also, and thus
occupying minimal screen space.

task: 1929048

closes odoo/odoo#30823
2019-02-22 13:19:56 +00:00
Juhil Somaiya 5c13831dc5 [IMP] sale, base: partner form view improvement
Improved partner form consistency and clarity via following changes:
- Renamed string and tooltip from Shipping address to Delivery address
- Changed description of the customer address
- Re-organised contact partner form and added image of partner
- Changed default avatar to a simpler one that is not Stephane Bern
- Test case improvement

Task ID: 192044

closes odoo/odoo#29917
2019-02-08 06:37:35 +00:00
Parth ChoksiandMohammed Shekha 514d6fb90d [IMP] base: Hide Save/Discard on Settings until there are modifications
Purpose
=======

It only makes sense to display 'Save' and 'Discard' if the user actually
changed something in the settings.

So after this commit, the 'Save' and 'Discard' buttons of statusbar in
general settings will only appear when you make any changes.

Also when there are changes, there will be a message shown that will tell
the user that he/she has unsaved changes.

The commit is related to Task ID: 1917637

Co-authored-by: Mohammed Shekha <msh@openerp.com>

closes odoo/odoo#29726
2019-02-04 08:40:20 +00:00
Christophe Simonis 3cbc9dd6c0 [MERGE] forward port branch 12.0 up to 6a0675d36d 2019-01-14 10:34:50 +01:00
Jairo Llopis d76182c582 [FIX] base: prevent cutting app titles in kanban
closes odoo/odoo#28628
2019-01-10 11:32:09 +00:00
Thibault Delavallée 58997a9557 [REV][IMP] base: Improve search and ordering in settings
This reverts commit 01173f3745.

This commit added improvements in search and ordering of settings. However
due to DOM manipulation some events are not bound correctly. Notably saving
settings could be broken if several different tabs are modified before
saving.

After checking more in-depth settings code it appears it will be difficult
to ensure a proper re-rendering and re-ordering of settings without having
to modify deeply the code. This is therefore more a task for JS framework
team.

closes odoo/odoo#29285
2018-12-05 14:38:41 +00:00
qmo-odoo 01173f3745 [IMP] base: Improve search and ordering in settings
Allows users to not only search on settings name but on their description too.
Improves search results relevance :
Instead of the actual fixed order, top results should be about the module
selected in the left panel

Task : #1893252
closes : #28094
2018-12-04 10:19:08 +00:00
Géry Debongnie abf32b8b21 [REF] *: update js test suite to use helpers
This rev. introduces robust helpers to use in the JS tests suite to
interact with DOM and components, and starts using them (almost)
everywhere.

All the helpers are exposed though testUtils.js.

There are 2 kinds of helpers:

1. Assertions
-------------
 * assert.containsNone, containsN, containsOnce check that the DOM
   (or a specific part of the DOM) contains a `selector`. It
   generates a correct error message automatically.
    ex: assert.strictEqual(form.$('.o_form_editable'), 1, "msg");
        -> assert.containsOnce(form, '.o_form_editable');
 * assert.isVisible, isNotVisible check that the DOM has an element
   visible or not. They also check that the element is actually in
   the DOM (before most tests didn't verify this).
 * assert.hasClass, doesNotHaveClass, hasAttrVAlue, check specific
   properties of a DOM element, and also validate that it is
   applied on a single existing DOM element (before most tests
   didn't verify this).
    ex: assert.notOk(form.$('button').hasClass('btn-primary'));
       -> assert.doesNotHaveClass(form.$('button'), 'btn-primary');

2. Utilities
------------
The goal of the utilities is to centralize the definition of many
standard components and interactions, ensuring that when we
refactor the JS framework, we do not need to change all the tests.

Existing mock utilities (addMockEnvironment, intercept, path,
patchDate, unpatch and fieldsViewGet) are moved to
'testUtils.mock.*'.
Existing DOM utilities are moved to 'testUtils.dom.*'.
New dom utilities are created for opendDatePicker, click,
clickFirst and clickLast. Helper `click` verifies that there is
exactly 1 element visible in the DOM you click on, `clickFirst`
and `clickLast` verify that there are more than one element on the
DOM.
 ex: form.$('button').click();
     -> testUtils.dom.click(form.$('button'));

New Form utilities: (testUtils.form.*)
 clickEdit, clickSave, clickCreate, clickDiscard, all clicks on
 the control panel buttons of the form.
 `reload` reloads the form data.

New modal, graph, kanban and pivot utils (testUtils.pivot.*,
testUtils.kanban.*, etc.).

New fields utils: (testUtils.fields.*)
 * editInput, editSelect: allow to change the value of a field,
   using a selector to identify it. They validate that the input
   exists and trigger the change event automatically.
 * editAndTrigger: allow to modify a field and trigger specific
   events after the value change
 * many2one (testUtils.fields.many2one.*)
   clickOpenDropdown, clickHighlightedItem, clickItem,
   searchAndClickItem: use a field name instead of a selector and
   do all the complex mechanism to open, filter and highlight
   many2one fields.

Joint work with aab, dam, ged, mge, svs and vsc.
2018-11-19 11:24:28 +00:00
Géry Debongnie aa18aaa292 [FIX] web: restore formview mode when coming back (breadcrumbs)
Before this commit, when the user is in a form view (edit mode) and
click on a stat button, a new action is added to the action stack.  When
the user then comes back to the form view by clicking on the breadcrumb,
it is supposed to be in readonly mode.  Before this commit, this was not
the case.

This bug comes from the action manager refactoring, which removed the
view manager. With this commit, we add a new action lifecycle method
which is called when the action is restored.

Note that this commit implicitely changes the semantic of actions with
'target=inline'. As far as I can tell, this only applies to the settings
form view, which can easily be fixed by overriding the restore hook.

closes odoo/odoo#28663
2018-11-14 11:19:40 +00:00
Martin Trigaux 0aa0cec97a [FIX] web: do not warn on empty field
If no value is specified on the datefield, do not set a warnfuture message

Remove code comment that was referring the condition present at b51b0d66c2
but no longer present.

Add tests

Fixes #27551

closes odoo/odoo#27593
2018-10-10 13:59:36 +00:00
Nicolas Lempereur 5c6edfc8d3 [FIX] base: res_config_settings allow deferred field
If a deferred field, for example with auth_user_policy installed:

  <field name="f" password="True" widget="password_meter"/>

is inside the res_config_settings view, the rendering will be deferred
which is not taken into account when initializing the content
(_initModules) or attaching to DOM (after start).

Thus we would would get an error and have no access to settings.

The issue that happened in 12.0 was solved with 23bec7fb7 and refactored
in between in 5bbbd25ed, but the heart of the issue was not solved in
the case of a customization.

With this commit, we do not lose the deferred when it is necessary to
keep them in the case of deferred while rendering.

Without fix, the added test fails with a traceback and message:

 TypeError: Cannot read property 'settingView' of undefined

opw-1890343
closes #27589
2018-10-10 15:02:10 +00:00
Christophe Simonis 68d36512ef [MERGE] forward port branch saas-11.4 up to d78f23df84 2018-09-07 20:20:45 +02:00