Commit Graph
143355 Commits
Author SHA1 Message Date
Leonardo Pavan Rocha bc40795c56 [IMP] base: base layout designer improvements
This commit implements improvements in the layout designer, such as addition of a new custom background, adds custom report footer and company details.

task-2355704

closes odoo/odoo#66860

Related: odoo/upgrade#2275
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-06-25 10:33:31 +00:00
Mohammed Shekha ae4cb866de [FIX] web: do not display notebook ul element if all pages hidden
before this commit: if all pages are hidden then notebook ul was still visible
due to which border for notebook ul element was displayed.

after this commit: if all pages are hidden then we hides notebook ul element
as well, so that we don't have empty border line of empty notebook.

task-2411651

closes odoo/odoo#63420

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2021-06-25 07:28:47 +00:00
Katherine Zaoral 216b07eb46 [ADD] l10n_ar: AFIP RG 5003
Be able to create letter A documents to monotributista AFIP
responsibility types.

closes odoo/odoo#72667

X-original-commit: b204f7d1b0bcaf3984600d94395377c97facf168
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-25 11:50:32 +00:00
Laurent Smet a455483c2a [FIX] account: Fix missing dependency of '_compute_is_reconciled' in statement lines
closes odoo/odoo#72764

X-original-commit: 3ca7f28de24f3d64d67d9d358bf6ad93d36479c0
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-25 08:43:06 +00:00
Adrien Widart 50e81b110f [FIX] point_of_sale: set end balance of cash register
This commits is about two problems. The first one is a undesirable
warning message displayed when closing the POS session

To reproduce the error:
1. In POS settings, enable "Advanced Cash Control"
2. Start a POS session
3. Make an order of 70$, payment in cash
4. Close the POS session (correctly set the closing cash)

Error: When clicking on "Close Session & Post Entries", a warning is
displayed: "There is a difference between the expected and actual
closing in cash. Are you sure [...] ?" However the actual cash is equal
to expected cash so the message does not make sense

The error has been introduced with commit 7252350d35c6e8e7f47458c3aedcf05d92e71afa,
so the current commit reverts it.

However, the reverted commit was a solution to a second problem: When
cash control is disabled, if the user opens and closes a POS session
(without any order), the ending balance of the associated cash register
will always be 0. Here are the explanations: if cash control is enabled,
when the user sets the closing cash, it creates a record:
https://github.com/odoo/odoo/blob/80c28189ae6b10ad17c4de2a781233a8ffe663a6/addons/account/models/account_bank_statement.py#L82-L98
and therefore, thanks to `_validate_cashbox`, `balance_end_real` will be
defined with its correct value. However, there isn't anything to define
the ending balance when there isn't any order and when cash control is
disabled.

OPW-2580699

closes odoo/odoo#72763

X-original-commit: 550e7280212b740bfce72331f6d0aef99b7aadb6
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-25 09:41:23 +00:00
Xavier Morel ded278b9c2 [FIX] core: have HttpCase automatically set the base url
While HttpCase did set `web.base.url` before starting a browser, in
the non-browser test cases (or cases which would mix browser and
non-browser) it would not do so.

This is an issue when installing the database with one http-port and
running tests with an other e.g. after duplicating the database (or
even not duplicating it) in order to run multiple test instances
concurrently, which requires using different http ports.

Tests would then see the base url generated during installation,
embedding the port used at installation, and would break weirdly (at
best exploding due to not finding any server to bind to, and at worst
making request on the wrong instance entirely). Simply updating the
base url during setup seems to fix most of the tests.

Notes:

* Some tests (e.g. survey) don't flush() their create/update before
  calling `start_tour` or `browser_js`, the implicit flush because of
  the ICP handled the issue. Perform an explicit flush of base
  (similar to `url_open`) to ensure they keep working correctly.
* `url_join` should handle absolute URIs correctly, it does imply
  slightly different semantics in case the `base_url` has a non-empty
  path, but that seems like a very limited risk (and possibly
  convenient to boot).
* `payment` needed a fix because the vagaries of the MRO led to the
  extra parameter internally used by the thing to be passed to
  `HttpCase`'s `setUpClass`, which would not expect it.

closes odoo/odoo#72645

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-06-25 09:13:49 +00:00
Younn Olivier 58503a248e [IMP] website: disable some options for inline snippets
When a snippet is displayed inside another snippet, some options that
were not useful in that case are removed from the editor:
- ContainerWidth
- minHeight
- ScrollButton
- Background

Part of https://github.com/odoo/odoo/pull/72180
task-2566338

closes odoo/odoo#72180

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-25 07:39:54 +00:00
Younn Olivier 3426283c22 [IMP] web_editor: display toolbar only when needed
For now, the toolbar was hidden from the snippets menu only if:
- it was an image
- it had no editable parent or was outside the wrapwrap
- for model fields that were not html nor views

We also want to hide it for every selected element that is not editable,
as the options will have no effect on such element.
When an element is not editable, it is useless to display the toolbar.

For example, for the website form fields, or the newsletter
subscription, the toolbar was displayed even if it had no effect on the
snippet.

To hide it, we test on the last element at the wysiwyg level.

Part of https://github.com/odoo/odoo/pull/72180
task-2566338
2021-06-25 07:39:54 +00:00
Younn Olivier fac52593fe [IMP] website_form: make adding a field to the form clearer
This commit adds a label next to the + icon and uses a primary button to
make adding a field clearer.

Part of https://github.com/odoo/odoo/pull/72180
task-2566338
2021-06-25 07:39:53 +00:00
Cedric Prieels (cpr) 3bcb88f410 [IMP] {hr_,sale_}timesheet,{sale_}project: improve the tasks portal
Generic UX improvements for the task portal.
Added new sort by, group by and searches options in the tasks portal.
Some options have been renamed as well, while the style has been slightly revised.
The timesheet details of each sub-task from the parent form view has also been removed.

task-2508883

closes odoo/odoo#70305

Related: odoo/upgrade#2580
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-24 15:39:40 +00:00
prro-odoo 2956233255 [FIX] web: expand import-compatible fields
- Install the eCommerce (for the ribbon, in 14.0) and the Sales app
- Go to the Sales app -> Products -> Products
- (View List ->) select (a) Product(s) -> Action -> Export
- check "I want to update data (import-compatible export)" -> click on the "Ribbon" field (in 14.0, or another many2x field for wich the model has no _rec_name defined) to expand

Cause: the export page controller tries to access an undefined field (_rec_name)

Solution: the controller now uses a fallback method to retrieve the wanted field

opw-2566403

closes odoo/odoo#72748

X-original-commit: e31cb5be22de7db223318b4876bf725e15654fea
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: prro-odoo <proose@users.noreply.github.com>
2021-06-24 17:30:20 +00:00
Valentin Chevalier 24fa119533 [FIX] payment: restore the delay before post-processing a transaction
Since the payment post-processing cron runs every ten minutes, it is
important that it ignores the transactions that were updated in the same
last ten minutes. This is necessary because customers can only see the
payment confirmation message for transactions that were not already
post-processed.

Commit 573ed74 mistakenly changed the post-processing delay from ten
minutes to one minute. This commit changes it back to 10 minutes.

task-2494916

closes odoo/odoo#72742

X-original-commit: 502a13b87971b0bf36493770dd3bcb4f9d9b7c2a
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
2021-06-24 16:14:10 +00:00
Younn Olivier 5d7f883a2c [FIX] website: fix scrollButton option on events
On events, or in every part of the website that was built without
sections, the scroll button of a dropped snippet was not effective.

This was because we were targeting the next section, which was not there
in the previous case. Yet, we want it to scroll to the next element,
even if it is not a section.

task-2566338

closes odoo/odoo#72733

X-original-commit: 439381aa98c3b1e03513edb45cda284f4627d2a8
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-06-24 15:14:23 +00:00
Fabien Pinckaers a65f6a5872 [IMP] various: clean most urls to odoo's website
Pages changed on odoo.com so let's update links.

closes odoo/odoo#72707

Related: odoo/enterprise#19239
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-24 15:14:29 +00:00
root 9796d58271 [FIX] hr_timesheet: never update timesheet rounding params
Before this fix if a user updated the module hr_timesheet the ir.config_parameters would be reset.
By wrapping them in a no-update they're no longer updated with a module update and thus kept as set by the user.

closes odoo/odoo#72732

X-original-commit: 369529cb15ec01cde1538c189535ce6d41685268
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-06-24 15:02:56 +00:00
Touati Djamel (otd) 2f098b2583 [FIX] stock_landed_cost: added a missing return on the overridden write function
commit where the bug was introduced : https://github.com/odoo/odoo/pull/71810/commits/7b87ab31ee64d56c6e7f9eab7a51d81cf4e66747

opw-2572132

closes odoo/odoo#72751

X-original-commit: 94d1e807379ca7d92d5a4df267857cb00f979710
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-24 18:19:31 +00:00
alt-odooandJulien Castiaux 603e13fa00 [FIX] lunch: access rights error on ir.cron for lunch manager
When a lunch manager tries to archive a vendor, we automatically update its
related cron. This is triggering an access rights error if the user does not
have access to ir.cron model. We should allow him to archive the vendor
without error.

closes odoo/odoo#72750

X-original-commit: 5b8eff9d771a9071327473d2185624f69e1057c1
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Co-authored-by: Julien Castiaux <juc@odoo.com>
2021-06-24 18:07:25 +00:00
Didier (did) e30e315ece [IMP] mail: replace hard-coded values by SCSS variables
Clean up pass towards using bootstrap in template, not all hard-coded values are
converted yet but those have been done:

 - `width/height: 100%` by `map-get($sizes, 100)`
 - `margin/padding` with hard coded value with `map-get($spacers, X)`
 - `border: 1px` by `$border-width`
 - hard-coded black and white by `$black`/`$white`
 - hard-coded `border-radius: 50%` by `@extend .rounded-circle;`

task-2223232

closes odoo/odoo#72321

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-06-24 17:19:59 +00:00
Anh Thao Pham (pta) fed1acee10 [FIX] web: fix error when getting image URL with default id
Linked to commit: https://github.com/odoo/odoo/commit/7eac23573c77415c84cb9c234c8063d4c68be425

Using false as default value instead of null will lead to the following
error if we try to get image URL of a record that is not the current one
and if no placeholder is available:
ValueError: invalid literal for int() with base 10: 'false'

opw-2516188

closes odoo/odoo#72729

X-original-commit: d32c0ddbcb99385407a5030e8d3ea4df44509377
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Anh Thao PHAM <kitan191@users.noreply.github.com>
2021-06-24 15:01:47 +00:00
Goffin Simon 34e66bd2c4 [FIX] mrp: Delivered quantity with kit
Steps to reproduce the bug:
Create 2 product (Finish product , RM product)
Create 1 Kit BOM for Finish product with 1 Component(RM Product) and quantity : 0.0860
Create SO for 10 Finish product and confirm SO
Deliver RM product : Quantity : 0.86 ( as per define ratio in BOM) -> validate

Bug:

Delivery quantity on SO line shows : 9 instead of 10

opw:2540671

closes odoo/odoo#72724

X-original-commit: 89aa85f32e0a87d537f4d9ed9c22955d3269ddd1
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-06-24 14:06:08 +00:00
Thibault Libioulle caa58cdc46 [FIX] sale_timesheet: fix wrong join condition
Prior to this commit, the account move line was not correctly joined,
and put in relation with SOL. Furthermore, this table isn't use.

In this commit we correctly join the subquery, in this subquery,
we just try to avoid to take into account amounts that are related
to invoiced sale order lines.

closes odoo/odoo#72710

X-original-commit: b04465d3514fe5cd52b7994962fe4069933ae6fd
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-24 13:05:41 +00:00
Jacky (trj) bdd0491fb2 [REF] l10n_de: move l10n_de_stnr and l10n_de_widnr from l10n_de_pos_cert module
These fields are more relevant in the German localization rather than the German POS localization

closes odoo/odoo#72590

Related: odoo/enterprise#19183
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-06-24 07:46:54 +00:00
Arnold Moyaux 6ef20b309f [FIX] stock: take ongoing move line for putaway
Usecase to reproduce:
- Setup a maximal of 100units in a storage category
- Set the storage category on shelf1 and shelf2
- Create two putaway rule from wh/stock to wh/stock/shelf1 and
wh/stock/shelf2
- Create an immediate receipt
- Set 100 units of product on stock move line (should suggest shelf1)
- Put in pack
- Create a new stock.move.line in the receipt.

It will suggest the same location than in the first line despite the
location is the same. It happens because the check look only at quantity
reserved in the location but the user could have create new line without
quantity reserved.

This commit, take the maximum between the quantity reserved and the
quantity done to give an estimation of what could happens.

closes odoo/odoo#72689

X-original-commit: d9d98d4264295532f2248c6072aabbd72f32f054
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-24 11:11:27 +00:00
Sébastien Mottet (oms) ccbab34878 [FIX] website: handle disabled and preselected modules
- The selection of cards corresponding to already installed modules
is disabled. A disabled style has been applied to these cards and an
info icon added. On hover on this icon the user is informed that the
module is already installed on its DB.

- Modules that were preselected based on website type can now be
unselected by the user.

- Correct typo in description of feature_module_career.

task-2518565

closes odoo/odoo#72688

X-original-commit: ab364b06dbb20cce90c7caa8ca15d034e2dcb25e
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Sébastien Mottet <smottet@users.noreply.github.com>
2021-06-24 11:09:13 +00:00
Lucas Perais (lpe) ac0224319e [FIX] web: utils/strings: sprintf support lazy translated strings
Have something like:
```js

sprintf("my string %s", _lt("lazy translated"));

```
Before this commit, the lazy translated term was not formatted into the string.
This was because _lt returns an object containing a custom toString function, which was not handled by sprintf

After this commit, sprintf is able to handle lazy translated strings

closes odoo/odoo#72598

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-06-24 09:59:05 +00:00
Géry Debongnie d4bbadd699 [REF] web: slightly improve translation system
Before this commit, "lazy translated" strings were implemented as
objects with a toString function. This is simple, but does not emulate
very well the real behaviour of a string.

In this commit, we create a LazyTranslatedSTring class which subclass
the String class, so all string methods will work as expected.

We also expose the _t function here, to make it more convenient for some
code to access the translations instead of depending on the presence of
an environment.
2021-06-24 09:40:10 +00:00
Barad Mahendra 27538bca03 [IMP] project,hr(_timesheet)_holidays: usability improvement for project
Purpose of the commit is to improve the usability and onboarding
of the project app.

So in this commit, done the below changes:
 - Rename column "Kanban state" in list view screens
 - Hide column "analytic account" when not needed
 - Do not show "Internal" project

PS: Moved leave_timesheet_project_id into hr_timesheet and rename
it as internal_project_id and we used it in the domain in the
kanban/action to the kanban in order not to have it in the result.

closes odoo/odoo#68857

Taskid: 2451722
Related: odoo/upgrade#2479
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-24 05:18:14 +00:00
f6ab481ad9 [FIX] project: improve performance of burndown chart report
Before this commit, for the db with old active tasks and many
projects and tasks. The report takes several hours to execute the sql view.
Because we take the create date of the oldest task as the begin date
of each generate_series to calculate the different group bys (day, week,
month, quarter and year) until CURRENT_DATE.

This commit hugely improves the performance of the sql view execution
for the burndown chart report.

closes odoo/odoo#72664

X-original-commit: 89726a22862cf14f7b88e130fb79ddc74bffff5e
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
Co-authored-by: Nicolas Seinlet (NSE) <nse@openerp.com>
Co-authored-by: Thibault Libioulle (TLE) <tle@odoo.com>
Co-authored-by: Laurent Stukkens (LTU) <ltu@odoo.com>
2021-06-24 07:22:52 +00:00
Mohammed Shekha 49d311e725 [IMP] stock: add is_signed boolean computed field
signaature field was used in listview and it was displaying size of the
signature file, it has been done in commit: 4bdbb9b761
but as discussed on PR: https://github.com/odoo/odoo/pull/72276\#issuecomment-863262072
we added is_signed computed boolean field to display it like boolean as boolean
widget is supported only on boolean type field.

task-2580117

closes odoo/odoo#72592

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2021-06-23 08:15:14 +00:00
Adrien Widart 45441f6fbb [FIX] point_of_sale: always post bank statement of cash
The amount of cash present in the POS may be incorrect

To reproduce the error:
1. In POS settings, enable "Advanced Cash Control"
2. Start a POS session
3. Make an order of 70$, payment in cash
4. Close the POS session (correctly set the closing cash)
5. Start a POS session, close it (correctly set the closing cash)

Error: Back to kanban view, the information about the POS are incorrect:
the cash balance is equal to zero, it should be $70

The value of the cash balance is computed in `_compute_last_session`:
https://github.com/odoo/odoo/blob/5ea1d31df9041ca7b25fbea6178e798e62bebca0/addons/point_of_sale/models/pos_config.py#L276-L291
This method gets the last session and extracts the information. However,
in the above case, there were no sales during the last session (step 5).
In such situation, the bank statement of cash is deleted. As a result,
in `_compute_last_session`, `last_session_closing_cashbox` will be
defined to `False`. This is the reason why the cash balance will be
equal to 0

The deletion of `cash_register` has been introduced in case the user
closes a session that does not contain any SO. This fix suggests keeping
such a bank statement and automatically posting it.

Linked to OPW-2507394

closes odoo/odoo#72663

X-original-commit: dae9ba62d98d4238600ccd637dd5e879f1cac903
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-23 17:48:19 +00:00
Bruno BoiandStefano Rigano 5c5924af88 [FIX] web: change pivot dropdown submenu
Since odoo/odoo@1971bf3 the customised dropdown in the pivot view (the one that opens its submenus horizontally) cannot open at all its submenus.

As the correct behaviour cannot be restored without reintroducing the +300 scss lines that has been removed, this commit applies a temporary fix that *changes* the design of this dropdown. Now, its submenus will open vertically, like for the groupby menu near the search bar.

The final dropdowns design is currently ongoing within the taskid: 2578926

closes odoo/odoo#72640

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Stefano Rigano <sri@odoo.com>
2021-06-24 07:14:49 +00:00
Ivan Yelizariev 0f91970020 [FIX] uom: avoid unneeded qty conversion and fields fetching
This could save some time when `_compute_quantity` is used thousands times in
request and there are thousands UOMs in the system

* if qty is zero, then result is zero
* if to_unit is the same, then result is `round((qty / factor) * factor) = round(qty)`

---

opw-2549026

closes odoo/odoo#72582

X-original-commit: a122db226cdf801675daaee5a69bcb47a47ab174
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
2021-06-22 19:00:33 +00:00
Adrien Widart cffcee6147 [FIX] stock: display lot on delivery slip
When consulting a delivery slip, a portal user won't see the lots/serial
numbers used.

To reproduce the error:
(Need demo data)
1. Create a product P
    - Product Type: Storable
    - Tracking: By Lots
2. Update its quantity
3. In Settings, enable "Display Lots & Serial Numbers on Delivery Slips"
4. Create + Validate a SO:
    - Customer: Joel Willis
    - Lines: 1 x P
5. Validate the delivery
6. Log in DB with 'portal' (Joel Willis)
7. On SO, open the Delivery Slip

Error: The product's lot is not mentioned

Here is the condition to display the lot:
https://github.com/odoo/odoo/blob/c61db20204700a375f7005f50f95b44a60c3bb70/addons/stock/report/report_deliveryslip.xml#L77-L79

Problem is that portal users are not part of
`group_lot_on_delivery_slip`

When enabling the option, the groups are updated here
https://github.com/odoo/odoo/blob/adccb562209c2431a49438d36794f0765f1bc86d/odoo/addons/base/models/res_config.py#L570-L576
`implied_group` (which is `stock.group_lot_on_delivery_slip` in our
case) is added to `groups.implied_group`
The variable `groups` comes from `classified`, which is defined thanks
to method `_get_classified_fields` (see L553 in above code block)
And here is an extract of how this method works:
https://github.com/odoo/odoo/blob/adccb562209c2431a49438d36794f0765f1bc86d/odoo/addons/base/models/res_config.py#L460-L462
At some point, it checks if the field `group_lot_on_delivery_slip` has
an attribute `group`. In case `group` is not defined, the group
`base.group_user` is used. This is the reason why, by default, the
option is enabled for internal users only instead of all users.
Therefore, we just need to define the attribute `group` to the field
`group_lot_on_delivery_slip`

OPW-2558761

closes odoo/odoo#72656

X-original-commit: 475b35397b7254012a082a1206c478084c069857
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-23 15:56:47 +00:00
Lucas Perais (lpe) c00fb3cede [FIX] web: register template of dynamic classes once
Before this commit, the template of some dynamic classes (usually as WOWL to legacyAdapters)
were registered at each definition of the class which is potentially at every doAction/switchView

After this commit, they are all registered only once, as early as possible.

closes odoo/odoo#72476

Related: odoo/enterprise#19199
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-06-23 15:47:56 +00:00
Lucas Perais (lpe) 4e37b0bab0 [FIX] web: navbar: do not change url hash on item clicked
Before this commit, when clicking on menus or debug items or use menu items
the URL briefly changed pushing an unwanted history entry.

We do want those to be links (tag `a`) with an href to be able to open in a new tab.
But we don't want the current url hash to change because of it.

This commit fixes this.
2021-06-23 15:47:56 +00:00
Lucas Perais (lpe) 0cec54b92c [FIX] web: action_service: better error handling
on a legacy form view, do an action in target new
The view in target new should, during its onchange, trigger a ValidationError

Before this commit, the dialog_container was stuck in an error loop.
This was because the received error was never an instance of Error, rather it was
a legacy error event. So it was never transmitted upstream were the ErrorHandler could remove
the dialog in error from is dialog array.

After this commit, the ValidationError mesage is displayed.

This commit additionally fixes another issue:
An action in target main that failed to render erased the whole DOM. This is not what we want,
at least for now. Imagine a list view, open a record, this record fails to load. We still want to be
on the list view, not in a blank state.
2021-06-23 15:47:56 +00:00
Lucas Perais (lpe) a2d49d3003 [FIX] web: error_service: bind the event handlers on browser
Before this commit, the error service bound its listeners onto window.
This may create pollution when executing more than one test instanciating an error_service

After this commit, we bind the handlers onto browser, which is fully in our control in tests.
2021-06-23 15:47:55 +00:00
Lucas Perais (lpe) 77a59f8d6a [FIX] web: action_service: do not commit a dialog that has failed
Open a action in target new that you'll know will fail to open.
Make sure you put an onClose callback when executing doAction.

Open another action in target new, that will succeed.

Before this commit, the onClose of the first dialog is executed, while it should not.
Indeed, if the dialog fails, the whole business flow is invalid altogether
and no more business operation (in the onClose) should be executed

After this commit, the onClose callback of the failing dialog is not executed.
2021-06-23 15:47:55 +00:00
Jeremy Kersten cac58187f2 [FIX] website: imp indentation for html editor
closes odoo/odoo#43548

Signed-off-by: Romain Derie <rdeodoo@users.noreply.github.com>
2020-01-21 13:51:03 +00:00
Touati Djamel (otd) eb179429b6 [FIX] website_blog: Prevent tags loading if no blogs
Steps to reproduce the bug:
- Go to website app > configuration
- Set the visibility of all the blog to Website A (So that it's not visible on Website B)
- Go to the Blog menu of Website B
- A traceback is triggered

Problem:
The `all_tags` function calls an SQL query to get the tags related to the website blog
with a where condition based on the blog_id. But since there is no blog linked to the site.
The request fails and an error is raised.

Solution:
Do not load the tags, if there is no blog for the website.

Opw-2545315

closes odoo/odoo#72636

X-original-commit: 4d8fc86e4e6beb2171e3bebbabd532086d884d59
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-23 13:23:32 +00:00
wan 68e0a2c83d [FIX] l10n_de: review DIN5008 format
closes odoo/odoo#72548

X-original-commit: bfa7c9e78037cd0abda3e8f0a9a519a600988e9c
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-23 14:12:41 +00:00
wan 16595e8af2 [FIX] portal: use company_id for portal report generation
The company is needed in the context to get the paper format for
instance because of `get_paperformat`

X-original-commit: a1526eb4e5b1eb7cada603d7fcee7bb77c64bbac
2021-06-22 14:20:54 +00:00
Touati Djamel (otd) 43e1d21e0e [FIX] base: fix the VAT verification
Steps to reproduce the bug:

- Go to settings > create a new company :
	- Choose the country : `Mexico`
	- fill in the VAT field : ESA2005273X1
	- save
- Validation error is triggered

Problem:

The Mexican VAT can be on the format: "MXESA2005273X1" or "ESA2005273X1".
But only the "MX .." format is accepted for the moment,
and it fails in the case of "ES.." because the function checks if it is a valid Espganol VAT number.

In the case of failure, we use the `partner.commercial_partner_id.country_id` to get the country code.
The problem is when creating the res.company, we also create a res.partner
with a few fields within `VAT` except `country_id` field
while we use it in the `check_vat` function : https://github.com/odoo/odoo/blob/7a7aacedde81998ec0f1a7f3283337236e56de42/addons/base_vat/models/res_partner.py#L167

Opw-2573557

closes odoo/odoo#72633

X-original-commit: a6a46c95e4947997892b21f407132574da1c7ff1
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Djamel Touati <DjamelTouati@users.noreply.github.com>
2021-06-23 12:45:07 +00:00
Bruno Zanotti (ADHOC) a83e32151b [IMP] l10n_ar: electronic invoicing of docs 60 and 61
Add mapping rules to enable the electronic invoicing of document types
"CUENTAS DE VENTA Y LIQUIDO PRODUCTO A" (60) and
"CUENTAS DE VENTA Y LIQUIDO PRODUCTO B" (61).

closes odoo/odoo#72619

X-original-commit: 9fb221459e1137c0622c14a57ec408b3b5f65fe6
Signed-off-by: William André (wan) <wan@odoo.com>
2021-06-23 11:31:21 +00:00
Nidhi Patel e159698b96 [IMP] hr,sale(_timesheet): clean duration in days
The purpose of this task is there are several places where the
duration is expressed in hours even though the encoding unit
is in Days. This creates inconsistencies.

In this commit, we convert hours into days when the encoding
unit is in Days. Also, we changed the string of the fields
according to the encoding unit.

closes odoo/odoo#70512

Task-id: 2512950
Related: odoo/enterprise#18197
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-06-23 11:02:07 +00:00
Arnaud Joset 4e006fb831 [FIX] web: prevent traceback during calendar popover processing
Before this commit, a traceback would occurs in sale_management calendar view when the user would try to display the popover of a sale_order.

```js
basic_model.js:2399 Uncaught (in promise) Error: for modifier "readonly": Unknown field state in domain
    at Class._evalModifiers (basic_model.js:2399)
    at calendar_popover.js:203
    at Function._.each._.forEach (underscore.js:145)
    at calendar_popover.js:180
    at async Promise.all (index 1)
_evalModifiers @ basic_model.js:2399
(anonymous) @ calendar_popover.js:203
_.each._.forEach @ underscore.js:145
(anonymous) @ calendar_popover.js:180
Promise.then (async)
_renderEventPopover @ calendar_renderer.js:861
eventClick @ calendar_renderer.js:416
Calendar.publiclyTrigger @ main.js:6981
EventClicking._this.handleSegClick @ main.js:6462
realHandler @ main.js:385
```

It would happen because the domain of the partner_id is ["state", "not in", ['draft', 'sent']] but the state field is invisible="1" in the view.
state was absent during of the evalContext in the _evalModifiers function.

closes odoo/odoo#72617

Taskid: 2524993
X-original-commit: 0d636c0f8dbcfb4b7adda26c0edc02a12b0c7e44
Signed-off-by: Michaël Mattiello <mcm-odoo@users.noreply.github.com>
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
2021-06-23 11:15:21 +00:00
Adrien Widart 0a87cd21fd [FIX] payment_sips: prevent clearing the session cookie
When buying a product on website shop, after the payment with SIPS, the
page is redirected to an Error message: "We are not able to find your
payment, but don't worry. You should receive an email confirming your
payment in a few minutes. If the payment hasn't been confirmed you can
contact us."

To reproduce the error:
1. In Payment Acquirers, enable Sips
2. Go on website shop
3. Add a product to the cart, Checkout
4. Pay with Sips
    - Visa card number: 4100000000000000
5. Back to Web-shop, if the payment has been successfully processed,
repeat steps 2 -> 4

Error: The message "Your payment has been successfully processed. Thank
you!" is not displayed. Instead, the message "We are not able [...] you
can contact us." is displayed.

This message is displayed when:
https://github.com/odoo/odoo/blob/5945806c151b13d9d4cc13aa0a6c96a6b1bbad5f/addons/payment/controllers/portal.py#L65-L69
i.e., when the transactions list is empty. Here is how to get the list:
https://github.com/odoo/odoo/blob/5945806c151b13d9d4cc13aa0a6c96a6b1bbad5f/addons/payment/controllers/portal.py#L38-L42
It uses the session of the request. The cookie `session_id` is used to
identify the current session. However, after the payment on SIPS, the
page is redirected to `/payment/sips/dpn` with a POST request. Since the
session cookie has the attribute `SameSite=Lax` and the HTTP request is
a POST, the cookie will be filtered out:
https://drive.google.com/file/d/1xfx3YWkfonO3nK-8Rew45uSoR4lkpjpY/view?usp=sharing
(Browser information: This cookie didn't specify a "SameSite" attribute
when it was stored and was defaulted to "SameSite=Lax," and was blocked
because the request was made from a different site and was not initiated
by a top-level navigation. The cookie had to have been set with
"SameSite=None" to enable cross-site usage)
As a result, the server creates a new one. This is the reason why the
transactions list is empty: the list is based on a new session.

Adding the attribute `save_session = False` to the route will prevent
the server from creating a new session cookie and add it in the POST
response.

OPW-2518377

closes odoo/odoo#72611

X-original-commit: 9637a287923c6b82acfd487ed32d6bbc1fdf74b6
Signed-off-by: Antoine Vandevenne (anv) <AntoineVDV@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
2021-06-23 10:21:04 +00:00
Aaron Bohy e973e61c5f [FIX] web: click all as demo: load menus as demo user
Before this commit, the clickEverywhere test was run for the demo
user on all apps available for the admin. It thus crashed on the
apps that aren't available for the demo user.

closes odoo/odoo#72430

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-06-22 09:02:40 +00:00
Aaron Bohy 36370207b7 [FIX] web: clickbot: correctly select first level menus
Before this commit, when we wanted to select first level menus
inside an app (i.e. menus available in the navbar), we could by
mistake select sub-menus if the dropdown was opened (e.g. if it
was previously tested). For instance, it happened in the 'Apps'
app. It then led to wrong index computation, and a traceback. As
a consequence, the nightly build failed as the clickEverywhere test
didn't pass.
2021-06-22 09:02:40 +00:00
Nasreddin Boulif (bon) 3f399ac3a8 [FIX] mail: clean context on attachments creation
Steps to reproduce :

  - Install `CRM` and `Sales` modules
  - Go to Settings, activate "External Email Servers" and
    set an alias.
  - Edit 'Sales Team Europe' : add an alias
    (ensure alias end with the "External Email Servers" alias)
  - Send a mail to the europe sale team alias email with a
    base64 image in the html body
    ex: <img alt="" src="data:image/png;base64,ABCDE123....789">

Issue :

  - Traceback is raised.
  ("ValueError: Wrong value for ir.attachment.type: 'opportunity'.")

Cause :

  Both `crm.lead` and `ir.attachment` have a `type` field.

  When creating the thread, in this case of crm.lead model,
  it will add the 'default_type' and 'default_team_id' to the
  context.

  The context will be inhrited and used on the creation of the
  ir.attachment (in this case its the base64 encoded image
  inside the body).

  Since no `type` was provided while creating the ir.attachment,
  it will set the type from `default_type` in context since
  available.

Solution :

- Clean the context (in this case, it will remove `default_X` values)
  when creating the ir.attachment .

opw-2551461

closes odoo/odoo#72613

X-original-commit: 4504c9d8069082c9542226fbafdbf309089cf7a9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-06-23 10:22:39 +00:00