To reproduce:
Video: https://drive.google.com/file/d/1bAh7KA_5UhhIrr-qF5A5gOVWhk3_9clj/view
1. Have multi-language website
2. Event with one ticket
3. Reload page and click the "Register" button
-> in some cases there is a traceback
`/event/great-reno-ballon-race-2/registration/new: Function declared as capable of handling request of type 'json' but called with a request of type 'http'`
Reason of the issue:
As the button "Register" in the form is defined with `type="submit"` it will send the form as plain HTTP if clicked.
This behavior is modified in the JavaScript to prevent this default behavior.
However, if the button is clicked before the JS load, the HTTP behavior is used which does create the above traceback (as the `registration/new` route accept only `json` type).
Solution proposed:
Prevent the button default behavior and make it deactivated and let the JS activate it when it is ready
Note on stability:
As JS code and XML view is modified, this fix was thought so that the JS won't have an impact if the view isn't updated.
There is theoretically no way that the XML view would be updated without the JS being updated (except manual modification in the view or rollback on the version revision after performing a module update on odoo.sh). If it was the case then the button will be deactivated until the user change the number of ticket.
OPW-2946706
closesodoo/odoo#101311
X-original-commit: 5a8892497e2b0df5e1dc8085214687786954c878
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Sens Loan (lse) <lse@odoo.com>
The original goal here is to remove the warning of the google page
speed but it actually is really better to use 'pagehide' as it is fired
more reliably than the 'unload' event and does not prevent Chrome and
Firefox to use the bfcache (browser optimization that enables instant
back and forward navigation).
The persisted property of the pagehide event is checked before
disconnecting from the worker. As for the presence/multi_tab case, it
was chosen to also consider page freezing as it seems more accurate that
what was done before (the main tab could be throttled/frozen which was
an issue).
Some resources to explain why this is better:
- https://web.dev/bfcache/#never-use-the-unload-event
- https://developer.mozilla.org/en-US/docs/Web/API/Window/pagehide_eventclosesodoo/odoo#101309
X-original-commit: e043891d5074ca04ee1bbed421ae5efe5f2f8b88
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
When an action was retrieved from session storage, the no content helper
content was not markuped. It would therefore display hmtl text on the
user screen.
closesodoo/odoo#101306
X-original-commit: 592b8016b8a44dc1775918e4ffbf572e9b02c50f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
*: website_event, website_forum, website_hr_recruitment,
website_sale, website_slides
The website content list views should act as a page manager (click on
a record redirects to iframe, "CREATE" and "Publish / Unpublish"
buttons, ...).
The goal of this commit is to add a kanban version of these views for
key app models ('website.page', 'blog.post',...) since the same code
can now be used for list and kanban controllers / renderers since [1].
It is especially important in mobile where the kanban views are nicer
than list views by default.
[1]: https://github.com/odoo/odoo/commit/ed09db19c372da8d8be541f365117d1ce8e965ba
task-2889981
closesodoo/odoo#101174
Related: odoo/enterprise#31821
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- create and send a quotation
- make a failed payment (through cutomer preview)
- create and send a second quotation to the same customer
- make a succesful payment this time
- redirect takes to the wrong quotation (failed one)
Bug:
polling the processed payments initially returns both transaction
but the following polls only returns the rejected payment
(introduced in [1] processed transactions are filtered out)
since there's only a single transaction, redirect takes to it
Fix:
if there's only a single succesful transaction (regardless of the rest)
it means the current payment was successfull so we redirect to it
opw-2954162
[1]:https://github.com/odoo/odoo/pull/31741/commits/7612659565ee24f1c878b81e6c86b5780fbd5a3dclosesodoo/odoo#101252
X-original-commit: 6ea920d2573cf68c6a5cbaf1f6af31fd7de155ff
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
Currently, there are severlar issues with the karma card, like:
1/ improve karma display
2/ images of the rank and badges are can be changed by user, but
after saving the changes are discarded
Apart from that, in the course navbar, the hard-coded white
text color is given, due to which in some themes the text
becomes invisible. And in the courses cards below navbar,
the course title is not editable.
This commit improves the following points:
1/ Makes the next rank card (on course home page) a bit bigger, adds a
tooltip on the progress bar that shows gained xp out of minimum xp
needed for next rank (ex: "2500/10000 xp") if there is next rank,
and improves the text below rank image that now shows xp to gain for
next rank or if there isn't next rank, simply displays the earned xp.
2/ Makes the images editable (in karma card as well as in the
user profile and in '/profile/ranks_badges' page)
3/ Makes the rank title editable
4/ Removes the hard-coded white text color from the course
navbar and make the course title editable
taskID-2853264
closesodoo/odoo#92871
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Debugging websockets is cumbersome, this commit adds debug
messages to the websocket worker in order to ease debugging.
closesodoo/odoo#101172
X-original-commit: 1abb6c45b06d83b602358a58f351e86b27f3f0c7
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This merge removes the readonly mode of form view and revamps the layout of this same view.
More details about what implies the remove of the readonly mode:
- The readonly mode of form view is removed but not for the fields.
it means that the fields in the view are always in edit mode except if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when hovering the status text in control panel.
- The chatter now takes all the place on the right side of the view.
task id: 2822553
enterprise part: https://github.com/odoo/enterprise/pull/31733closesodoo/odoo#101118
Forward-port-of: odoo/odoo#100570
Related: odoo/enterprise#31778
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the editor was always updating the record even when
it's content was not modified or even focused.
X-original-commit: d067710220f6a528f251a44a51863f4f8fb12034
Part-of: odoo/odoo#101118
This commit does multiple things:
- The readonly mode of form view is removed but not for the fields.
it means that the fields in the view are always in edit mode except
if we force them to be readonly.
- The control panel is revamped to take less vertical space and shows now
the record editing (dirtiness)/validity status after editing the record.
- The record is saved only when leaving the view or by clicking the save
button when hovering the record status in the control panel.
- The record can still be discarded by clicking the discard button when
hovering the status text in control panel.
task id: 2822553
X-original-commit: 77824ad44b6945a9811120380747f87ef6362ae2
Part-of: odoo/odoo#101118
Co-authored-by: luvi <luvi@odoo.com>
This commit changes the layout of the form view to move the
control panel next to the chatter instead of being on top.
The chatter now takes all the place on the right side of the view.
task id: 2822553
X-original-commit: 7f36dd05b3238c3d27aab6e5af12233df27067e4
Part-of: odoo/odoo#101118
This commit adds an option to many2one field to open the record either
in target new (dialog) or target current (replace view) which is now
the default.
task id: 2822553
X-original-commit: abe26f6eebb450512b35c25094329f85b98c15d9
Part-of: odoo/odoo#101118
Steps to reproduce the bug:
- Install [l10n_it_ddt]
- Create a storable product “P1”
- Create a SO for “P1” with qty 3
- Deliver 1 unit and create a backorder
- Generate the invoice for the delivered qty: 1
- Post the invoice
- smart button with the link to DDT n°1 appears
- Deliver the remaining 2 units
- Create the second invoice
- Post the invoice
Problem:
The link to DDT appears but with the 2 pickings, whereas in this case
only the 2nd picking is linked to the invoice.
Before using the `account.move.line` records, we sorted them by date
in order to always use the first created one to link it with the first
picking created, however if two `account.move.line` were created in
the same days, they will be ordered randomly, so we also have to
sort them by id if the date is the same.
opw-2968401
closesodoo/odoo#100998
X-original-commit: e8e99c05696308422183516e68c0b9ed5495d7ca
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
In PR #81184, a typo was fixed,
however there was still one instance of the old typo that wasn't replaced.
This commit replaces it.
Related task-2704288
closesodoo/odoo#101231
X-original-commit: 9ba8e650078982a3c6d1546fad27ec39a3ccd2b9
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
*: website_blog, website_hr_recruitment
Add multi-edit on the remaining "pages" list views not using it:
- pages
- blog posts
The only remaining one would be "jobs" but editing the Department field
seems broken at the moment.
Related to task-2889981
closesodoo/odoo#101215
X-original-commit: be58687284884550cc4e6c2ac7255abee4eb1125
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The goal of this commit is to add a 'Publish' / 'Unpublish' button to
the additional actions of the 'website content' list views.
'Archive' / 'Unarchive' options are also removed for the 'website.page'
records.
task-2889981
X-original-commit: de02335b8db1396a24e10b78f8f78ed79fded421
Part-of: odoo/odoo#101215
*: website_blog
The goal of this commit is to update JS code to have the same behaviour
from the 'website content' list view (trigger the 'new content' dialogs
on "CREATE", add a website selector to filter content) on kanban views
too.
The blog post kanban view has been adapted to use this. Other "website
content" related records will receive a kanban view in a further update.
This is is also important so that the mobile UX is nicer.
task-2889981
X-original-commit: ed09db19c372da8d8be541f365117d1ce8e965ba
Part-of: odoo/odoo#101215
The 'addPage' code on website pages list view was duplicated from
'new_content.js'. The goal of this commit is to move this code to the
'AddPageDialog' component.
task-2889981
X-original-commit: 58698f848703395ff680bc7586ecc8eec4fb61ae
Part-of: odoo/odoo#101215
The goal of this commit is to:
- Tweak the website filter (on website pages list added at [1]) to make
it work for all website content records (page, blog, ...).
- Update the 'New Page' dialog to be able to select the website_id for
the new page.
- Tweak the '_compute_is_homepage()' method to set 'is_homepage = True'
on website's '/' page when 'homepage_url' is not set in settings.
[1]: https://github.com/odoo/odoo/commit/940f4ee875332dafa1f379970a7683be6b3ee606
task-2889981
X-original-commit: d6014c60acc4231a5e56d492d2a39deaf789cbe8
Part-of: odoo/odoo#101215
Method `_compute_reference` computes unique reference for a transaction. If
reference from `account.move`'s `payment_reference` was never used, the method
just returns that reference. Othwerwise it adds a counter. The latter requires
to make a regular expression to count records with the same prefix. However, if
the prefix has special regexp characters (e.g. `+++INV/2020/666+++`), then we
have to escape the characters first. This is what this commit does.
opw-2994126
closesodoo/odoo#101201
X-original-commit: 6c513d43eba8c58171b0fb632d0ac82b28aa9e7d
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Ivan Elizaryev (iel) <iel@odoo.com>
Correctly set the border-color in case of invalid cell
task-2984169
closesodoo/odoo#101151
X-original-commit: fd355cc609cddc20e7c01a7ca12f93d6cd05c7ac
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
purpose:
Contract management is a prior thing on an employee profile;
Thus, Contract smartbutton should be in the second position,
after Documents smartbutton, in case documents_hr is installed.
task - 2984690
closesodoo/odoo#100532
Related: odoo/enterprise#31481
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
- Use ecommerce and the mollie payment
- Open two tabs, on one pay via mollie, on the other
while the mollie payment is in progress add or
remove items to the cart
Current behavior:
Once the payment is validated the customer is redirected to
a page that show a wrong value for the transaction, and there
is nothing about the amount mismatch
Expected behavior:
The transaction has the right value and the text in warning
explains the situation.
opw-2983494
closesodoo/odoo#101187
X-original-commit: 0688b1e609512db7e4d66020171df8c1b9969c20
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Before this commit: if one recurrence event in the google calendar
contains an attendee with one of the alias emails, it wouldn't get synced
and raise an error.
The solution is to remove those attendees.
opw-2963825
closesodoo/odoo#101037
X-original-commit: c9fa96604950f61c079627b88495130365d3b534
Signed-off-by: Arnaud Joset <arj@odoo.com>
Before this commit: the order sequence jumped if the paid orders from
previous sessions were loaded.
Steps to reproduce the issue:
1. Open a POS session and create some orders
2. Close the session and open a new one
3. Open the ticket screen, and filter paid orders
4. Click the new order button
=> the sequence jumps equal to the number of loaded paid orders
The solution is not to increase the sequence if it is loading the paid
orders.
opw-2979271
closesodoo/odoo#100906
X-original-commit: f948b2eb8273f28ba3a30307a626ec469c3625a2
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Release notes:
https://github.com/odoo/owl/releases/tag/v2.0.0-beta-21
Details:
- fix: prevent side effects at template compilation
- fix: props validation: does not crash with t-call-context
- fix: make t-portal work in all cases
- fix: make props validation work through slots
closesodoo/odoo#101207
X-original-commit: a09733b8d60ba36327695657221304ef19eaed42
Signed-off-by: Samuel Degueldre <sad@odoo.com>
When we have products having optionnal products, the product info popup
is displayed when you add this product.
Since a fix made
https://github.com/odoo/odoo/commit/6da353d66f42965f83db87caee3d1ab468b556af
we get a traceback when adding a product having such optional products.
So we are now just correctly call the function needed to display the
popup.
closesodoo/odoo#101216
X-original-commit: 178bdec7ce0abe02861516af2678425b8721e82c
Signed-off-by: Masereel Pierre <pim@odoo.com>
Tests adaptations will come in a following PR, but the current focus is set on owl conversion.
task-2936932
closesodoo/odoo#101208
X-original-commit: 22c8e0ec8cd0ffc6a14302fc548bb5fffc5c4e11
Related: odoo/enterprise#31820
Signed-off-by: Xavier <xbo@odoo.com>
This commit adds an option which allows getting the seconds in the
returned formatted hour.
task-2936932
X-original-commit: c7a3a40cadfe5f2db951860173417044e8e365c1
Part-of: odoo/odoo#101208
This commit introduces the new calendar view written in owl.
closesodoo/odoo#101185
X-original-commit: e88988f58582d5b49a32d7102a74a176f40c4c69
Related: odoo/enterprise#31808
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.
X-original-commit: f3adc2b0f70feb80292f6c755d53690e49647dbb
Part-of: odoo/odoo#101185
Co-authored-by: Bruno Boi <boi@odoo.com>
This commit adapts codebase following the move and integration of the
touch device detection and customization (through the o_touch_device
class) in community.
X-original-commit: 5ae86ad473dd69559820b1f599ce389484cdebbc
Part-of: odoo/odoo#101185
Co-authored-by: Jorge Pinna Puissant <jpp@odoo.com>
The domain of `work_location_id` requires the company_id and address_id
which were missing from the tree view, showing a traceback when trying
to change that field.
closesodoo/odoo#101195
X-original-commit: 8376adc197208490bf3e4ce0ddbdb6f8e1ae6c60
Signed-off-by: Kevin Baptiste <kba@odoo.com>
With the change to 'always edit' on form views by default, several
'oe_read_only' fields had to be modified to play nice with the fact
that in most cases, there is no read_only mode
closesodoo/odoo#101188
X-original-commit: 868992abeeda983768323e1126b5643eff8fdb33
Related: odoo/enterprise#31810
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Since [1] when the bus service was adapted to wowl, the assets watchdog
service was imported in the frontend. Because the assets will be the
right ones on the next visited page, the notification it might trigger
is seen as degrading the website UX.
This commit removes the assets watchdog service from the frontend
pages.
Steps to reproduce:
- Visit a public page in a tab - keep it open.
- From a different browser, log in and rebuild assets.
=> Notification appears in visitor's tab.
[1]: https://github.com/odoo/odoo/commit/3ae11c87e8a395219229416c2777bcdcdacd08ac
task-2922959
closesodoo/odoo#101186
X-original-commit: d2efe6220281c00a9a6be154113ff20c0745dde6
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Since #97888 it was possible to request a leave during a stress day that
covered multiple day due to a typo in the logic.
task-2995191
closesodoo/odoo#101171
X-original-commit: 7fdb1a9980adeb5fded58b6715c3c6a5b66099ed
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Current behavior:
In the sales report of a product, the margin was not appearing
for product that were sold in the PoS.
Steps to reproduce:
- Activate the margin option in the settings
- Create a product available in PoS, the product should have a price
and cost set
- Start a PoS session and sell the product, then close the PoS
- Go on the product page, click the "Sold" smart button
- Add the "Margin" measure to the pivot
- There is no value in the margin column
opw-2937616
closesodoo/odoo#101168
X-original-commit: b230194d8f6a93d374a31f05e74c8fb26277d905
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Setting width *and* height attributes allows to reserve some space to
avoid layout shift during page loading. Of course, CSS rules set the
height the user chose, while the width is set to 'auto'. But while the
image is loading, it is best to already reserve some width to reduce
layout shift (like making the menu move or even re-render itself into a
"+" menu).
The chosen values for the space reservation are the ones of the default
logo and theme, but it does not really matter as long as they are
coherent. While the image is being loaded, the chosen user height is
still applied and the 'auto' width rule induces a width that respects
the aspect ratio set by the width and height attributes. That could be a
problem if the real logo has a larger height than width, in which case
the layout shift would be increased because of the arbitrary values set
as width and height, but in most cases, this should reduce it.
This also allows to gain some page speed scoring.
Examples:
=# Logo 200 x 100, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 200 / 100 * 50 = 100, height = 50
-> layout shift of 100 - 0 = 100
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 200 / 100 * 50 = 100, height = 50
-> layout shift of 100 - 118.75 = -18.75
=> Shift of 18.75px to the left, way better than shift of 100px to the
right
=# Logo 100 x 100, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 100 / 100 * 50 = 50, height = 50
-> layout shift of 50 - 0 = 50
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 100 / 100 * 50 = 50, height = 50
-> layout shift of 50 - 118.75 = -68.75
=> Shift of 68.75px to the left, kinda the same as a shift of 50px to
the right.
=# Logo 100 x 200, height set to 50
Before this commit
- while loading: width = 0, height = 50
- once loaded: width = 100 / 200 * 50 = 25, height = 50
-> layout shift of 25 - 0 = 25
After this commit
- while loading: width = 95 / 40 * 50 = 118.75, height = 50
- once loaded: width = 100 / 200 * 50 = 25, height = 50
-> layout shift of 25 - 118.75 = -93.75
=> Shift of 93.75px to the left, worse than shift of 25px to the right
but the case of having a 'portrait' logo is considered less common
than having a 'landscape' logo. Ideally, we should choose the
arbitrary values related to the most common aspect ratio.
closesodoo/odoo#101149
X-original-commit: 73786c5c45202914e02325c19a2afaa47d31c341
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
In order to improve the page speed score and avoid layout shift, set
both width and height of the tiny Odoo logo used in the copyright
section of the website footers. This was able to be done with no
drawback:
- Set the width and height attribute of the image being loaded
- Leave the CSS rule `height: 1em;`
- Add the CSS rule `width: auto;` (which was implicit before)
By doing this:
- Once the image is loaded, the behavior is exactly the same as before
- While the image is loading, the height is still using 1em but the
difference is that the "auto width" now know the final aspect ratio
of the image thanks to the width and height attribute -> the width is
thus the same as it will be once the image will be loaded (while it
was 0 before)
X-original-commit: a709a10e0b746242a6bca1af2ce92020ec917464
Part-of: odoo/odoo#101149
A "thematic break"[1] is composed of 3 or more characters (-, _,
or *). The current separator using only 2 characters between the main
body of the PR and the footer / addendum makes it more difficult to
interpret the message.
Update to 3 so e.g. the mergebot can strip the footer.
[1]: https://spec.commonmark.org/0.30/#thematic-breaksclosesodoo/odoo#101148
X-original-commit: c7bf932c9eb2fc9bc34c653c51bce1552d6afb54
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Not all employees have a company car. This commit adds a private license plate field on hr.employee.
The field allows the HR Officer and HR Administrator to search for emloyees based on their license plates.
If fleet and hr apps are installed, the search is based on both the company car and private car license plates.
task-2936873
closesodoo/odoo#101146
Related: odoo/enterprise#31796
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Before: On a map view, a bunch of points get loaded one by one. Each of
them triggering a new render of the controller. Currently, the useModel
hook does a deep render no matter what. If you are trying to set a
custom filter un the filter menu in the control panel, the content would
systematically diseapear (rerendered) when a new map point loaded.
After: To prevent this, setting the input node as t-model is a solution.
It allows owl to keep track of the value of the input and correctly
set it back when a render occurs.
closesodoo/odoo#100421
Signed-off-by: Géry Debongnie <ged@odoo.com>
The aim of this commit is to:
- allow OSS to use tax that aren't declare by TaxReportLine
- have the oss tax automatically populated with the correct tags for spanish
tax report
- Add taxes specific to the spanish OSS : No sujeto y acogidas a la OSS (Servicios) and No sujeto y acogidas a la OSS (Bienes)
using the official modulo 124 tag
closesodoo/odoo#101121
Community-pr: https://github.com/odoo/odoo/pull/99273
Task: 2930758
X-original-commit: 2a21e4c084ba952eba1b4a7bb6f6ee31875d70ea
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
Co-authored-by: Camille Casp Spiritus <casp@odoo.com>
This commit dynamically translate some content in the spreadsheet.
Static translated terms are extracted from the spreadsheet data.
One might think we could translate the spreadsheet upfront, server side,
by translating the data before sending it to the client but it could lead to
unexpected behaviors though:
Let's say a chart has a translated title, if you copy-paste it from one sheet
to another, you still want the title to be translated/translatable.
In other words: manipulating things in the spreadsheet should be done on
the raw, untranslated, data.
X-original-commit: 53dc147504bfc3ddabef61a2bae8610f526bf6ac
Part-of: odoo/odoo#101120