Reintroduces 5324284f5 that was reverted because in the case of an URL
like /payment_stripe/static/src/js/stripe.js directly inside a QWeb
template, we would possibly get:
/fr_FR/payment_stripe/static/src/js/stripe.js
Which is not accepted by werkzeug SharedDataMiddleware we use to serve
static data in /{module_name}/static/ directories.
Added test without changeset failed with:
- test_process_att_no_request_lang: <AssertionError>
line: self._test_att('/en_US/', {'href': '/'})
wrong result: {'href': '/en_US/'}
- test_process_att_with_request_lang: <AssertionError>
line: self._test_att('/', {'href': '/fr_FR/'})
wrong result: {'href': '/'}
- test_process_att_matching_cdn_and_lang: <AssertionError>
line: self._test_att('/en_US/a', {'href': 'http://test.cdn/a'})
wrong result: {'href': 'http://test.cdn/en_US/a'}
- test_process_att_no_route: <AssertionError>
line: self._test_att('/my-page', {'href': '/fr_FR/my-page'})
wrong result: {'href': '/my-page'}
- test_process_att_url_crap: <IndexError: list index out of range>
line: request.httprequest.app._log_call[-1],
opw-1922051
closes#32095
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Sell 4 units of a product in stock
- On the picking, create a scrap for 1 unit
- Validate
- In the immediate transfer wizard, validate
The scrap is reset to zero.
This is because the wizard overwrite the done quantity with the reserved
quantity (0.0).
If the move is already done, there is no reason to overwrite the
quantity.
opw-1958514
closesodoo/odoo#32410
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The jQuery selector is slightly too permissive, and therefore incorrect
elements may be matched. See opw for example.
Co-authored-by: Nicolas Martinelli <nim@odoo.com>
opw-1947698
closesodoo/odoo#32149
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Because of rev. d3453f7d15
when none of the pos order lines were reconciled,
the closing of the point of sale sessions failed
because of the tax cash basis entry generation.
There is no need to create the tax cash basis entries as nothing has been reconciled.
A known case is when the the bank journal credit account is set to a receivable account,
which has as effect to fully reconcile the payment line with its counterpart,
leaving no payment lines to reconcile with the order debit lines.
This is obviously not a correct accounting configuration,
but the point of sale validation did no fail because of this previously.
Fixes#32330closesodoo/odoo#32399
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Often an invoice with the same amount is send to the same customer every week/month. If the customer pays just the amount, without any matching invoice information, common practice is to take the oldest invoice first.
Odoo currently suggests the invoice with the highest due date.
After the fix Odoo will suggest the invoice with the lowest due date.
closesodoo/odoo#32334
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This reverts commit 5324284f56
This reverts commit ad826f56ba.
If for example we had in a template:
<script type="text/javascript" src="/payment_stripe/static/src/js/stripe.js"></script>
it has been reproduced to be gotten as:
<script type="text/javascript" src="/de_DE/payment_stripe/static/src/js/stripe.js"></script>
which is unexpected and could cause an error.
closes#32090
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The field `has_tracking` should be read-only, there is no reason to make
it writeable.
opw-1958266
closesodoo/odoo#32080
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When a new `product.template` is imported with `active` set to `False`,
the associated `product.product` is active.
This is not consistent with what happens in the UI: when a template is
archived, all variants are archived.
At variant creation, we keep the `active` value of the template.
opw-1955116
closesodoo/odoo#32461
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Make sure to retrieve the lang in case it is inactive. Note that a lang
cannot be deactivated if it is set on a `res.users`, but no check if
performed on a `res.partner`.
opw-1964655
closesodoo/odoo#32457
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The client IP and email are useful pieces of information for auditing
transactions, and are used by the Fraud Detection Module(s) of Ingenico.
closesodoo/odoo#32058
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
With 953a693df when a route is not found we assume it is a website.page
that can be multilang.
But with #31792 we should once again prefix URL by the language if
necessary.
The combination of the two cause issue when an url like `/web#home` is
tested since we do not take `#` into account, we check if the route is
multilang but no route `/web#home` is found => so we get
`/fr_FR/web#home`.
With this fix, `#fragment` is not taken into account when searching
route.
related to #31792
related to opw-1922051
closes#32059
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In 10.0 and before, if we were eg. on website page /fr_FR/contact, if
`fr_FR` language (french) is installed and not the default website
language we would have all URL towards translated content (route with
multilang=True) prefixed with /fr_FR/ (the language code).
With 9cd982bcc some improvments were done to CDN but this also breaks
language prefixing, so this cause an unecessary redirect:
- we are on /fr_FR/contact and click on "Shop"
- we go to /shop
- odoo redirects US /fr_FR/shop
With this PR, URLs are prefixed with language once again.
note: the added test is hackish but the function tested depends on a lot
of odoo.http things that are hard to use for test (request.render,
request.context, request.httpreqest).
opw-1922051
closes#31792
Signed-off-by: Christophe Simonis <chs@odoo.com>
With this patch, `sale.order.line` records can now be created in batch,
this means that operations such as:
- SO copy
- SO create + commands
- SO import
will benefit from this patch in terms of performance.
E.g.
For a SO of 2k lines, duplicating the SO takes:
Before patch: 1515s
After patch: 171s
Creating an SO with SOL as o2m commands:
Before patch: 181s
After patch: 43s
closesodoo/odoo#32040
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
At the moment, the HS Code is only used in FedEx. This is confusing for
users, since they expect it to be supported for all providers.
We improve the tooltip.
opw-1961472
closesodoo/odoo#32445
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In a multi-company / multi-currency / multi-pricelist environment,
sending the sample SO may crash because the `company_id` field on the SO
line is not yet defined when a price conversion is necessary.
This is because it is a stored related field used in `product_id_change`
which is called programmatically at creation.
opw-1948629
closesodoo/odoo#32443
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When doing a copy, create the new translations directly in SQL and handle
potential conflicts.
Conflicts can occure in case of reinstallation as showed in opw-1955062 and
opw-1950117.
In case of "leftovers" of translations (e.g. remaining after the uninstallation
of a module), creating the new translations (when reinstalling the module) may
produce a conflict with (type, name, res_id, lang) and raise an error.
This is NOT a problem of reading .po file during installation (which handles
correctly conflicts) but of business code creating new records and linked
translations (e.g. website copying website.menu records).
Removing old translations during uninstall is handled in a previous commit in
ir.model.fields _drop_column method.
This commit fixes the reinstallation on instances with leftover translations
and fixes the issue without needing a manual intervention (i.e. delete the old
translations manually).
Closesodoo/odoo#32056
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Better than if ba58888ced as the records may be removed via ondelete='cascade'
(where the unlink is not called on the record). Will be faster too.
A solution to opw-1955062 and opw-1950117 with uninstallation of website.
Closesodoo/odoo#32056
- Create 2 `crm.lead`:
Expected Revenue: 100; Probability: 99 %
Expected Revenue: 200; Probability: 0 %
- Go to Reporting > Sales Channels
The amount displayed next to 'Open Opportunities' is 148.5 is instead of
99.
opw-1947975
closesodoo/odoo#32011
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The price comparison can be incorrect because of float representation
differences. We make the template more robust against this problem.
opw-1945541
closesodoo/odoo#32012
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The picking barcode must be displayed in the batch picking report like in 11.0
opw:1958092
closesodoo/odoo#32004
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Complete cd4080839f
<span class="fa fa-globe" title="Title stuff"/>
is not correctly extracted but
<span class="fa fa-globe" title=""/>
was also extracted while there is no content
Check the size of the content too
Similar content is present on odoo.com website and should not be translatable
on Transifex
closesodoo/odoo#32018
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This commit adapts the leave request form on mobile.
Dates fields didn't take all device width.
As it's not a critical issue, it's up to the customer
to update this mobule to apply this fix.
Task ID: 1944884
closesodoo/odoo#32020
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
In the `getMatchedCSSRule`, the transcoder try to find the real value of
a `text-align: inherit` css rule by ascending the html tree until it
finds a `text-align` with a meaningful value. By default is exits if it
reachs the `<html>` top node but doesn't exit if a call to `.parent()`
exits the dom (the behavior of jquery is to return a dummy element when
calling `.parent()` on an element that has no parent). This lead to an
infinite loop for badly formatted html content.
opw-1951095
closesodoo/odoo#32014
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
With the demo data:
- Go to Inventory
- On the 'Delivery Order' Kanban card of YourCompany, click on 'Late'
More pickings are displayed than the expected count.
This is because the domain of the filter is not in line with the domain
of `_compute_picking_count`.
Closes#29777
opw-1951090
closesodoo/odoo#31994
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The method `onChangeVariant` was overridden in 12.2 to fix an issue with the new
web editor and separately overridden in 12.0 to fix an issue with the product
configurator.
After the forward-port, the method was defined twice, and only the second was
taken into account.
This commit fixes it by merging the two methods.
closesodoo/odoo#32041
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, there were a crash if you tried to add an optionnal
product in a new sale order without saving it.
Apply same logic as in the ListRenderer: buttons with type="object" are
disabled for no saved yet records, as calling the python method with no
id would make no sense.
To avoid to expose this logic inside all Kanban views, we define a
specific KanbanRecord Class for the One2many case.
This could be refactored to prevent from duplicating this logic in list
and kanban views.
Original Task ID: 1945006
closesodoo/odoo#31695
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
While waiting for a larger fix of the themes, force prevent overriding
of the web editor's UI CSS by themes. This is achieved by applying
`!important` on all web editor UI CSS. This is a temporary fix until
the themes CSS is fixed and/or the new web editor library is ready.
closesodoo/odoo#31721
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Purpose of this merge is to at last perform a cleaning of layout and design for
eLearning pages still not completely updated with magic layout touch.
Impacted pages
* course (channel) main page: better top and banner, better navigation.
Improve training content list display, clean documentation content list
display and navigation;
* lesson (slide) main not-fullscreen page;
* lesson (slide) fullscreen page / widget;
* homepage: clean navigation;
This merge also contains various fixes and UX improvements for fullscreen
lesson display as well as user profile page. Thanks to @stefanorigano and
@qmo-odoo for their input.
This merge closes tasks 1941250 about fixes and layouting of new eLearning
application. Thanks for your attention.
closesodoo/odoo#31977
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>