Commit Graph
126904 Commits
Author SHA1 Message Date
Romain Derie fdbf11643f [IMP] *: move test and tour files to new folder hierarchy and asset
As we now have a new debug mode 'tests' which load a new asset bundle
containing tour-test files, we moved those files to a new folder hierarchy.
That will clean the .js files trees.
Also, those files should be included in the new asset.

Basically, the .js tour files (not test) should be inside /static/src/js/tours
while .js tour test files (test=true) should be inside /static/tests/tours next
to QUnit tests, inside a tours folder.

+ test_new_api: don't run the test in debug assets

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
Romain Derie d7cd97a9be [IMP] *: new asset for test files, new debug mode (stored in session)
This commit goal is to encapsulate every tour-test into a separate assets
bundle that would be called only during tests (command line) or by URL
(debug=tests). That way, a lot of .js files would not be loaded anymore
uselessly outside test mode and will speed up the page loads (especially in the
frontend as the backend do not reload the page anyway).

In order to do that, we needed to propagate the `debug` state from page to
page.
Otherwise, every page change during a test would simply lose the debug mode and
the test would stop as the test assets would not be loaded.
As we could not add the `&debug=tests` on every link (either hardcoded or
preprocess during the rendering), it has been decided to store it in session.

Technical summary:
1. `debug` state (currently only stored in URL) will be stored in session.
   Either when adding the `debug` param in URL (handled with _dispatch) or by
   starting Odoo with `test-enable` or `test-file` (handled by session init).
2. Once activated (and so set in session), debug mode will remain activated
   even if not visible in URL (after a page navigation eg).
   To deactivate it, set its value to nothing, `debug=`. That will exit debug mode
   (whatever mode it is: debug, assets, tests).
3. As tour-test files are now in a separate bundle, every layout (when needed)
   should `t-call="web.conditional_assets_tests"`.
   As it would be redundant and verbose, no `t-if` is needed on the t-call to
   load it only in test debug mode. That will be handled by
   `compiled_assets_tests` that will actually do the conditionnal t-call-assets
   to web.assets_tests, if tests debug mode is activated.
4. In addition to separating the tour-tests files in a separate bundle, we also
   moved those files to a specific folder under /static/tests/tours next to
   QUnit tests.
5. Also, tour files will be moved in a specific folder /static/src/js/tours for
   cleanness purpose (those files will still be kept in their 'normal' assets
   as needed outside test mode since it is tours).
   This will be done in the next commit.
6. It is possible to enable multiple debug mode, such as 'tests' and 'assets'
   together. Simply separate debug modes with a comma, eg '?debug=assets,tests'

task-1934445
Comes with https://github.com/odoo/enterprise/pull/4281
Closes #33213
2019-06-05 05:56:33 +00:00
David 2fab076e84 [IMP] point_of_sale: add ticket reference in payment
Before this commit, when creating a payment from a pos, the reference was:
Main/0000:

After this patch, it is now:
Main/0000 - Order 00000-000-0000

The number of the ticket is useful as it what is printed on the ticket and what
the customer knows (when trying to reconcile order and payment manually)

Closes odoo/odoo#33696

closes odoo/odoo#33757

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-29 12:54:48 +00:00
Elisabeth Dickinsonandqsm-odoo b68311454d [IMP] website_forum: review design of forum index
- Allow to set an image on each forum
- Review the form view
- Redesign the forum index with cards and header

task-1984582

closes odoo/odoo#33530

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>


Co-authored-by: qsm-odoo <qsm@odoo.com>
2019-06-04 22:26:50 +00:00
Robot Odoo bae24d7bdd [MERGE] web, web_editor, *: allow image optimize from media dialog
Merge commit for PR #31208

Before this task, many websites were slow due to big images.

Most users upload images without understanding the impact on SEO and speed.

Each upload of an image is important and require some configuration to find the
best solution between speed and quality according to the situation.

After this task, users will have more control on the upload of images,
especially they are given the possibility to reduce their size, quality, and
change the filename.

task-1930726

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-05 02:03:30 +02:00
Sébastien Theys 87a35d4263 [IMP] web, web_editor, *: add media image optimize dialog
* = website, website_blog

The goal is to give the user an opportunity to optimize his images before using
them.

For this we introduce a preview/configuration dialog after every image upload,
where appropriate default values are filled for the quality and resolution,
based on where the image is going to be used. Since this is not going to be
perfect all the time, we still allow the user to configure them, and we display
a preview to ease this process.

Indeed it is important for SEO and for usability in general that the images are
as light as possible in size.

Technically the original image is uploaded and saved first, and then it can be
optimized. This way the upload only happens once, and the preview can be
computed from the already saved image.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 76cf2ae82a [IMP] web_editor, *: improve media dialog attachment upload
* = web_unsplash, website

Remove iframe upload and replace it with a proper RPC. The route is now only
accepting one file at a time, which makes it easier to maintain, and allows to
process the first file as soon as it is ready, instead of having to wait on
everything.

Also fix a bug where a document could not be uploaded because it would try to
parse it as an image.

Remove filter after search result from the JS and add the corresponding
conditions in the domain to avoid processing and returning unnecessary records.

If multiple attachments exist with the same URL, now display them all to avoid
confusion.

Compute all the necessary values in the python model instead of in the JS.

Allow SVG in the widget (the server already accepted them before).

Disable multiple image upload when not in multiImages mode.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 191c556d6b [IMP] web_editor, *: improve file media widget views & selection
* = web_unsplash, website_blog

Rename "image" to "attachment" when appropriate in FileWidget

Improve image selection / highlight code (now based on attachment id)

Improve image grid view:
 - Remove the row mechanism and replace it by a single loop over the images.
 - Take advantage of row wrap for a responsive display.
 - Uniformize the height (prevent tall images from moving down everything).
 - Load a miniature of the images when possible, remove the loading placeholder.
 	This should significantly reduce the download size when opening the dialog,
 	at the cost of CPU usage on the server.
 - Split the existing image view into one view for the loop and one view for the
 	image itself. This way in a following commit we can reuse the image view
 	when adding a new one, instead of having to render everything again.

task-1930726
PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 86d304fdb0 [IMP] tools: prevent unnecessary image processing
Both for performance and to avoid reducing the quality of an image in unexpected
situations.

- avoid applying useless operations in the first place
- do not count an operation if it had no effect
- allow quality 0 as a safe default that does not forcefully re-save the image

PR: #31208
2019-06-04 22:14:13 +02:00
Sébastien Theys 08cda70147 [FIX] tools: fix support for multi-frame GIF images
Before this commit, only the first frame would be saved.

PR: #31208
2019-06-04 22:14:13 +02:00
rhe e3c6683846 [IMP] POS: multi currency report issue.
When the pos order report were displayed in a context of multi currency, the total in the company currency was not correct because the value weren't converted before being added to the total.
So to have the correct total, we convert all orders that were not in the company currency to the correct one.
TASK ID: 1998604

closes odoo/odoo#33652

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-04 13:06:38 +00:00
Robot Odoo 3a55c4616d [MERGE] base: Improve multi-company UX
TaskID: 2000277

closes odoo/odoo#33876

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-06-04 21:40:44 +02:00
Pierre Paridans ece2fed154 [REF] mail: chatter topbar styles
The Chatter's topbar (containing the buttons like 'Send Message', 'Log
Note') was difficult to deal with: specially the positioning of its
content (a float into another float...).

So, this commit refactors the topbar's layout using Flexbox. It allows
to simplify and reduce the amount of (S)CSS needed to achieve the same
visual result.

In the process, the Followers (dropdown) buttons now use correctly
nested .btn-group components (as described by the Bootstrap 4
documentation) and SubTypes dropdown items use semantic html element
(<button>) instead of attaching behavior on icon element(<i>).

Finally a few Chatter's tests requested a slight adaptation (cf.
trimming element's textual content).

Task ID: 1928573

closes odoo/odoo#33823

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-04 13:47:33 +00:00
Yannick Tivisse fd86ffd5aa [IMP] web: Keep dropdown open and show multi company changes before reload 2019-06-04 15:36:04 +02:00
Yannick Tivisse 39615db00d [IMP] base: Display favicon field in debug mode 2019-06-04 14:26:29 +02:00
Yannick Tivisse 3295c7dcf7 [IMP] web: Display switch company boxes on the left 2019-06-04 14:25:11 +02:00
Yannick Tivisse 318fa03020 [IMP] base_setup: Remove group_multi_company on res.config
A user is supposed to be put in the group_multi_company group when the
he is allowed in several companies. Activating the feature for all the users
is not necessary.
2019-06-04 14:09:12 +02:00
Yannick Tivisse 2996e7645f [IMP] base: Remove group toggle_multi_company
Fp request
2019-06-04 14:01:42 +02:00
Yannick Tivisse 3d06a77393 [IMP] base: Set a bar on favicon instead of colorizing the 'O' 2019-06-04 13:58:55 +02:00
Yannick Tivisse 08aa26b4ea [IMP] stock: Enable multi company mode in demo data
As 2 companies are enabled for demo/admin users, enable the multi
company groups for these 2 people.
2019-06-04 13:45:09 +02:00
Andrea Ulliana 0d88571faa [IMP] website: move parallax option below background image options
Part of https://github.com/odoo/odoo/pull/30986
task-1939869

closes odoo/odoo#30986

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-04 11:34:35 +00:00
Andrea Ulliana 6a22dcfcbc [IMP] website: move "add/remove slide" option to the top
Part of https://github.com/odoo/odoo/pull/30986
task-1939869
2019-06-04 11:34:35 +00:00
Andrea Ulliana 3f255ce618 [IMP] website: remove "add language" in mobile preview
Part of https://github.com/odoo/odoo/pull/30986
task-1939869
2019-06-04 11:34:35 +00:00
Andrea Ulliana 9f53b187d9 [IMP] website: add the possibility to delete an anchor
Part of https://github.com/odoo/odoo/pull/30986
task-1939869
2019-06-04 11:34:35 +00:00
Andrea Ulliana eacf934230 [IMP] website, web_editor: make minor text modifications
- End of list in image library
- Title add menu item
- Warning message in html/css/js editor
- Wording building block sections

Part of https://github.com/odoo/odoo/pull/30986
task-1939869
2019-06-04 11:27:08 +00:00
Thanh Dodeur e0d354143b [IMP] web: make search panel display hex_color fields
This commit adds a colored ball in front of search panel categories
if the records have a `group_hex_color`

Task: #1974652

closes odoo/odoo#33842

Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
2019-06-04 08:07:22 +00:00
Mohammed Shekha ed924e956d [IMP] various: set some fields as optional to simplify the views
This commit removes some groups that are now useless since their
only purpose was to allow the user to hide or show some fields
depending on its value, but those fields are optional now.

Task-1902765

closes odoo/odoo#31944

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-06-04 07:04:51 +00:00
David Monjoie 88a26235ca [IMP] web: add optional fields parameter
This commit adds a new parameter on fields for list view and one2many.
The parameter name is "optional" and its values are "hide" or "show".

Columns of the list view which have the optional parameter set are
listed in a dropdown that can be toggled from the last cell of the
table header. The ones with optional set to "hide" are hidden by
default.

User choice is stored in local storage. If no saved parameter can be
found in local storage then the default value from the view is used.

Due to the overflow behavior of the responsive table, we were forced
to wrap the table-responsive div in yet another div. We changed the
o_list_view class on the table to o_list_table in order to reuse
the more generic o_list_view class on the top-most div. CSS rules
and selectors had to be updated according to this change.

Task-1902765
2019-06-04 07:04:50 +00:00
rhe 2bffd65451 [IMP] point_of_sale: improve multi company
Since the company is not stored anymore on the user and is in the
environement, some parts of the code that was based on the current user
company cannot work anymore.

We've adapted the code to take the company from the relevent documents
to avoid having inconsistencies through the different documents
generated in the point of sale.

TASK-ID: 1997613

closes odoo/odoo#33556

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-04 07:20:19 +00:00
qsm-odoo e9be0bb178 [REF] web, *: share common parts of main frontend layouts
* http_routing, portal, rating, survey, website, website_survey,
website_slides_survey

Before this commit, the final base layout of website was a fully
overridden layout of the one in portal, which was somehow a duplicated
one of the login one in web, which... so lots of duplicated code.

This commit is a first step towards a better organization:

1) The web app defines a frontend layout (to include base frontend
assets), with a base company logo as header.

2) The portal app modifies that layout in place to include the base
header, footer, ... It also uses a primary extension of it for
portal pages.

The survey app simply uses the above layout instead of defining its
own (by primary extension to include its own assets for its own
pages)

Same goes for the rating app and pages.

3) The website app modifies that layout in place to include the UI
assets, to add website UI, ... This allows to create frontend apps
which do not depend on website, with a non duplicated layout that
will be automatically adapted if website is ever installed (this
therefore allows to get rid of website_survey definitely)

This commit also fixes the session info system and the translation URL
on the frontend side to not require to redefine the whole session_info
for portal, website, ... Now the frontend session_info is defined in web
and http_routing extends it to add translation informations, then
website extends it again to add its own elements (not to redefine them
all as before). Note: before, http_routing defined the translation route
but only portal was adding it in its layout...
This is an adaptation of the work that was done with commit
https://github.com/odoo/odoo/commit/99821fdcf89aa66ac9561a972c6823135ebf65c0

Note 1: Many frontend but non-website apps (not only survey / rating)
could probably use this too but this would be the topic of another task.

Note 2: survey currently depends on http_routing but does not add itself
in the list of frontend apps to translate, it probably should.

Note 3: web_editor does currently not depend on http_routing but does
add itself in the list of frontend apps to translate, it thus uses a
function it does not really depend on... to check after its work-in-
progress refactoring.

task-1961045

closes odoo/odoo#33825

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-03 20:09:26 +00:00
MaxLarue 9c5dde8c53 [IMP] base,doc: add on_create and edit attribute on gantt view
related task #1929079

closes odoo/odoo#33872

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-06-03 19:39:42 +00:00
David Monjoie a17363eb47 [FIX] web: fix dialog close not waiting for callbacks 2019-06-03 19:39:40 +00:00
MaxLarue 0340c2b37c [IMP] web_gantt: allow creation on gantt to be a wizard
Previous behaviour was to use a formview inside a dialog to create
object on gantt view. This is still the default but now it is possible
to call a wizard, which brings more control over the creation dialog.

In order to do so, it was necessary to allow for  new field on the gantt
arch, whih will hold the xmlid of the wizard's action

related task #1929079
2019-06-03 19:39:40 +00:00
MaxLarue a82c8daf5b [IMP] web_gantt: add plan option to gantt rng
Some gantt view might not need the plan feature (add objects without
start or end date). We add a boolean to the view definition to toogle on
and off this behaviour.

related task #1929079
2019-06-03 19:39:38 +00:00
mgh-odoo 5cf88125f8 [IMP] point_of_sale: allow to chose the state on customer screen
When you are creating some customers inside the point of sale, it is
impossible to set a state on the customer address and to see the one set
if it has been created in backend.

So we've added a selction field for the state, set it's default value to
the one set on the company.

Task-1978312
Closes #33484

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-04 08:55:17 +00:00
Jeremy Kersten 02abe4ca20 [IMP] website_sale: product.product support website_publish_button
Now when you click on a variant and have the website_publisher right, you are
redirected to the correct variant.

If you don't have the access, you have the same behaviour than before and it
is the template that is unpublished. (strange!)

closes odoo/odoo#33175

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-04 08:56:52 +00:00
Raphael Collet b415da5daa [IMP] fields: add method to get a usable domain from a field
closes odoo/odoo#33816

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-06-03 12:37:39 +00:00
Antoine Vandevenne (anv) 8e30349fd1 [REF] point_of_sale: remove stock location from POS config
There is currently a stock location that is set on the pos config which
is by default the the default source of the picking type. This field is
not really usefull and we prefer that the configuration of the source
location where the POS will take products come from a dedicated
picking type that will have the correct default source location.

So we have removed the stock_location_id from the pos_config and changed
the related set on orders, by the location of the picking set on the
pos order, as it was not really consistent that if the pos_config was
changed the location of all existing orders was changed too.

TASK-ID: 1970513

closes odoo/odoo#32870

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-03 12:09:26 +00:00
Pierre Masereel a681631dd0 [IMP] point_of_sale: create one picking type by warehouse
When you are selling goods through point of sale, pinkings are created
to remove what have been sold from the stock. This picking is created by
using the picking_type set on pos_config.

For now, the there is only one picking type POS Order existing by
default, which is located on the first warehouse in data. It means that
if you create another warehouse and/or company, you will have to
manually create picking type if you want to be able to link pos config
to the new warehouse.

So now, each warehouse will have its own picking_type for POS, which
will ease the link between the pos config and the warehouse.

We've also set a default value on pos config to take the first picking
type, and added a domain that will show only the outgoing types.

TASK-ID: 1970513
2019-06-03 09:01:21 +00:00
Pierre Masereel 1f519be1f0 [REF] point_of_sale: default sales team on config
We are handeling if the default sales team for pos has been deleted by
raising and catching an Access error instead of a ValueError

TASK-ID: 1970513
2019-06-03 09:01:21 +00:00
Antoine Vandevenne (anv) 6ccd9e20a8 [IMP] point_of_sale: Show orders on Session
When you are looking at a point of sale session, the detail of what is
sales have been done during this session is stored in the POS Orders
linked to it. So we've added button on the session form that will show
all related sales done during this session.

TASK-ID: 1970513
2019-06-03 09:01:21 +00:00
Antoine Vandevenne (anv) df1150e058 [IMP] point_of_sale: Change 'Orders' menu sequence
As session, is a more global object, we want to put its menu item before
the one for orders.

TASK-ID: 1970513
2019-06-03 09:01:21 +00:00
William Henrotin 870a70eba5 [FIX] stock: relax datetime test
The comparison of two datetimes is never exactly perfect. This commit adds
one second tolerance in the tests between two dates to ensure any false
positive result is avoided

closes odoo/odoo#33817

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-06-03 08:47:08 +00:00
Pierre Rousseau 84dbcee915 [IMP] crm_iap_lead: use industry tags instead of technology tags
In order to be consistent with Lead Generation, we need to use Industry tags instead of technology tags.
In addition, we reduce the number of tags to keep only the relevant ones.

Task ID: 1941555

closes odoo/odoo#33434

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-03 06:20:25 +00:00
svs-odoo 042a01d0d6 [FIX] stock: starting demo data inventory
The demo data inventory didn't call the right method (`action_start`
instead of `_action_start`), so, if user tried to re-install stock
module, the `ensure_once` check will fail when reinstall the demo data.

closes odoo/odoo#33811

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-03 07:43:08 +00:00
fja-odoo 0a79d9a90f [IMP] website_sale: change product url to include variants
Hash containing variants unique id added to the url.
In the shop when the product page is loaded, the variants are now
selected using this hash.
The product.product website_url is no longer the template's url, it is
now using the hash and will redirect you to the right product.

task-1958091
2019-05-31 13:47:20 +00:00
Robot Odoo 1f5c9e363b [MERGE] website, *: lazy load most frontend javascript
* web, survey, account, im_livechat, payment, web_tour,
website_sale, base

Before this PR, the asset bundles were loaded in a synchronous way,
so website pages appeared to the user when all the css *and* js were
downloaded, parsed and executed. This PR adds a series of
improvements to enable lazy loading the JS on the frontend. Especially:

1) Extract the minimum part of the assets common:
- promises library and polyfill
- boot.js

2) Create "assets_common_lazy" which is "assets_common" - "minimum"

3) Include the "minimum" assets in frontend layouts using "defer"
loading and "assets_common_lazy" using "lazy" loading

4) Create a script to do the actual lazy loading in a "minimum" frontend
assets

5) Lazy load the current frontend / website editor assets

See sub-commits for details.

task-1961045

closes odoo/odoo#32181

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2019-06-04 13:02:06 +02:00
qsm-odoo 82b31aa9ff [FIX] account: fix setting invoice iframe height on load
Since the JS is lazy loaded, the iframes in the page are already loaded
once the javascript is executed. So, waiting for the "load" event at
that moment is useless as it will never happen as it already did.

Part of https://github.com/odoo/odoo/pull/32181
task-1961045
2019-06-04 07:57:20 +00:00
qsm-odoo dd19bcef84 [IMP] web: allow blocking DOMs section while all JS is not fully loaded
Use the system in website_sale where a case where this is needed could
be found. More cases can be found later during testing.

Part of https://github.com/odoo/odoo/pull/32181
task-1961045
2019-06-04 07:57:20 +00:00
qsm-odoo 02dab5dc88 [IMP] website, *: lazy load most frontend javascript
* web, survey

This commit takes advantage of the other commits of this PR to enable
lazy loading for most frontend javascript:

1) Extract the minimum part of the assets common:
- promises library and polyfill
- boot.js

2) Create "assets_common_lazy" which is "assets_common" - "minimum"

3) Include the "minimum" assets in frontend layouts using "defer"
   loading and "assets_common_lazy" using "lazy" loading

4) Create a script to do the actual lazy loading in a "minimum" frontend
   assets

5) Lazy load the current frontend / website editor assets

Part of https://github.com/odoo/odoo/pull/32181
task-1961045
2019-06-04 07:57:20 +00:00