The unit test in `test_base_document_layout` does not pass with
version 7.0.0 of PIL, which is loaded by default on Ubuntu 20.04.
The reason is that the color obtained from the image is slightly
different. This fix slightly relaxes the test (in fact we don't care
about the exact color obtained in this test, we just want to make sure
that it doesn't crash)
opw-2342394 (original ticket)
closesodoo/odoo#60071
X-original-commit: 99b3f0be1b322ee469871f9496527e8dc3e778bb
Signed-off-by: Thomas Dieuzeide <tdi-odoo@users.noreply.github.com>
Signed-off-by: Nicolas Galler <nicocrm@users.noreply.github.com>
The icon of the chrome app from the timesheet setting should not be
displayed on mobile.
closesodoo/odoo#59564
Task-id: 2323254
Related: odoo/enterprise#13935
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Steps to reproduce the bug:
- In Projects, switch to the calendar view
- Click a task
Bug:
Traceback here: https://github.com/odoo/odoo/blob/7ba47e7215df69b6556a848532e4f33ef4243e83/addons/web/static/src/js/fields/basic_fields.js#L2181
TypeError: Cannot use 'in' operator to search for 'invisible' in {}
Explanation:
We could change the inherited model of CalendarView from AbstractView to BasicView but it would be adding 400 lines of code to every calendar view. So, for now, and to keep it simple, we just parse the modifiers where it's needed to.
opw:2352436
opw:2352890
opw:2354039
closesodoo/odoo#59876
X-original-commit: 422c52a0823b1a53eeb974e76d08a44cacf4ea0a
Signed-off-by: backspac <backspac@users.noreply.github.com>
Before this commit, the hoverable dropdown option was broken because
we changed the option selector to the navbar element instead of the
header element. But we forgot to care about the data-select-class
which adds a class on the header. This commit fixes the issues by
changing the $target back to the header element for the related option
as the fact it is linked to the navbar element is only so that the
options appear in a different section, on navbar click.
Part of https://github.com/odoo/odoo/pull/60031
task-2312878
closesodoo/odoo#60031
X-original-commit: e1f8d549895cd9c459e6350430f30d541d02838a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
*: web_editor
The selector targeting the navbar for the related editor options was
not correct to target the navbar of the 'Boxed' version of the header.
Part of https://github.com/odoo/odoo/pull/60031
task-2312878
X-original-commit: 6a4587022ced3e1d72ff8c34a64c7a39e7572520
When the height not forced (50% or 100% screen's height), the snippet
simply disappear if there is no content inside (default).
The 4e220bf commit makes parallax snippet empty by default and the
main goal of a8f0cee was to make "DRAG BUILDING BLOCK HERE" placeholders
appear only on drag, that's why we need to add a "min-height" for parallax
to keep it visible when the "Height" selected is auto.
task-2327025
closesodoo/odoo#60032
X-original-commit: f019cd677e68312f90604be6abd04a1b1755ae4d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Otherwise computing unstored fields forces to compute all other already
stored fields. When being in a high charge context this may have a big
impact on DB use.
Task ID-2351463
closesodoo/odoo#59845
X-original-commit: fbde9dd183472237f12014315f063af736950b6c
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As-is, the warning will reports that post() is called from within
post, which is not very convenient when trying to find what calls
post() (as there are other "post" methods in the system).
By increasing the stacklevel from 1 (default) to 2, the warning will
report the method's caller, which is a lot more useful.
closesodoo/odoo#60043
X-original-commit: 5bc6eb9b387112138ac118726ff746bad6d00f8d
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Purpose of this commit is simply to add tests about alias defaults.
Code protects it against being badly formatted. However having
tests ensuring it is always a good idea to avoid regression.
Task ID-2361179
closesodoo/odoo#60026
X-original-commit: 0075cc02f9a11dcddaf9ca7d70cc1adf7596f6d3
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Create a tax:
5%
Included in price
- Set the company currency to USD
- Set the currency rounding of CHF to 0.05
- Set the rate for CHF to 0.654065014
- Create the following invoice in CHF:
Set a payment term
Prod 1, 1 unit, 5.0 CHF, tax 5%
Prod 2, 1 unit, 10.0 CHF, tax 5%
Prod 3, 1 unit, 50.0 CHF, tax 5%
It is not possible to save the invoice because of an unbalanced journal
entry.
Indeed, the Receivable line is $99.30 while it should be $99.29. This
happens because we round the `total_balance` with the rounding precision
of the invoice currency while it is in the company currency.
closesodoo/odoo#58798closesodoo/odoo#60035
X-original-commit: dad5e2a575448b68cc1b59880fecfe48dbe30a4e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a tax:
5%
Included in price
- Set the currency rounding of the company to 0.05 (e.g. CHF)
- Create the following invoice
Prod 1, 1 unit, 5.0 CHF, tax 5%
Prod 2, 1 unit, 10.0 CHF, tax 5%
Prod 3, 1 unit, 50.0 CHF, tax 5%
The total amount of the invoice is 64.95 CHF instead of 65.00 CHF, even
in a 'Round per line' configuration.
It happens because `compute_all` rounds the amounts following the number
of digits of the currency instead of using the `rounding` field.
Note that there is a discrepancy between the POS computation and the
Account computation: the POS already uses the `rounding` field instead
of the number of digits:
https://github.com/odoo/odoo/blob/80073c5430f0ab562dfc27572c108114161ebb25/addons/point_of_sale/static/src/js/models.js#L1855-L1991
opw-2341566
X-original-commit: 94353ebd6b47a286157f0559b194ff03ea49ff68
Steps to reproduce:
* In Inventory, activate multiple warehouses and storage locations, multi-step routes, Delivery packages
* On the main warehouse, activate 3 steps delivery
* Create a stockable product A
* Update quantity on hand: 100 units in a package PACK1 in Stock/Shelf 1
* Create a new Pick transfer with one move: 120 product A
* Set the transfer as todo and check availability: a move line for the 100 units from PACK1 is created
* Edit the move line: set a destination location, **change the result package to PACK2** and set a qty_done
* On product A, update the quantity on hand: add a *new* package PACK3 of 20 in Stock/Shelf 1
* On the transfer, click on check availability
Current behavior:
* A new move line is created for the 20 units from PACK3 to PACK3: ok
* The move line edited before for the 100 units has its result package **reset to PACK1**
Expected behavior:
* A new move line is created for the 20 units from PACK3 to PACK3: ok
* The move line edited before for the 100 units has its result package kept to **PACK2 as edited by the user** who decided to open the package already
Short analysis:
At the end of `StockMove._action_assign()`, the method `StockPicking._check_entire_pack()` is called. For each package moved by a move line, this method checks if the package is entirely moved (sum of quants == sum of move lines). The check is done by `StockPicking._check_move_lines_map_quant_package`. When the sums match, the package level of the move lines is created or updated. When it happens, it writes the package in the `result_package_id` of the related lines.
It should not change the result_package_id if it was already set.
Thinking further, maybe it should not consider lines with a `qty_done` in `_check_move_lines_map_quant_package`: users already picked these lines, if they decided to empty or change the `result_package_id`, a new check of availability for the remaining quantities should not change these lines.
opw-2346608
Fixes#58491closesodoo/odoo#60025
X-original-commit: db262912eb716aed1c42be8a9d59c25bdfa400e0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
`registry._init_modules` is a set so its iteration order is
non-deterministic (it's randomised on interpreter initialisation
unless PYTHONHASHSEED is provide through the environment). This can
lead to annoying non-deterministic behavior: while the non-determinism
is only at the module level, it's easy enough for modules to have
python-level side-effects (e.g. patch methods, update globals, ...),
which may only be surfaced by an other module executing after them,
but not if said module executes before.
By sorting the modules we should make this much more reliable one way
or another.
closesodoo/odoo#60028
X-original-commit: f9169a468a2328a691ec4f32233ba3bad3622282
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Before this commit:
When accessing activities from the systray, any existing breadcrumb-item should
be clearer.
After this commit:
Clear breadcrumb-item when access activities from the systray.
Task-2342246
closesodoo/odoo#60018
X-original-commit: a9b32448c4a6227ef8e729436cb793ea9c24c289
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit adds shadow to RPCs that are not supposed to be blocking.
task-2352703
closesodoo/odoo#60017
X-original-commit: 4274a061ff1498f647580c38c7048da8a8cb0a9c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit inverts the zoom direction of the scroll wheel in the
attachment viewer to respect the behaviour of before the refactor.
part of task-2171884
closesodoo/odoo#60009
X-original-commit: 3d9e2e031ea2e92a50769cc69fe37741d32b6820
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Whenever when change the 'Leads' of 'Pipeline' boolean field on sales team,
it should also update the linked alias. Mainly, if 'Lead' is checked, the
'Default Values' on the alias should also be updated.
It used to work before a recent refactoring (see commit [1] and [2] for more
information).
This commit adapts the changes done in refacotring and updates the alias values
while updating the sales team.
[1] - https://github.com/odoo/odoo/commit/7cfd364db54e88970ef51c798df3bd4df44222b3
[2] - https://github.com/odoo/odoo/commit/186cfb5ebd35d572d0f635cd7975de7cff0d1055
TaskId - 2357573
closesodoo/odoo#60008
X-original-commit: 0669ee36e195e8e0f98131219b59fcc5cba4cea7
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit changes the url formatting of the `services.navigate` in
the attachment viewer. Before this commit, the resulting URL was
erroneous which prevented download and lead to a 404 error.
part of task-2171884
closesodoo/odoo#60003
X-original-commit: b11535bb26ad9a1fd96ec616201eb67c89597cdc
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Problem
-------
_search_is_mail_thread_sms is looking for ir.model
in the database and then fetch them from the registry
without verification. This can lead to key error
when a model is present in the database but not in
the python anymore. This situation can happen
after a migration.
Solution
--------
Check the model is present in the registry
closesodoo/odoo#60001
X-original-commit: 448626d86a1f06b9f8a7a88111f7cb01600488cd
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Do not set a default `account_id` for section and note lines. Indeed,
when set the constraint `check_non_accountable_fields_null` will raise.
fine-tuning of c22f99dd09
opw-2357415
opw-2355559
opw-2359283
closesodoo/odoo#59988
X-original-commit: b6791a5183ef1015b47312785501a99ed68e5718
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Consider move uom different from serial product uom
to set up move lines with product uom
closesodoo/odoo#59986
X-original-commit: ee966998fa986936a0407676bb4d54f61c7fce1f
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Before this commit it was possible to activate the overlay of the
arrows of the gallery snippet (with themes because of animation
options)
task-2312878
closesodoo/odoo#59973
X-original-commit: 81a00e3469f93cb4686c92db5695316db92eb84c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, Button to Send Sample reminder was always visible which doesn't makes sense as It would work on saved record only.
Now Button will be hidden on unsaved record.
Fixes#58744closesodoo/odoo#59972
X-original-commit: 3cb26da782042ee391777ed15bcca4eef4a10677
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
- Activate debug mode
- Go to Settings > Translations > Languages
- Activate and switch to a language that does not use dot (.) as decimal separator (i.e. French)
- Go to a POS session
- Select a Product, edit the price with a decimal via the Numpad widget
The decimal is not taken into account.
This is due to the fact that the entered input ('.') is not considered as the decimal point
in this language (i.e. ',') and is skipped.
The same issue happens for quantity and discount.
The dot in the Numpad widget has been replaced by the decimal separator of the language.
Also "field_utils.parse.float" has to be used instead of "parseFloat" because "parseFloat" only
recognizes a dot as separator. (i.e. "parseFloat" returns 12.00 for "12,99")
Howerver "parseFloat" is still useful for checking values as "field_utils.parse.float" returns
an error if its parameter is not a string or if the parsed result is not a number.
opw-2357848
closesodoo/odoo#59971
X-original-commit: a1543d2a283000e2955df5f8131bae5e25e110c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Since a refactoring of the handling of the color system and the way the text
muted is handled, the text-muted isn't visible on the full-screen mode of a
course. That is becuase text-muted is based on the font color set for the body,
which in this case is quite similar to the background of left panel in
full-screen course content.
This commit fixes the issue by using `text-600` class that is suited for this
scenario (the background color is fixed here irrespective of the color-palette,
and so should be muted text-color) instead of `text-muted` for the left panel
of full-screen course content.
taskId - 2346013
closes#59390closesodoo/odoo#59970
X-original-commit: 7f7f9c6c9165fc6697e90ed6616466d9684e28f2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce the bug:
- Set the timezone of the user to Australia/Melbourne
- Set the country of the company to Australia
- Set the time of the system to 20:00 UTC
- Have Project and Sales installed
- Enable Timesheet and Timesheet Timer on project (A)
- Create a task in project (A)
- Click Start and then Stop
- Confirm the wizard
Bug:
The date of the new timesheet line is set to yesterday.
opw:2351204
Original PR: odoo/enterprise#14023closesodoo/odoo#59966
X-original-commit: b85a5fc39887660992b5dd0f49ca331e38dd6030
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: backspac <backspac@users.noreply.github.com>
TLDR: after installation accounting app, invoices paid online get status "In Payment" until
reconciliation; this commit allows to download digital content without waiting
reconciliation which may take days or week
Steps:
* Install Accounting app
* Install website_sale_digital
* Create Digital product (Product Type: Service + use Digital Files smart button
to upload a file)
* Setup payment acquirer (e.g. Paypal)
* Buy digital product online and pay
* Open the Sale Order in Portal
Before:
* No "Downloads" button near to product name
After
* User can download files after purchasing
Notes
* In Odoo 13.0 it worked via "post_at" option, which is removed in Odoo 14. See
https://github.com/odoo/odoo/commit/caeb782841fc5a7ad71a196e2c9ee67644ef9074:
> - Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
> With invoicing, the payment will do that so the "in_payment" state should never be shown up.
> With accounting, only the statement lines have the power to move an invoice to the "paid" state.
---
opw-2353064
closesodoo/odoo#59959
X-original-commit: 103abd3284cea1723adc0e4b90e57961a4fac2a0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Previously, dimensionless SVGs (SVGs with no intrinsic width or height)
were rendered with a width of 0 in the media-dialog on firefox. This is
caused by the fact that firefox reports a naturalWidth and naturalHeight
of 0 for dimensionless images, which we were relying on to compute the
image's aspect ratio. See:
https://github.com/whatwg/html/issues/3510#issuecomment-369982529
for more details on the way browsers handle dimensionless images.
This commit fixes that by giving the image a width, letting the browser
render the image, and reading the height of the rendered image to
compute the aspect ratio in the cases where the naturalHeight of the
image is 0.
task-2345120
closesodoo/odoo#59958
X-original-commit: 616c78e00e6d2760e1cf3425fc7247792f2ceb61
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Problem
-------
Sales people can have restriction on partner they can see
Private addresses, multi company, ....
When they convert a lead to opportunity, it's currently possible
that the wizard will find and link a partner that the current user
cannot see.
Solution
--------
Field that are now computed store field, that were previously
normal field with onchange, should not be computed as sudo
to respect the record rule
closesodoo/odoo#59957
X-original-commit: 182fa38d7f28a92e7171c4ee3a42c8f73217b765
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fix the "Unsupported M2M command 1" raised `Form` helper.
The `onchange()` method will in fact emit UPDATE command for many2many
fields when the value submitted an the one in database has changed
(this is the case for example for nested m2m in form views)
OPW-2044631
closesodoo/odoo#59943
X-original-commit: 76bd8208a416cefab6becff9f2d7204c7d196201
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: Xavier ALT <xavieralt@users.noreply.github.com>
Made the website_id non mandatory on website snippet filters and adapted
the fetching route so that it interprets an unspecified website_id as
the filter being available on any website.
Before this commit website snippet filters had to be limited to one
single website.
After this commit website snippet filters can be made available on all
websites by setting their website_id to no value (this is the new
default of the pre-defined filters).
https://github.com/odoo/odoo/pull/59831
task-2355369
closesodoo/odoo#59831
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Steps:
* Create a delivery method (1) restricted to Spain (any country would do)
* Create a delivery method (2) restricted to Madagascar (same)
* Create a partner, main company, whose country is Spain and the default
delivery method is the first one.
* Create a delivery address for that customer with Madagascar as country and the
default delivery method as the second one.
* Now place a new quotation with such partner and set the delivery address to
the one of Madagascar (multiple addresses setting must be on).
Before:
* The delivery method for the quotation is set to the one restricted to Spain
although we're sending it to Madagascar.
After:
* The delivery method for the quotation is set to the one restricted to
Madagascar.
---
opw-2348336
closesodoo/odoo#59890
X-original-commit: 535d429960a0347d01c528c2440c2b8e9ff2fb51
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Revert commit
"[FIX] base: clearer message in case of conflict for no_gap sequences"
This commit changed the error returned in case of SQL conflict for no_gap
sequences, wrongly disabling the automatic retry (service/model.py) in case
of such errors.
Also adds a comment in the dedicated test to ensure the behavior is explained
and the automatic retry isn't broken once again by the same kind of change.
closesodoo/odoo#59928
X-original-commit: 811cd40fe427c28f9eb244f78ae23c4d3fb42cc8
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
- The Adyen sync cron didn't call the function to sync terminals
- Do not specify the merchantAccount when creating a store, the proxy
will add it itself.
closesodoo/odoo#59868
X-original-commit: d5b456a1f75320c8fdf1e989afad91fc74ec9ef3
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When select a BOM in the field, now we only search by the finished
product name. In this commit, we will also match the reference of the
BOM.
Task 2326786
PR #57945
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Since the editor panel is placed on the right, the content was not
possible to scroll when in a iframe, like for mass mailing. This was
because of some strange code introduced with [1]. As the problem the
mentioned commit says fixing is still fixed without that code, I see
no reason to keep this... especially since it may introduce difference
between readonly and editmode content.
[1]: https://github.com/odoo/odoo/commit/f9bf408a827fa86323bc2d1891cb5173b4781e7bclosesodoo/odoo#59927
X-original-commit: 58ade8c0e17be14fb5bf9cef592c9b9225d21b6d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The assignment of a binary field on a new record with origin did
actually modify the attachment storing the value of the field on the
origin record! The fix is simply to avoid messing up with attachments
when updating new records.
closesodoo/odoo#59919
X-original-commit: 6778c4c10fa68c46bde6fae176f547f905e9c02f
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Upon onchange, the web client sends unchanged image fields on one2many
lines as "bin size" values, while changed image fields are sent as their
full value. As the value is not base64-encoded, the assignment of that
value crashes.
Fix it by making assignment on new records not crash when decoding the
image: the value is simply not assigned to the field. In the situation
described above, the record being assigned is a new record with a real
record as origin. Because the field is actually not assigned, its value
is implicitly the value of the field on the origin record, which is
consistent with the fact that the field was not modified in the form.
X-original-commit: 4442d6f0f29a2bf6e992515cd535c88215855a36
On safari with apple device in belgium timezone, this code:
```
x = new Date(2020, 2, 28, 2)
x.setDate(29)
```
returns:
> Sat Mar 28 2020 02:00:00 GMT+0100 (CET)
> Sun Mar 29 2020 01:00:00 GMT+0100 (CET)
This is not consistent with any other combination of OS and browser
tested, where this code would return eg. for chrome on macOS:
> Sat Mar 28 2020 02:00:00 GMT+0100 (Central European Standard Time)
> Sun Mar 29 2020 03:00:00 GMT+0200 (Central European Summer Time)
In most instance, this is not an issue, but for country with midnight as
Daylight Saving Time (DST) change, this is an issue, because the Tempus
Dominus calendar widget will have a duplicated day which might eg. make
a month totally not usable.
This issue can eg. be reproduced in Lebanon timezone at this address:
https://tempusdominus.github.io/bootstrap-4/Usage/
Going to the month of April 2020, an error happen because to get the
first day of the week of 1st April, we do:
```
this._viewDate.clone().startOf('M').startOf('w').startOf('d');
// .startOf('M') => Apr 01 00:00:00
// .startOf('w') => Mar 28 23:00:00 (safari bug)
// .startOf('d') => Mar 28 00:00:00
```
which gives us the wrong day (28 instead of 29) which causes an error.
Other report of the issue:
- https://www.donedone.com/timezone-specific-browser-specific-datetime-bug-2014/
- https://github.com/date-fns/date-fns : issue 571
- https://forum.mobiscroll.com/t/issue-with-invalid-dates-range-script/108
opw-2271482
closes#59786closesodoo/odoo#59908
X-original-commit: 112267d62544c56acfdcef96727c32c314c15f16
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>