Commit Graph
274 Commits
Author SHA1 Message Date
Nicolas Lempereur 940246f583 [FIX] web: remove Work+Sans online font import
The Work+Sans font of google fonts was hotlinked and available in
reports since saas-14's 3d04e448.

There does not seem to be a reason to do it and:

- hotlinking may add resources usage / processing time,

- server need outside internet access or the font doesn't load,

- it has been reported to cause the header/footer of some pages to
  disappear, probably because of a problem with loading the content in
  a given delay to render it.

- it was always loaded for report, even if used only once among all the
  reports of Odoo

For these reasons, this commit removes the hotlinking of this font.

The ISR report of l10n_ch that used this font will thus fall back on
'Verdana', 'Geneva' then the default sans-serif font which doesn't
seem to be a drawback over 'Work Sans' font.

If at one time we should reintroduce it, it should be contained in the
given report and possibly have the font locally and not externally.

opw-1861368
closes #25683
2018-07-09 15:56:48 +02:00
qsm-odoo 61c32429a6 [FIX] web, web_editor: restore report edition feature
Since 11.0, reports could not be edited at all anymore. This is due to
the fact the editor files were refactored but the report feature is not
correctly organized since it was merged with the 'web' app. Indeed, the
'web' app is still calling files and assets of the 'web_editor' app which
is not a dependency (but it is working as 'web_editor' is auto-installed
with 'web').

opw-1826599
opw-1834971
Closes https://github.com/odoo/odoo/issues/24034
2018-04-23 12:57:51 +02:00
Géry Debongnie dbdd742d20 [FIX] web: better mode handling, prevent useless work in some cases
Before this commit, the way mode was handled was not optimal.  The end
result was correct (the widget were properly created/displayed in
edit/readonly as required), but useless work was done.  In particular,
if we have list/x2manys with widgets and modifiers, it could happen that
widgets were created in edit mode, then destroyed and recreated in
readonly mode.

This could happen in some important views, for example, any view with a
field many2many_tags with a readonly modifiers (pretty much all views
handling taxes)

In this commit, we add a 'editable' attribute to list renderer.  This is
necessary, because the list renderer is not actually editable when it is
in a x2many in a form view which is in readonly mode.  Also, we need to
manage the distinction between the fact that a list view is editable,
and the fact that some widgets are created in edit and other in readonly
mode, depending on modifiers, and on which line is being edited.

We also add a benchmark (courtesy of CHM) to be able to measure the
performance impact of edit/readonly/onchange in a larger form view.
Before this commit, running this form benchmark on my machine gave a
number of 0.4 op/sec, and after, it increases to 1.26 op/sec, so a
pretty large improvement.
2017-12-18 17:29:14 +01:00
Naglis Jonaitis b52244e15b [FIX] web: removes duplicate id attribute inside DB manager template
Closes #20855
2017-11-14 15:25:15 +01:00
Aaron Bohy 9bc5009481 [FIX] web(_editor): enable mobile tests
This rev. introduces a new test suite meant to test the webclient
components on mobile devices. The key 'config.device.isMobile' is
forced to true in this test suite, so that mobile specific JS files
are properly executed, which isn't the case in the classic JS test
suite (setting isMobile to true in the test definition is too late,
as the JS files are already processed).

For now, this new test suite contains a single test, which was
skipped until this rev. as it couldn't be executed in the classical
JS test suite.

Both suites are executed at each build of the runbot, and they
can be manually executed from the webclient as well (via the debug
manager).
2017-11-10 10:24:42 +01:00
Dharmang Soni b23c5b2aa9 [FIX] web: prevent iOS from zooming in on input fields
When a user clicks on an input or a select field
in Safari on IOS, Safari has a behavior of zooming-in
on the field when the keyboard opens.
Even after the user dismisses the keyboard, the screen
still stays zoomed-in. The user has to then zoom out manually.

Now, the user is not allow to zoom-in at all.
This is already the case with the Android application.
We now have the same behavior between the two apps.
2017-10-19 14:33:14 +02:00
Xavier Morel 7f6d32d5e0 Revert "[FIX] qwebjs: add tests to test suite" 2017-10-10 15:39:39 +02:00
Xavier Morel 1e3c76f41d [IMP] web: add web tests to regular JS suite
Remove old tests page as it was obviously unmaintained and did not run
at all...
2017-10-10 14:25:19 +02:00
Yannick Tivisse 1df6f4c741 [FIX] ir_actions_report: Render correctly the base64 images in P3
Purpose
=======

In python2 a binary field value is retrieved as a string. Example: company_id.logo = u'xyz'

In python3 a binary field value is retrieved as a binary. Example: company_id.logo = b'xyz'

When trying to render an image on a template, we should pass a stringified version of it.

Specification
=============

Pass the method to_text in the template rendering context and use it.
2017-10-10 10:39:43 +02:00
Olivier Dony b02dea7688 [IMP] config: allow blocking access to db manager
- The `--no-database-list` option will now also block access to database
  management functions and screens.
  Presumably this flag should only be used in production when all
  databases have been provisioned, so the admin should like to block
  access to the db manager at the same time.

- If no `--database` or `-d` parameter is provided, the system will be
  unable to fetch a list of databases at all, so users will be blocked
  with an error message.

- Hide the link on the login screen to the DB manager when it is
  disabled, to prevent sending users to an error page.

- Weak attempt at updating the documentation

Note: the security check for RPC methods could have been done in the RPC
dispatcher, however that would not have protected service methods when
called directly, e.g. by a controller (e.g. the dump method).
2017-10-03 12:46:03 +02:00
Aaron Bohy d9391409a2 [IMP] web: grouped Kanban: UX improvements in mobile
This commit refactors the JS and LESS of the new mobile version
of the grouped kanban views. It ensures that the touchSwipe
library is lazy-loaded (only in mobile, when entering a kanban
view).
2017-09-25 14:10:44 +02:00
Dharmang Soni a12cfa8260 [IMP] web: grouped Kanban: UX improvements in mobile
This commit aims to improve the UX of grouped Kanban views on
mobile devices. Only one column is now displayed, full width. The
columns' records are lazy-loaded. The user can swipe horizontally
to navigate through columns (thanks to the touchSwipe library).
2017-09-25 14:10:40 +02:00
Laurent Smet 85a0399d4f [FIX] web/report: fix header/footer css style in pdf reports (#19579)
After the refactoring of the wkhtmltopdf engine, the headers/footers are managed in a very different way to be able to call wkhtmltopdf only once. The subst JS function must select the right header/footer corresponding to the current page company. However, a <div> was suppressed during the process and then, some external customization might be ignored (see github issue for more details).

-issue: https://github.com/odoo/odoo/issues/19544
2017-09-20 14:38:35 +02:00
qdp-odoo ec96c0b3c2 [IMP] base: add vat_label on res.country
That allows to display the 'vat' field under the right label in reports.
2017-09-18 21:57:48 +02:00
qsm-odoo 33f9e90bd5 [IMP] web, *: add kanban column progress bars
* crm, project

Add a new feature which allows to put a progressbar in the kanban
columns. The progressbar shows with the same color the amount of
records whose value of a given field are the same in the column.
It also indicate the sum of another given field or simply the total
number of records. It also allows to subgroup the column content.

To define a progressbar, add this as a direct child of the kanban
arch:

<progressbar field="<name of the field to use for subgroups>"
             colors="{<one possible value for the above field>: <success, warning or danger>, ...}"
             sum="<name of the field to sum or nothing to use total number of records>"/>

Also:
- Properly update record model data's parentID when moving a record
- ...
2017-09-14 23:48:56 +02:00
Géry Debongnie 93cf24f73a [FIX] web: reimplement custom widgets in basic views
With the new views, we lost a (almost unused and undocumented) feature:
the ability to instantiate custom widgets in a form view, not linked to
a particular field.  For example:

<widget type="weekly_timesheet" attrs="{'readonly': [['state', 'not in', ['new', 'draft']]]}"/>

We reintroduce this feature in this commit, with a nice twist: it also
works for the list view and the kanban view.
2017-09-13 14:04:34 +02:00
Deep Patel 898224f110 [IMP] web,account,...: Regroup settings, add a nav and search bar
Purpose
=======

Settings are often way too long and hard to scan and sometimes you don't know where to find the settings you're looking for.
By adding a left navigation, you can already have an overview of the settings, and switch easily between them.

Specification
=============

- Add a search bar on all the apps that have settings which can search results from all the installed apps.
  (If i'm on sales settings,and I search anything then it shows results from sales settings and also shows
  all the other matching results from all the other apps such as, Inventory...etc) with app name.
- Able to activate feature from the current page results (no matter if the searched result is from another apps).
- Highlight searched word in results
- Delete the sheet, have a full white background
- Add left navigation bar on setting
- Left navigation bar fixed
- List displayed based on installed apps
- On right panel, by default display current app setting and change accordingly
- [Mobile] Left navigation bar displayed on top
- Add Breadcrumb on top of the page: have the name "Settings" + Save / discard CTA + Search
- Add General Settings on the nav bar
- remove "save this page..." notif in all settings
- Delete all recommanded apps section + all checkbox that install app should disappear:
	payroll: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrSkMzWVpuZ0ZoaFE/view?usp=drivesdk
	Events: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrYXlHMHd2NTM2blE/view?usp=drivesdk
	Manufacturing: Delete Repair - Quality Control - Maintenance - Product Lifecycle Management [LAP][ok]
	Timesheets: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrdFg5XzNydkd2TlU/view?usp=drivesdk
	project: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrraWo3NE04TktwcTQ/view?usp=drivesdk
	inventory: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrQkRaVUR5ekFQYTQ/view?usp=drivesdk
	recruitment: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrbDdqLWQweF80UkE/view?usp=drivesdk
	purchase: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrRlAyUDBnb0trQWs/view?usp=drivesdk
	email marketing: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrOUZONjhvX2k3Y2s/view?usp=drivesdk
	expenses: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrrR0JpN1ZpQmtxU3M/view?usp=drivesdk
	attendances: https://drive.google.com/a/odoo.com/file/d/0B1uIL9E_zXrralpjZ1VJclNpMWs/view?usp=drivesdk
- About duplicate settings:
	Docsaway: Delete from Sales + delete Default Print Provider
	Attributs & Variants: Delete from Purchases - Manufacturing
	Multi-currencies: delete from Sales
	Unit Of Measures: Delete from Purchase & Expenses
- Add a scroll bar on the left bar when there's too many apps
- Keep the navbar visible even when you search
- Move General Settings to the bottom of the list
- Update on Settings:
    - Accounting:
        - rename automatic rates
        - Anglo Saxon Account: Should be in technical feature
        - Place Accounting Reports section before Taxes section
    - CRM:
        - Phone Validation: Enforce international format becomes
        - Local Numbers: (2 radio buttons proposals) Add international prefix / No prefix
    - Fleet: typo " ... a new car if ..." + text is too long <br>
    - project: fix tooltip for colab pads
2017-09-01 13:02:54 +02:00
Christophe Matthieu 95c2bd33a2 [IMP] web: lazy load nvd3, ace and fullCalendar lib to reduce asset size 2017-08-31 16:26:11 +02:00
Thibault Delavallée f056caa911 [MOV] web, portal: put all customer portal less into a single file
Two things happen in this commit

 * move portal less from web to portal. This code has been wrongly
   moved to web when moving the customer portal and should be in
   portal module;
 * merge customer portal generic less and customer portal chatter
   specific less into the same file;

We should now have only one less file for customer portal less and
located in the right addon.
2017-08-24 17:07:59 +02:00
qsm-odoo f997c128c7 [REF] web, website: share modal.less file
Following https://github.com/odoo/odoo/commit/5658e337c3e0385d3d116e34404ef4086b3e94f0:
The modal.less file is now in the common assets so that the
dialogs' style is shared instead of duplicated.
2017-08-22 13:02:12 +02:00
Thibault Delavallée ea27c1b7a3 [MOV] website_portal, portal: move customer portal to portal module
This commit moves the whole customer portal to the portal module.
It now completely uses portal and http_routing features and is not
dependent on website anymore.

An override of web controller is added in portal in order to redirect
portal users to /my instead of /web. That way once having the customer
portal installed all share users are correctly redirected to their
account.

All modules defining customer portal templates and controllers are
updated accordingly.
2017-08-08 14:58:49 +02:00
Thibault Delavallée da8d418ff0 [ADD] portal: add module for customer portal and sharing features
This module adds required base code for a fully integrated customer
portal. It contains the base controller class and base templates.
Business addons will add their specific templates and controllers
to extend the customer portal.

This module contains most code coming from odoo v10 website_portal.
Purpose of this module is to allow the display of a customer portal
without having a dependency towards website edition and customization
capabilities.

Some CSS files used in frontend assets are already moved to have a
working portal skeleton. A is_public method on users is also added
as it will be used in various portal code soon.
2017-08-08 14:23:58 +02:00
Laurent Smet b446930dc4 [IMP] base/report, web/report: remove pdf merge with single call to wkhtmltopdf
The old behavior was to call wkhtmltopdf for each report and to put all of them together
using the merge_pdf method. It was a very slow approach because all report needs
5 temporary files, one subprocess and then, a merge.

The new behavior is to perform a single call to wkhtmltopdf by putting all the footers/headers
html together and so, avoid call to merge_pdf to greatly improve the performances of the reporting.
2017-07-20 14:48:43 +02:00
qdp-odoo 8bea502f33 [REM] *: removal of fax field on res.partner object
Deprecated technologuy that doesn't deserve its dedicated field anymore. RIP faxes
2017-07-12 17:48:43 +02:00
Dharmraj Jhala 4330ea0267 [ADD] web, *: add rainbowification
This commit introduces the 'rainbowification' feature to the web client
(and to some affected addons).  This feature is essentially a way to
display a nice friendly message when some business event happens.  For
example, a encouraging message is displayed when the user clear her/his
inbox, or when a salesman closes a deal.

The mechanism currently only displays a 'rainbowman', but could be
extended later to add other kind of animation.

There are a few different ways to display a 'rainbowman':
- any JS code can simply trigger_up an event ('show_effect') with some
  options: for example
    this.trigger_up('show_effect', {
        type: 'rainbow_man',
        fadeout: 'no',
        message: $done,
        click_close: false,
    });
- an action returned by the server can have an 'effect' key, with some
  options
- the do_execute_action method accepts a 'effect' option.  This is
  useful when one wants to specify a rainbow on an action button in a
  form view

Joint work with: dbh <dbh@odoo.com>, ged <ged@odoo.com>
2017-07-12 13:43:08 +02:00
Christophe Simonis dd43071638 [MERGE] forward port branch saas-16 up to 278e478d55 2017-06-27 14:19:31 +02:00
Sanjay Jamod acfb54055a [FIX] web: upgrade boolean fields in Settings
Before this rev., there was a traceback when clicking on an
upgrade boolean field's checkbox.
2017-06-22 20:48:59 +02:00
qsm-odoo 85d1e76ddb [IMP] web, *: reorganize our libraries' extensions
* web_editor, web_tour, website_event_track

Before this commit, one JS file was responsible for all the library
extensions and fixes. There were two main problems with this system:

- The file was only available in the backend (as some extensions are
  made on backend-only libraries).

- Some other modules were doing library customizations.

This commit creates one file per library to regroup their associated
customization and adds them in the right asset. These are placed in
the web module and every other module should avoid doing customizations.
This allows to have libraries consistency accross all modules and
between the backend and the frontend.
2017-06-21 12:56:13 +02:00
Christophe Simonis 4ae122b1b2 [MERGE] forward port branch saas-16 up to 78dc8f6871 2017-06-09 19:12:08 +02:00
qsm-odoo fc53b91b06 [FIX] web: adapt tests to 3741603495
The datepicker is now forced to be in the <body/>, so the tests had to
search it in there.
2017-06-09 17:55:52 +02:00
Olivier Dony 5d2869cbc8 [MERGE] Forward-port saas-16 up to ba15df47cb 2017-06-01 01:46:13 +02:00
Géry Debongnie 5788ee8a1c [FIX] web: prevent crash when exporting all data
In the list controller, some code to determine the active domain to
export was causing a crash.  It was easy to see: just select all records
in a list view, then click on 'Export' in the sidebar.

Note that the data_export code is still quite old, and did evolve
organically.  It does not conform to our new design principles, in
particular, the way component should communicate. But this is a task for
another day.
2017-05-29 16:20:45 +02:00
Olivier Dony 5f4db9df66 [MERGE] Forward-port saas-16 up to 5afe894f44 2017-05-16 18:23:15 +02:00
Laurent Smet d5fa3232fe [FIX] base, report: fix some issues due to removed 'report' module.
fix related to task: https://www.odoo.com/web#id=31625&view_type=form&model=project.task&action=333&active_id=967&menu_id=4720

The 'report' module no longer exists but a dependency was still there in l10n_ca.

- fix dependency in l10n_ca
- fix broken company layout
- move layout templates from base to web
2017-05-16 15:37:15 +02:00
Sanjay Jamod 8dac9cfc93 [FIX] web: website tour and website seo are using ajax_service
so load ajax_service service into assets_common instead of assets_backend (#16993)
2017-05-16 15:05:16 +02:00
Géry Debongnie 15a227375a [ADD] web: add benchmark support
With this commit, we introduce a benchmarking infrastructure: a new
controller, accessible at the route /web/benchmarks which will render a
new template (web.benchmark_suite).

This template uses benchmark.js and qunit.js to display a list of
benchmarking informations.  For example, the number of op/s for
instantiating and destroying a list view.

I hope that this is the start of the beginning of taking the habit to
check our JS code performance sometimes, and making sure we do not have
large regression without a good reason.
2017-05-16 14:41:00 +02:00
Laurent Smet e80238042c [REF] report: remove the report module
The content of the report module is now dispatched in
the 'base' and the 'web' modules.
2017-05-08 09:23:12 +02:00
qsm-odoo 250e716c3a [REF] web, *: restore views design
Since the new views merge, a lot of design elements were broken. This
was particularly impacting the fields in the editable list view; indeed
the editable list view is not using an inline form view anymore so the
fields in the list were not properly styled as the LESS was still
defined assuming the form view environment (for example the invalid
fields were red for o2m fields in form view but not in editable list
view even though they got the right CSS class).

This commit refactor the LESS following these rules:
- No more division of non-layout and layout rules. Dividing LESS rules
  in x_layout.less and x.less was a mistake. Many rules can be
  considered to be layout and not layout at the same time, developers
  always have to switch from one file part to the other, many CSS
  selectors (and rules!) are duplicated for nothing, ...
- Field style is extracted from x_view.less and put in the new
  fields.less file. As before, the fields_extra.less will contain the
  rules specific to community so that the enterprise repo can override
  those by replacing the whole file.
- Many classes have been renamed so that o_form_x_y becomes o_x_y as
  many classes can now be applied outside of form view. These classes
  should not be used in templates anyway.

The commit also changes the DOM of fields so that it is more minimalist
(no useless parent div, etc).

Input elements are not automatically styled anymore, they have to get
the o_input class explicitely. This allows to fix lots of small style
bugs of previous versions (required monetary field had not the proper
style, readonly m2m tags appeared as editable, ...). This also improves
the LESS code.

The editable list view should also completely stop flickering on chrome
and firefox.

The commit also removes the orange outline on list view dirty cells.

The commit also removes deprecated static xml, LESS and other code.

Notice there are still styles to restore/fix and LESS to improve.
2017-05-04 12:07:30 +02:00
Géry Debongnie 51e9aba2cb [FIX] web: do_action should properly resolves when complete
We changed the do_action method recently: before, it was calling
recursively its parent, now it simply triggers up an event.  We also
moved it to the 'services' mixin.  However, we did not properly connect
the 'on_success' option: it is not an option for the view manager, but
for the abstract web client.  As such, it should not be in the options
parameter, but it should simply be a key in the event payload.

This commit was found by solving the two following issues:
- open sale application, click on 'Inbox' icon to go to discuss,
  Discuss is opened, but the navbar stays with sales application
- after installing module website_crm_partner_assign in kanban view for apps,
  it does not reload...

Both of these were caused by the need to do something after a do_action,
and the deferred was not resolved at all.
2017-04-27 09:24:59 +02:00
Aaron Bohy bead8452c2 [FIX] web: Views: sequential lazy loading of libs
The views can specify js (and css) libraries to lazy load when
they are instantiated for the first time. The previous
implementation was too naive as it always loaded the specified
libraries in parallel. However, it may happen (e.g. gantt view)
that some of those libraries depend on other ones.

This commit implements a mechanism to handle libs dependencies
between each other. For instance, specifying:
    js_libs: [
        ['a', 'b'],
        ['c'],
    ],
will load 'a' and 'b' in parallel, but wait for them to be
loaded before loading 'c'.

The new implementation still supports the old syntax. So,
    js_libs: ['a', 'b', 'c'],
will load 'a', 'b' and 'c' in parallel.
2017-04-26 11:19:20 +02:00
Christophe Simonis 4441237b0a [MERGE] forward port branch saas-15 up to ab68a1c674 2017-04-25 12:36:02 +02:00
Christophe Simonis ab68a1c674 [MERGE] forward port branch saas-14 up to 64b7d4e8a8 2017-04-24 13:24:13 +02:00
Christophe Simonis 64b7d4e8a8 [MERGE] forward port branch 10.0 up to 3f6e573c67 2017-04-24 12:53:34 +02:00
Christophe Simonis eb672d81e6 [MERGE] forward port branch saas-11 up to b5b8239870 2017-04-24 11:09:52 +02:00
Christophe Simonis b5b8239870 [MERGE] forward port branch 9.0 up to 9e6860a228 2017-04-24 11:07:55 +02:00
Nicolas Martinelli 9e6860a228 [FIX] web: make DB name more flexible 2017-04-24 08:02:22 +02:00
Christophe Simonis 814c550913 [MERGE] forward port branch saas-11 up to a0ff1f2ad8 2017-04-21 14:34:11 +02:00
Christophe Simonis a0ff1f2ad8 [MERGE] forward port branch 9.0 up to 8de514f805 2017-04-21 14:19:05 +02:00
Christophe Simonis 144ff9a61a Revert "[FIX] web: refuse DB name with space"
This is too restrictive.

This reverts commit 606712a5d2.
2017-04-21 14:02:58 +02:00
Christophe Matthieu 9bf3e2a7fa [IMP] web: add timezone_mismatch field widget
* display a warning when the timezone offset is not the same of the browser
timezone offset
* if different, display the time in the selected timezone
2017-04-19 14:48:07 +02:00