In the odoo/odoo#122194 PR I incorrectly used the `need_cancel_request`
flag instead of the `show_reset_to_draft_button` one.
Italian EDI doesn't allow any sort of cancellation
(in case of error you have to a full refund credit note).
closesodoo/odoo#136436
Signed-off-by: Josse Colpaert <jco@odoo.com>
Previously, the self-order code and parameters were split into two parts
mobile and kiosk.
Now kiosk and mobile have been merged with each other to simplify
maintainability.
closesodoo/odoo#136051
Related: odoo/upgrade#5174
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
The iframe doesn't need assets tests because they are loaded outside of the iframe.
The tour didn't crash because the content of the iframe was present (below the traceback message)
closesodoo/odoo#135492
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
This commit fixes two issues with the ´date´ argument for
the ODOO.CURRENCY.RATE function.
First, the helper to cast the date is `toJsDate`, not `toJSDate`. Using
the wrong function name obviously crashes.
Second, the date was actually given to the server as a full ISO datetime
string, including timezone (UTC).
For function `ODOO.CURRENCY.RATE("EUR","USD", "12-31-2020 00:00:00")`, we
actually sent to the server "2020-12-30T23:00:00.000Z" (Brussels local time)
Notice that it's the previous day!
The field of `res.currency.date` is a date field, so it doesn't make sense
to send a datetime.
Now, only the date is sent ("2020-12-31")
opw-3498115
closesodoo/odoo#136411
X-original-commit: 6a4b7e7f216dc9a6372f5cc382262ff09cb317f3
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Problem
---------
When you go in the settings -> layout (debug mode) -> select external
layout --> preview document a traceback appears due to infinite looping
in the view definitions.
Solution
---------
This field is highly technical and should not be fiddled with by users.
For such reason, we set it as `readonly`.
task-3479152
closesodoo/odoo#136399
X-original-commit: 03cffc460e620639db6dbe132aa0be073a6396f5
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
Before this commit, some actions related to link creation and edition
were not tested by the LinkTools tour.
This commit adds steps to the mentioned tour in order to avoid
regressions of the issues fixed in the referred task.
task-3284649
closesodoo/odoo#136278
X-original-commit: b2a79ed9960d88d1bdf6465389f4ef720f6bc235
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
When changing a link's content, its URL (href attribute) might change
(if the new label is a valid URL), due to a mechanism in OdooEditor.
Before this commit, when a change in the link's content leads to a href
change:
- if the LinkTools is opened, the URL input field would become outdated
and display an incorrect URL.
- likewise, if the popover is shown, its content and position would be
outdated (possibly covering the link's new content).
This commit makes sure both the LinkTools URL input field and the
popover stay up-to-date if a link's content or href changes.
task-3284649
X-original-commit: 1b0952f3635f5677ba3ab221a28ceb26920a1862
Part-of: odoo/odoo#136278
Before this commit, any changes made to label input field were lost when
the LinkDialog or LinkTools component was re-rendered.
This commit fixes it without leveraging OWL's reactivity/declarative
approach, because most of the code in these components is imperative and
not yet converted to the OWL paradigm, leaving such refactor to be done
in the master branch.
Part-of: odoo/odoo#136278
If a link's content is equivalent to its URL, two problems can arise
when its URL is changed via the LinkTools:
- The link's content becomes outdated, showing a different URL;
- On LinkTools destroy, the OdooEditor mechanism that updates a link's
href on label(content) change will update the href according to the old
label, effectively reverting the changes in the URL.
This commit avoids such issues by syncing the label with the URL input
field in such cases.
task-3284649
X-original-commit: 8ddcc08c1700151e697ecb3c0c1daec2db9f8fd2
Part-of: odoo/odoo#136278
Before this commit:
- URLs like "domain.com/@/page" were incorrectly detected as an email
URL by Link(Dialog/Tools),
- switching from an email URL to a http URL with the Link(Dialog/Tools)
was not possible (URL remained prepended with "mailto:").
This commit improves email detection from simply looking for a "@" to
something slightly more robust, and makes switching between 'http'
and 'mailto' links possible.
task-3284649
opw-3245501
X-original-commit: e849ff4333355386dfb79bc574c93c76ed3e2d3b
Part-of: odoo/odoo#136278
Typing a URL + SPACE transforms the URL into a link.
Before this commit, email URLs were incorrectly prepended with
'https://'.
Because it is not desirable to automatically transform email URLs, this
commit disables link transformation for email URLs, leaving it only
active for http URLs.
task-3284649
X-original-commit: ad0e7845fceb578398e42e4b35820c415734452a
Part-of: odoo/odoo#136278
OdooEditor has a mechanism to update a link's href on label change, if
the new label is a valid URL.
Before this commit, there were two issues:
1. it did not work for email links. In fact, because this mechanism was
incorrectly prepending email URLS with 'https://', [1] disabled it for
'mailto:' links.
2. when a link had a 'http' href but its label did not contain the protocol,
upon label change (into a valid URL) the link had its href changed to 'https'.
This commit:
1. re-enables the auto update mechanism for email links and fixes it, so
that it can correctly update both http and mailto links.
2. fixes the 'http' to 'https' coercion issue, making sure the current
protocol is kept when updating http(s) links.
task-3284649
[1]: https://github.com/odoo/odoo/commit/ea00a628969a0eeda66e06776af721a99a32cc57
X-original-commit: 6740e2821c51897baa110e9e4129b40c403e000c
Part-of: odoo/odoo#136278
Commit [1] separated the two responsabilites of _onURLInput: making
changes to the DOM and updating the UI, taking care that only the second
one is done at start.
But this broke the following functionality:
- Have a URL-like text (ex: odoo.com), select it and click the link icon
on the sidebar.
- The URL is deduced from the link's label.
- Click anywhere to close the sidebar.
Before [1], the link transformation would be kept. After it, it is not.
This happens because this is a particular case in which we want to apply
changes to the DOM at start time, as if a URL input event had happened.
This commit fixes it.
task-3284649
[1]: 54746012d3
X-original-commit: da0a3f34401547478107945626034d7932855f02
Part-of: odoo/odoo#136278
Before this commit, the setup actions performed by _configureToolbar
were missing for the website toolbar. This resulted, among other things,
in non-responsive buttons like create link or insert media.
Part-of: odoo/odoo#136278
This commit changes the canOpen prop of the many2oneAvatar field to be
set to true only when in form view. The field will therefore stop being
a link in readonly when outside of form view.
closesodoo/odoo#136118
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
When the user using `point_of_sale` deletes pos restaurant and tries
to load demo products in pos shop then user will face error.
Note: Use db without demo data
steps to produce:
- Install `point_of_sale`.
- Point Of Sale > Configuration > Point Of Sales, delete pos restaurant.
- Point Of Sale > Shop > New Session, click on `our demo products`.
Error: `KeyError: 'name'`
After applying our commit, if the user clicks on `our demo products`
after deleting pos restaurant then the user would be atleast able to see
shop demo products and other demo products which are not part of
pos restaurant.
sentry-4399441443
closesodoo/odoo#135633
X-original-commit: feaf26db77fde9afae23c8b3c3ea2f0f441b4dae
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
The onboarding demo data cannot be loaded since f96ea753f3.
Steps to reproduce:
- Start a database without demo data (--without-demo=True)
- Open a POS session for the default shop
- Click to load demo (onboarding) data
An error is raised.
The error is due to a mistake in the XML, the food category logo is not assigned to the right record.
closesodoo/odoo#136392
Task-id: 3519677
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Since a869ee87f2, the cashier can no longer close a session from the frontend UI if the POS config has not a cash payment method.
Steps to reproduce:
- Remove any cash payment method from the POS config you want to use
- Open a POS session for the previous POS config
- Make an order
- Try to close the session
A (silent) error is raised, the user cannot close the session.
This error is particularly noticeable when we don't use demo data (--without-demo=True).
The fix consists in correctly checking if there is a cash payment method or not.
closesodoo/odoo#136387
Task-id: 3519547
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
In 6698406b92a598f24fa0a778a28b6ef727adc008, we removed action
mrp.mrp_production_report. action_view_mos still using this action, we
change it to use mrp.mrp_production_action instead.
closesodoo/odoo#136382
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Steps to reproduce the bug:
- Create a storable product “P1” with BoM:
- Component C1:
- Quantity: 2
- supplier:
- add any vendor, min quantity: 3
- Create a MO to produce 1 unit
- Click on the manufacture overview
Problem:
A user error is triggered:
`“The unit of measure Units defined on the order line doesn't belong
to the same category as the unit of measure False defined on the
product. Please correct the unit of measure defined on the order line
or on the product, they should belong to the same category.”`
The _compute_quantity function is called with supplier.product_uom even
though no supplier with the requested quantity is available.
opw-3495770
closesodoo/odoo#136340
X-original-commit: 17e5323e292a7b29ee6d30711cf3f083e05dd008
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
The safeConvert function in the useDateTimePicker hook will call parseDate with
an undefined format when no format option was provided to the hook. Before this
commit, since the options object passed to parseDate still contained the format
property, the undefined format will also be passed on to the parseDateTime
function. This is problematic, because now the parser will use the default
datetime format, and it will fail because of the absence of a time value in the
input string.
For some input formats, parseDateTime will still yield the correct result using
one of its backup parsing methods. However, a wrong result will be returned for
date formats containing some textual parts (for example MMM/dd/yyyy).
Making sure no undefined format values are passed on in the parseDate function
resolves the problem.
opw-3478797
closesodoo/odoo#136221
X-original-commit: b04482ed87db05b3fc2523a08ce7ca5818af578b
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Tom De Caluwé (tdc) <tdc@odoo.com>
When calling action_repair_done on a Repair Order that has been created
from a Sale Order (which is done by adding a product.template with field
'create_repair' set to True), we should update the delivered quantity of
the product responsible of the creation of the Repair Order if and only
if this product Invoicing Policy is in ['Ordered Quantities',
'Delivered Quantities', 'Prepaid/Fixed Price'].
closesodoo/odoo#136195
X-original-commit: fcbc689dc37cafd5a0cba7b57a2f40ad6acf4e26
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Mathias Mathy (mama) <mama@odoo.com>
cherry-pick of a4904fb4889c16322494981f5a1be586683704bd
Steps to reproduce the bug:
- Create a storable product “P1”
- costing method: avco
- Create a PO:
- Add the product “P1”:
- Line 1: Qty= 10, price= $50
- Line 2: Qty=1, price= $10
- Confirm the PO and receive the product
- Go to purchase → Reporting → Purchase Analysis
Problem:
The average price is incorrect, the current calculation is:
(50 + 10) / 2 = 30
The average should take into account the quantities purchased in each
line, And not simply the number of line, so the correct calculation
should be:
((10 * 50) + (10 * 1)) / 11 = 46.36
The SQL query is correct, it is when applying the read_group that the
calculation is incorrect, we should override it to make a personalized
calculation of the average.
opw-3136406
closesodoo/odoo#136097
X-original-commit: cd84549a3e5ea09d230dc1d02e05456a2372fd34
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Purpose
=======
When a user tries to reach a course, an AccessError can occur when we
unslug the URL. Instead of the traditional error page, we want to
redirect the users to /slides, and the error will be displayed there.
Task-3477630
closesodoo/odoo#135926
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Current behaviour before commit:
In table, when clicking table menu icon it throws
traceback.
Desired behaviour after commit:
Now, clicking table menu icon opens table menu
without any traceback.
task-3503806
closesodoo/odoo#135324
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit, when `a` tag is in a td, the color of text ellipsis
(3 dots) is different than the text because the text-ellipsis is set on
the parent element, that is `td` element and the color is set on the `a`.
This commit sets the right color on td element when that element has `a`
element.
Limitation (only for td inside element with `o_portal_my_doc_table` class):
if the `td` element contains `a` tag and another element
then the color has to be set to that other html element otherwise,
the color will be the one of the a tag.
task-3251721
closesodoo/odoo#134993
X-original-commit: b28459ddee3bf76630e2968baecd1dd4bc7cba93
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit fixes the issue of partial coloring of table cells.
Before this commit, if one colors part of the text in the cell
and then seeks to color the whole cell, the last coloring
would not apply on the previously colored text.
We do that by preventing the cell coloring to be done differently
than other elements except if we want to change the
background color.
Task-3454903
closesodoo/odoo#130646
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
This commit adapts website_blog tests to change in website_helpdesk. The
method _compute_visible of model website.menu is modified to display
help team menus to backend user, even if they are unpublished. This
potentially add extra requests when rendering a website page. Therefore,
the performance tests are adapted accordingly.
task-3186564
closesodoo/odoo#134976
Related: odoo/enterprise#45115
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
current behavior:
When a product with tax included is sold with a fiscal position that
match the tax to a tax of 0%, then when you refund this order the
fiscal is applied a second time. This result in the 15% tax removed 2
times and the price of the product is incorrect.
steps to reproduce:
- Create a product with 15% tax included
- Create a fiscal position that match the tax to a tax of 0%
- Create a POS with this fiscal position
- Open PoS, and make an order with the product
- Applyy the fiscal position
- Refund the order
- The price of the product is not the same as the one of the original
order.
opw-3371028
closesodoo/odoo#136348
X-original-commit: 58406515233234ac0ed342d81a5c55886c3b5712
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
Prior to this commit the combo choices were displayed in their ID order. This
commit add a sequence field that allows the user to choose the order of
the combo choices.
closesodoo/odoo#136331
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
The async methods of field service were not declared in its key async.
This would allow destroyed components to process the results of those
methods (despite an initial call to useService). We fix that.
closesodoo/odoo#135950
X-original-commit: 7955def19c7d4a8c49be472413423bbf3beec2e5
Signed-off-by: Géry Debongnie <ged@odoo.com>
This commit changes the way transactions linked to a document (sales
order, invoice...) are created in a payment flow. Rather than receiving
and trusting the transaction values from the controller, they are now
read from the linked document, and the payment flow is rerouted to use
the document's module's controllers instead of that of `payment`.
This ensures that no unexpected value can be passed to the `create`
method of a transaction, and simplifies the implementation of the
payment flows of linked documents.
task-3136240
closesodoo/odoo#126425
Related: odoo/enterprise#43212
Related: odoo/upgrade#5124
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
The method get_resource_path is redundant with file_path but without
all the checks.
The method will be deprecated in master but make it use file_path in
stable.
closesodoo/odoo#136272
X-original-commit: 64ab4a6914dadd741cfe61d9bd1959ae4509a1ca
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
This previous commit : https://github.com/odoo/odoo/commit/d197efa60cf7c00168847ce7afcfa1741410aee1 aimed at ventilating rounding error corrections on multiple lines. But this would introduce errors or unbalanced moves if the rounding amount/lines quantity was smaller than the rounding of the currency. E.g. à 0.01€ error divided on 3 lines would add 0.00333 on each line, and when the amount is rounded, it would vanish.
closesodoo/odoo#136366
X-original-commit: 0627b4609e8b1b3d15651d6cde0ff4cfdc85c5d6
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
* = bus, calendar, im_livechat, hr, project_todo, sms, snailmail,
test_mail, web, website_livechat
The current implementation often led to tests relying on DOM structure
to properly target the correct element with the text.
It is now easier to simply check if a parent contains some text.
closesodoo/odoo#136295
Related: odoo/enterprise#47770
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Some tests are updated to lessen diff in future tests, especially about
aliases. Some tests are fixed as they are somehow incorrect (notably
in gateway testing) but currently passing as mail gateway is quite
permissive.
Add some tests preparing MC / alias domains configuration notably about
company / alias synchronization, which is currently only based on config
parameters.
Also update some tests by using fstrings which are generally more readable.
Finally move some tests to their right file / main testing class to keep
them ordered by main topic.
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
closesodoo/odoo#136318
X-original-commit: odoo/odoo@c18300e225
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Cleanup some code bits in common classes, add some docstrings. Improve
notifications related helpers, notably to ease checking content of mail.mail
or outgoing emails when posting messages.
Update 'test_message_post' with those new helpers, to ease inclusion of
additional specific values test with alias domains in mind in next commits.
Prepares Task-36879 (Mail: Support MultiCompany Aliases)
X-original-commit: odoo/odoo@513fb74f5c
Part-of: odoo/odoo#136318
Before this commit, users were required to compute the API URLs, which is
specific to each Adyen account, themselves. After this commit, users
will be able to copy their account prefix from Adyen to automatically
generate the API URLs.
task-3338126
closesodoo/odoo#126831
Related: odoo/upgrade#4876
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
If a list view row switches to more than one line (e.g. because of some
field which overflows), the record selection checkbox need to respect
the same alignment as other 'blocky' widget like statuses, priorities,
etc. and be middle-aligned.
Task-3515864
closesodoo/odoo#136222
X-original-commit: 77252ff7201625f25667f64f07cee627d3c47b99
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
When adding a new raw SM to a confirmed and locked MO, it should still
be possible for the user to define the to-consume quantity (else, he
would have to unlock the MO and only then to edit the new line)
OPW-3253204
closesodoo/odoo#136009
X-original-commit: b78c468317079ac415d7b1fdbd4d4d081ff3976b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
When you are using a different currency in a PoS config, invoicing
a POS order that was created in a previous session, causes an
unbalanced entry error. Because the amount_currency and balance of
the payment moves are incorrect.
Steps to reproduce:
- Create POS config with currency other than company currency
- Create order in a session
- Close the session
- Open a new session
- Load paid orders
- Try to invoice the created order
opw-3479292
closesodoo/odoo#136294
X-original-commit: 17a8b70594d97a04c2389f9fb6f0cf370c6074c5
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Current behaviour:
Traceback when trying to create
a new external identifier
Steps to reproduce:
1. Activate the developer mode
2. Go to settings
3. Technical > External Identifiers
4. Click on "New"
5. Traceback
Cause of the issue:
Introduced by https://github.com/odoo/odoo/commit/3c62ca1eb96d571b2b686b5caee370324c589ab4
When computing display_name, the model
can be false, and not be in self.env
opw-3489581
closesodoo/odoo#136279
X-original-commit: 2462df26977acc9e3ccafd57863703aacd2f059e
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Co-authored-by: Rémy Voet <ryv@odoo.com>
Prior to this commit if an order was sent to another pos with the cross
order, if the product was missing in the target pos, the product will be
missing in the order. This commit loads the products that are missing for
the cross orders.
Task-3504316
closesodoo/odoo#136263
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Commit [1] changed the separator of cids in the url to make it
better looking, by using a character that doesn't need to be
encoded (namely, "-" instead of ","). However, by doing so, urls
still using the former separator couldn't be correctly parsed
anymore. This commit adds a small backward compatibility layer,
s.t. links in emails for instance keep working as before.
[1] abae4d4a5cclosesodoo/odoo#136247
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
We here fix the `SurveyQuestionAnswer._compute_display_name`
method introduced in 55fa52be.
`survey.question.answers` used as matrix rows and columns
require different treatment as they are not used in triggers
but are both shown on the `survey.user.input.line` views,
where the display shouldn't change (nor cause a crash).
It also doesn't make much sense to create answers outside the
context of a question, so we remove the button that already
wasn't shown on the tree view.
As users may not fully upgrade their views or may wish to customize,
we add a fallback question title in `_compute_display_name`too.
Task-3495142
closesodoo/odoo#135853
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Vivek Pathak <vivp@odoo.com>
When a user creates a downpayent with a fixed amount, the amount is tax included. This can generate rounding issues as sometimes the amount is impossible to be reached by any base amount / tax combination. (fixed amount = 100€, tax is 21% -> 100/1.21 = 82.64 -> 82.64 * 1.21 = 99.99). This can lead to up to 1 rounding error per downpaylent line.
Until now the total amount delta was added/removed on one tax line, one receivable line and one product line. While the total amount was correctly corrected, the amount on the individual lines would be off.
On a SO with :
base | tax | tax incl
1000€ | tax_21%_a | 1210€
1000€ | tax_21%_b | 1210€
Generate 1 DP for fixed amount 200€
Invoice lines :
BEFORE:
tax | balance | price_total
base lines ----------------------
tax_21%_a | -82.64 | 100.01 <-- 0.02 correction
tax_21%_b | -82.64 | 99.99
tax lines -----------------------
| -17.37 | 0.0 <-- 0.02 correction
| -17.35 | 0.0
receivable line -----------------
| 200.0 | 0 <-- 0.02 correction
AFTER:
tax | balance | price_total
base lines ----------------------
tax_21%_a | -82.64 | 100.0 <-- 0.01 correction
tax_21%_b | -82.64 | 100.0 <-- 0.01 correction
tax lines -----------------------
| -17.36 | 0.0 <-- 0.01 correction
| -17.36 | 0.0 <-- 0.01 correction
receivable line -----------------
| 200.0 | 0 <-- 0.02 correction
closesodoo/odoo#135698
X-original-commit: d197efa60cf7c00168847ce7afcfa1741410aee1
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Downpayment might have been determined by a fixed amount set by the user.
This amount is tax included. This can lead to rounding issues.
E.g. a user wants a 100€ DP on a product with 21% tax.
100 / 1.21 = 82.64, 82.64 * 1,21 = 99.99
This is already corrected by adding/removing the missing cents on the DP invoice
but it would still be wrong when creating the final invoice (as it is based on the actual base amount + tax of the SO DP's)
opw-3466409
X-original-commit: 0a6e2d47107727040664176740535707286a1355
Part-of: odoo/odoo#135698