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/4281Closes#33213
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/4281Closes#33213
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)
Closesodoo/odoo#33696closesodoo/odoo#33757
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
- Allow to set an image on each forum
- Review the form view
- Redesign the forum index with cards and header
task-1984582
closesodoo/odoo#33530
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
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>
* = 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
* = 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
* = 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
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
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
closesodoo/odoo#33652
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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
closesodoo/odoo#33823
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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.
- 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
This commit adds a colored ball in front of search panel categories
if the records have a `group_hex_color`
Task: #1974652closesodoo/odoo#33842
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
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
closesodoo/odoo#31944
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
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
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
closesodoo/odoo#33556
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
* 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
closesodoo/odoo#33825
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
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
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>
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!)
closesodoo/odoo#33175
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
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
closesodoo/odoo#32870
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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
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
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
closesodoo/odoo#33817
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
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
closesodoo/odoo#33434
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
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.
closesodoo/odoo#33811
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
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
* 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
closesodoo/odoo#32181
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
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
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
* 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