Commit Graph
142201 Commits
Author SHA1 Message Date
Aurélien (avd) 89ff8f2df5 [FIX] stock: improve SQL view perf by inlining CTE.
Report stock quantity defines a custom SQL View in init function,
inline the view CTE to improve performances of the
product.template/product.product forecasted quantity reports.

Remove product_tmpl_id related attribute and add product_tmpl_id
in SQL View's Select/Group_by to allow pushing down tmpl_id filters
in query plans.

closes odoo/odoo#69555

X-original-commit: 4c62765195a6410da1c4e74c0f1a0fcf57c38e97
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
2021-04-20 14:17:45 +00:00
wan 9dfe7d9f2f [FIX] base: ensure_one in ir.sequence._get_prefix_suffix
The try/except is there to check that the string can be interpolated, so
it is catching a ValueError. But if there is a singleton error (when the
length of `self` is bigger than 1), it will raise a ValueError too.
The UserError raised in the except is then weird/wrong.

closes odoo/odoo#69551

X-original-commit: 36ebbb6f312d488b33bae098546ff71baf578a08
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-20 13:36:19 +00:00
Adrian TorresandRaphael Collet b4487e8ea4 [IMP] core: allow grouping by m2m fields in read_group
With this commit, it is now possible to group the records of a model by
a Many2many field of said model.

The result of a read_group grouped by a m2m will return as many entries
or "groups" as there are different records in the comodel that are
linked to the model through the m2m, plus a null/false group, for records
of the model that have no linked records of the comodel or for records
of the comodel for which the current user has no read access to due to
ir.rules.

For a more illustrated explanation, the tests should cover all cases in
detail.

Note that this commit only introduces this change at the ORM level, the
frontend does not yet handle grouping by m2m fields but it is planned
in the near future.

Task-2428971

closes odoo/odoo#68958

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Co-authored-by: Raphael Collet <rco@odoo.com>
2021-04-20 12:08:35 +00:00
Adrian Torres be19a9e9aa [DOC] orm: document Query._join method
From having to work with it recently, it was not super clear what each
argument did (especially the link argument), and more documentation =
more betterer code
2021-04-20 10:35:07 +00:00
Qiuyu (QHO) bd67479316 [REF] mail, mail_bot, im_livechat, *: convert JS files to ES6 modules
task id: 2487514

closes odoo/odoo#69376

Related: odoo/enterprise#17749
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-04-19 13:33:35 +00:00
Aurélien Warnon 4283cfb496 [IMP] base: improve ir.module.module tree view
This commit simply improves the modules tree view by removing the tree
"decorators" and replacing it by a badge widget with associated decorators on
the 'state' field.

Indeed, the previous implementation could make the tree view look a bit "scary"
at first opening because it would color a lot of lines in red (modules were
not installed), giving it a feeling or "error" where there was none.

Now the color is directly shown on the state field, making it clear it's
related to that information.

Task-2507703

closes odoo/odoo#69374

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-16 09:26:45 +00:00
Florent de Labarre a2070262eb [FIX] website_sale_comparison: allow inherit ProductComparison
closes odoo/odoo#69532

X-original-commit: 365f5e755d105542adaf1fd5a70a2966ae6a209b
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-04-20 11:18:16 +00:00
jbw 79d7f1edab [FIX] account_payment: remove double country_code field in account_payment
There were 2 country_code fieldss in account_payment. Probably the result of
faulty rebase.

closes odoo/odoo#69530

X-original-commit: 0f4932c1b9b8c7201d175fff7e78bb1cecc98971
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: jbw-odoo <jbw-odoo@users.noreply.github.com>
2021-04-20 11:13:09 +00:00
Antoine Guenet 5af915f74d [FIX] web_editor: properly select the target link on destroy link tools
`setCursor` routinely failed to actually select the target link on
destroy the link tools because the nodes passed to it were not in the
DOM. This fixes that problem, which in turns has the effect of keeping
the editor's toolbar in the sidebar on the website builder after link
insertion.

closes odoo/odoo#69525

X-original-commit: c8fa05813da82fd2b282721f3a86053b7b6661ba
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-20 10:15:42 +00:00
Antoine Guenet f1cbe733b5 [FIX] web_editor: ensure focus is in editable after insert link
Prior to this fix, pressing CTRL+Z right after saving a link dialog
didn't do anything because the dialog prevents the focus from being in
the editable, even though the range is in the link. This waits for the
dialog to be removed from the dom so we can force the focus on the
editable.

X-original-commit: 769a22a579e4622861ca239084d7259820266b23
2021-04-20 10:15:42 +00:00
Antoine Guenet 6db6134f97 [FIX] web_editor: create a history step on insert a link with link tools
Prior to this fix, link tools didn't create a history step when they
were destroyed, meaning that you couldn't undo the creation of the link.
This ensures that the link tools are destroyed whenever a click is done
outside the toolbar, which ends the link edition and commits it to the
DOM. At that moment we can consider the link edition is over, equivalent
to saving the link dialog, and we can create a history step.

X-original-commit: 9b10c5923dadab3a49d474eb236c7c2617fb4be0
2021-04-20 10:15:42 +00:00
Odoo's Mergebot aeea025789 [FW][MERGE] test_{mass_mailing, mail, mail_full}: improve mail marketing tests
PURPOSE

Purpose is to have more tests when sending mail mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.

SPECIFICATIONS

In this commit we improve Email/SMS Marketing mailing tests. We notably

  * add tests for void and invalid emails and numbers. It allows to check they
    correctly update their trace status;
  * add tests for unsubscribe and view links embedded in mass mailing emails
    and sms;
  * add tests to simulate a click on links sent through mass mailing and
    ensure click statistics are effectively updated;
  * add tests to simulate bounce emails coming back to the mail gateway;

Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb. Both text- and
html-based jinja rendering for links is now tested.

Various docstrings are added to helpers and custom asserts. Various helpers
are improved or cleaned, with some old methods kept for backward compatibility.

LINKS

Task ID-2508643
Followup of #68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)

closes odoo/odoo#69518

Forward-port-of: odoo/odoo#69505
Forward-port-of: odoo/odoo#69461
Related: odoo/enterprise#17821
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-20 12:18:49 +02:00
Thibault Delavallée cbb911f530 [FIX] mass_mailing: keep invalid email on failed traces
SPECIFICATIONS

Traces are sent to normalized emails. If email is invalid email set on traces
is void as we cannot normalize it. In this commit we set it to the original
value of email, allowing to debug or at least understand what was wrong. It
also makes behavior coherent with SMS Marketing.

LINKS

Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780

X-original-commit: af841ccece14ffee0291f761d5363eceded65dfc
2021-04-20 09:18:22 +00:00
Thibault Delavallée 781b61405b [IMP] event_sms, link_tracker, sms, test_mail_full: improve SMS-based mailing tests
PURPOSE

Purpose is to have more tests when sending sms mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.

SPECIFICATIONS

In this commit we improve SMS Marketing mailing tests. We notably

  * add tests for void and invalid email and numbers. It allows to check they
    correctly update their trace status;
  * add tests for unsubscribe and view links embedded in sms marketing;
  * add tests to simulate a click on links sent through sms marketing and
    ensure click statistics are effectively updated;
  * ensure content of sent sms are checked;

Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.

In event we now correctly use sms gateway mock to ensure SMS finding.

In link_tracker a helper is added to check url tracking in plaintext content.

LINKS

Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780

X-original-commit: f1182b9da9aca9e67518fc10c240f3b21895a7ab
2021-04-20 09:18:22 +00:00
Thibault Delavallée 6782a561dc [FIX] mass_mailing: do not remove ignored traces from expected count
Partial backport of odoo/odoo@3e6bbedb64 . Purpose is to have expected being all
traces generated at beginning of mailing. Ignored should not be removed from
that expected count.

LINKS

Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780

X-original-commit: 0ea1b0099dcd31b3a9d7639feca6992c811a0b29
2021-04-20 09:18:21 +00:00
Thibault Delavallée b96d941aaa [IMP] mail, (test)_mass_mailing, test_mail_full: improve email-based mailing tests
PURPOSE

Purpose is to have more tests when sending mail mailings, notably about
canceled or failed mails or sms as well as jinja and links rendering.

SPECIFICATIONS

In this commit we improve Email Marketing mailing tests. We notably

  * add tests for void and invalid email and numbers. It allows to check they
    correctly update their trace status;
  * add tests for unsubscribe and view links embedded in mass mailing emails;
  * add tests to simulate a click on links sent through mass mailing and
    ensure click statistics are effectively updated;
  * add tests to simulate bounce emails coming back to the mail gateway;

Default content of mailings used in test is updated to ensure jinja is
correctly rendered, including links and some corner cases. This will also
helps ensuring behavior is kept when converting to QWeb.

Various docstrings are added to helpers and custom asserts.

LINKS

Task ID-2508643
Followup of odoo/odoo#68874 (improve mail tests)
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780

X-original-commit: 7b940ad46bde30f9bf16837f7bff5a70cd88c640
2021-04-20 09:18:21 +00:00
Thibault Delavallée 9f60e5cc97 [FIX] link_tracker: allow mock to parse HTML to find shortened links
Some incoming tests crash if parser is not the HTML parser when trying to find
a node given its ID. We also remove an unnecessary encapsulation, allowing
to avoid issues like embedding a body or head tag within a div.

Task ID-2508643
Prepares Task ID-27033 (support QWeb in templates)
Prepares Task ID-2377974 (clean trace and status management in mass mailing)
COM PR odoo/odoo#69461
ENT PR odoo/enterprise#17780

X-original-commit: a442057f161610e7869d0863acd067cbadd18195
2021-04-20 09:18:21 +00:00
Antoine Guenet bcd6f6208b [FIX] web_editor: properly load iframe wysiwyg without defining it twice
Template `wysiwyg.iframeContent`'s `#iframe_target` includes a `script`
element that defines an odoo module (`web_editor.wysiwyg.iniframe`).
`wysiwyg_iframe.js` resets the html of that target so that the node
prototypes are defined relative to the top window rather than the iframe
window. Resetting that html had as a side effect that the script was run
a second time while that is unnecessary given that the module has
already been defined. This resulted in an error, which is here fixed by
removing the `script` element from the html when resetting it.

closes odoo/odoo#69492

X-original-commit: 3d4e0f15dd9a0009a7d0fc19fc29a5df9a6f92e8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 14:22:49 +00:00
Sébastien Geelen (sge) d5ec63cd48 [FIX] web_editor: fix traceback for some CTRL+A cases in mass_mailing
closes odoo/odoo#69486

X-original-commit: 22926d0bfca472daad8cebddbc19e6bb3e846904
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 13:25:06 +00:00
Noe Antoine fd36f91540 [IMP] - account, * : clarify the UX of warnings on partner.
*, purchase, sale, stock.

Before, the warning messages, if any, were always visible below the
warning option (emplty selection, No message, Warning, Blocking Message),
making it unclear for the user when selecting No message and seeing
the error message just below (as readonly).

Now, make the message invisible if the message option is empty or No Message.
Therefore the user is not confused by not relevant message, and it eases
the message editing process (before, user could see readonly message and
change selection field value before editing).

Task ID - 2481450
COM PR - odoo/odoo#68417

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-13 09:49:54 +00:00
Aaron Bohy c0c6be8dd1 [FIX] web: properly unpatch session after each test
Before this commit, `getTZOffset` and `user_has_group` weren't
correctly reset to their initial values after tests. As a
consequence tests executed afterwards might behave unexpectedly.

closes odoo/odoo#69497

X-original-commit: b7b83db88c61d7db87045d87b09d7348f3a8a9eb
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-19 15:48:31 +00:00
Laurent Smet 53913adfc1 [FIX] account,point_of_sale: Allow mixing 'affect base' price-included/price-excluded taxes
Before this commit, such configuration wasn't allowed.
However, in some countries, this is mandatory, when dealing with eco-tax for example:

Suppose t1, t2 being taxes where:
- t1 is include_base_amount, price_excluded, fixed tax of 10 (eco-tax)
- t2 is include_base_amount, price_included, percent of 21%

The computation on 1210 should be:
price_excluded: 1210 / 1.21 = 1000
price_included: (1000 + 10) * 1.21 = 1222.1

closes odoo/odoo#69449

X-original-commit: 2bb9e68b546db191b2a88b787a865548d8107bcd
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-19 09:26:17 +00:00
Nicolas Lempereur ffec6256de [FIX] web: web_translation route lang required
The /web/webclient/translations route's `lang` argument has had some
changes in the last year:

- before june 2020 (a9a756cf): very often it was set to null

- after june 2020 (a9a756cf): it was more often correctly set or had
  en_US as fallback so never null

- after 31 march 2021 (8cc06617) in saas-14.3: lang is not sent to
  server if it is null (which should never happen)

- after 15 april 2021 (a93a0a3): en_US fallback is removed to prevent
  overriding server language if another language is better

But the fix in 31 march and 15 april are not compatible because the
route /web/webclient/translations require a lang argument.

With this changeset, lang argument is always sent to the server.

closes odoo/odoo#69487

X-original-commit: 0604dce996882fb93cd71885f7eb4d0749eb357f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-19 13:25:26 +00:00
Aurélien Warnon f039c57398 [IMP] website_event_track: rework track proposition mail template
This commit slightly reworks the "event_track_template_new" template to format
it a little better and get rid of unnecessary blank sections.

The "subject" param was removed from the "message_post_with_view" call as we
don't want the chatter to contain the name of the track twice.
Indeed, since #61570, the "subject" is displayed in the chatter if it differs
from the thread name (which is the case here).
This causes a small regression for emails that will state "Re: EventName" in
their subject instead of the track name, but it's deemed acceptable to have a
nicer chatter message.

We also remove the description of the "mt_event_track" mail.message.subtype as
it's only used with a custom template and is redundant with that template's
content.

Task-2496444

closes odoo/odoo#68864

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-19 08:32:20 +00:00
Sébastien Geelen (sge) f3043e94e9 [FIX] web_editor : correctly update toolbar inside iframe
closes odoo/odoo#69479

X-original-commit: cdd625b9c6ea6eb5f8a7c35175e85cf701869648
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-19 12:29:41 +00:00
Swapnesh ccba1ce694 [FIX]account: process one record to set debit/credit
Before this commit, There would be Expected singleton error
on changing Credit/Debit for multile account in single call.

Now, We are proocess one record to set `_set_opening_debit_credit`

closes odoo/odoo#69474

X-original-commit: 8fe9f552ed4591795b449f4d1e32e1563ce43ca2
Signed-off-by: William André (wan) <wan@odoo.com>
2021-04-19 12:22:14 +00:00
Xavier BOL (xbo) da336947c0 [FIX] sale_timesheet: fix unnecessarily recompute price_unit in mapping
Before this commit, the currency_id field has the same compute method
than the price_unit field in the employee mapping. When the
industry_fsm_sale module is installed, the price_unit is recomputed
because of the currency_id and then the user cannot manually edit the
price_unit in fsm project form view.

This commit adds a compute for the currency_id field to not
unnecessarily recompute the price unit in the employee mapping.

Related PR: odoo/odoo#66181

closes odoo/odoo#69458

Related: odoo/enterprise#17770
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
2021-04-19 09:46:39 +00:00
Benjamin Vray 079b9556c6 [FIX] website: fix top position of modal
Before this commit, the top position of a modal in website was always
the height of the main menu navbar. Even if the main menu navbar was
not displayed when the user is not logged.

That bug was introduced in 6ef622772f

After this commit, the top position of a modal is the height of the
main menu navbar but only if that navbar is displayed.

task-2507949

closes odoo/odoo#69391

X-original-commit: 00ab01d05b3876c5d926e16b9a5d65ace4df7360
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-04-19 13:01:46 +00:00
Sébastien Mottet (oms) 61aa892686 [FIX] website: make configurator IAP call failures silent
On initialization, the website configurator makes a
call to an external service (api_website) hosted on
iap-services.odoo.com to retrieve a list of industries.
This call might fail if the external service is done.
This potential failure is now correctly handled:

On '/api/website/1/configurator/industries' call
failure, the configurator is silently skipped and the
user is redirected to the view website.theme_view_kanban

closes odoo/odoo#69465

X-original-commit: 35311608197ec77bafed82505639314ca693fb19
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-04-19 11:30:49 +00:00
Andrea Grazioso (agr-odoo) 42478e3e88 [FIX] base: avoid infinite recursion on attachments search
Have a large number of attachments with res_field set
Then go to Settings -> Technical -> Attachments -> add a filter "Res
Field" is set.

You will have traceback. This occur because the `_search` function will
omit from results records with res_field set, forcing recursive calls
until either we scan the whole table (80 records at a time) or we hit
max recursion limit

opw-2463634

closes odoo/odoo#69459

X-original-commit: 08fb44a1f8af9684c28c0dd5e82121193d9bef9a
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-04-19 10:12:10 +00:00
Antoine Guenet 61fc91243c [FIX] web_editor: build editor up to commit fa480dd
closes odoo/odoo#69422

X-original-commit: 6ba1571547a9b7d62438fed15d061485d1696026
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-16 16:54:31 +00:00
Antoine Guenet 1f266b9939 [IMP] project: make project description full height by default on edit
X-original-commit: 1d6edf18883eb8c47e365a1ffc2b355bd20c02f5
2021-04-16 16:54:30 +00:00
Antoine Guenet b05b76ead6 [IMP] project: align description tab content like other tabs
X-original-commit: 371591878ee9f2462038ff787e1910f91b997453
2021-04-16 16:54:30 +00:00
Antoine Guenet 101a30d16b [IMP] web_editor, note: make note pads fill their container
X-original-commit: 1f9e2f37711a6da4b9f678c6f0750f8435ef948d
2021-04-16 16:54:30 +00:00
Antoine Guenet 6b0bed04df [IMP] web_editor: remove useless resizer on mobile
X-original-commit: 808207b0b7b1ebc22c65d83034bd75f761c0efed
2021-04-16 16:54:29 +00:00
Antoine Guenet 035c2fbc8a [FIX] project: properly style the description field
X-original-commit: 7924675c2a45a0313ddd80ec27fa23597844dead
2021-04-16 16:54:29 +00:00
Antoine Guenet 6b01724c84 [IMP] web_editor, note: make notes fill their container
X-original-commit: 05d6f0cfdc35842c5847db70475da5e7c982ba06
2021-04-16 16:54:28 +00:00
Antoine Guenet 138c0ce67e [FIX] website: properly focus an editable zone with a placeholder
closes odoo/odoo#69330

X-original-commit: f355f0ea276a39674842700bc5f22b2a7cbe5790
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-04-15 14:57:00 +00:00
Matthieu Stockbauer 69b24e4de1 [IMP] website : review theme kanban descriptions
task-2451868

closes odoo/odoo#68985

Related: odoo/design-themes#461
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-04-19 08:01:28 +00:00
Xavier BOL (xbo) 21d4788a32 [FIX] hr_timesheet: only create task in timesheet views if project set
Before this commit, when the user wants to create a timesheet in the
list or form view of this model, the user can quick create a project and
a task if he wishes. The problem is when the user wants to quick create
a task without defining a project in the form view of timesheet, because
the default_project_id of the task will be false and a task without
project will be created.

This commit checks when the user clicks on the task_id field if the
default_project_id exists in the context and if the default_project_id
is not false, then we allow to the user to quick create a task for this
timesheet, otherwise he can just select a task.

Moreover, the js file is updated to fit with the new syntax.

closes odoo/odoo#69420

X-original-commit: d3693ad15eae23829e5ed6ef6dfa915eeab5c8cc
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-04-16 16:02:56 +00:00
Goffin Simonandmart-e 89d9ae940b [FIX] base: User with "Administration /Access Right" can't View "Groups"
1. Create a new user with only "Administration / Access Right"
2. Login as the user
3. Turn on debug mode (via plugin or by editing url)
4. Go to "Settings -> Users and Companies -> Groups"
5. Open any group form / Press "Create" button.

Bug:

Error "You are not allowed to access 'View' (ir.ui.view) records."

A user who is managing "Access Right" must be able to create/edit groups

opw:2492803

closes odoo/odoo#69332

X-original-commit: e179011b3118fe355ea33be194585f674d40df3f
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: mart-e <mat@odoo.com>
2021-04-15 15:07:44 +00:00
fw-bot 4da5f2eaba [FIX]account_edi_ubl : fix finding of partner using vat identification
closes odoo/odoo#69226

X-original-commit: 66c7ee23320c595e71c1183a3bd439530ace13c9
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-04-19 07:35:25 +00:00
Goffin Simon ca3dfec135 [FIX] mrp: Print BOM / BOM structure & cost
Steps to reproduce the bug:

- Install manufacturing app
- Create a product A
- Create a Bill of Materials for product A
- Archive Product A (Only the final product not any of the components)
- Print BOM or Print BOM Structure & Cost

Bug:

A traceback was raised

opw:2447514

closes odoo/odoo#68116

X-original-commit: 81ee677bd52db388e29c26e255ccab27a286cf94
Related: odoo/enterprise#17186
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2021-03-18 17:17:01 +00:00
Pierre Courtoy (pco)andsimongoffin f6d9a6958c [FIX] incorrect method called in get balancing pos account
When the pos session can't be balanced, a balancing account
is used. First, we take the company balancing account,
but if it is not set, we need to take the property.
Here, it was the wrong method used to get the property.

opw:2439889

closes odoo/odoo#65817

X-original-commit: 550906d48682996cb47142bb0d519fdbfac69642
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Co-authored-by: simongoffin <sig@odoo.com>
2021-02-09 13:30:10 +00:00
David Beguin 6d6a442ecd [FIX] website_livechat: ensure session data integrity during visitor lifecycle
This commit fixes two issues encountered during the visitor lifecycle.

1. When a visitor arrives on the website on a non tracked page, a
website.visitor is not created yet, but the visitor can still start a livechat
session. When navigating to a tracked page, a website.visitor is created but the
lifechat session already started is not recovered and the discussion is lost at
visitor's side. This commit links the already started livechat session to the
newly created visitor to ensure that the conversation can still continue
normally.

2. When a visitor logs in, his attributed visitor is linked to the partner. But
there can be only one visitor per partner. If there was already a visitor linked
to the partner, the later visitor's livechat session are updated with the
partner and the visitor is then deleted. But the visitor's livechat sessions are
not linked to the main partner visitor. So when looking at all the session the
partner had, we can only see the main visitor's livechat session.
This commit copy the livechat session of that later visitor to the main partner
visitor to ensure keeping the complete livechat history for each partner.

Task ID: 2460892

closes odoo/odoo#69402

X-original-commit: 4e1034ff2f08fa20bcdc9ac39eb2489d34a9715d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-16 14:11:34 +00:00
Arnaud Joset 5c4ac1d016 [FIX] calendar: solve undeterministic bug on event acceptance
Before this fix, the runbot would fails randomly during the nightly multi-build in test_accept_meeting_unauthenticated and test_accept_meeting_authenticated.

```py
odoo.addons.calendar.tests.test_calendar_controller:36

FAIL: TestCalendarController.test_accept_meeting_unauthenticated
Traceback (most recent call last):
  File "/data/build/odoo/addons/calendar/tests/test_calendar_controller.py", line 36, in test_accept_meeting_unauthenticated
    self.assertEqual(self.event.attendee_ids[1].state, "accepted", "Attendee should have accepted")
AssertionError: 'needsAction' != 'accepted'
- needsAction
+ accepted
 : Attendee should have accepted

```

There was a hard coded index of a record in a many2one field and sometimes, the record order changed. The asserted value was not the one expected and therefore, the test failed.

closes odoo/odoo#69263

Taskid: 2497816
X-original-commit: 4632ee9a02e366dcb7da6b46f23a3cd367412ccb
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2021-04-14 15:16:31 +00:00
Nicolas Lempereur 3646554733 [FIX] stock: deduplicate detailed operations
Detailed Operations tab of a stock.picking was duplicated for style
purpose in 30f2ad8c4. But this caused issue eg. in studio because the
same field with very similary path was being edited.

Since having duplicate fields with same path is not very well supported,
this commit remove the duplication after a CSS fix has been done in
web_enterprise after which it is no longer required.

opw-2480311

closes odoo/odoo#69070

Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2021-04-09 16:17:21 +00:00
David Beguin 49dc69cfea [IMP] base_import: fix field dropdown list return values
When generating field completion, if there are no o2m or suggested fields,
the method was returning the list of values without adding the regulars fields.

This commit returns correctly the complete set of values.

Task ID: 2508902

closes odoo/odoo#69423

X-original-commit: 134b0f28a43042b22bed1c5f657344544e0f8d22
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-04-16 16:54:52 +00:00
Naglis Jonaitis e59b032f06 [FIX] core: fix <act_window> deprecation warning
Without the f-string literal the XML ID is not printed.

closes odoo/odoo#69419

X-original-commit: d0cbe52c111af923f0df5d0d231b164a150bf2db
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-04-16 15:57:07 +00:00
Michael Mattiello (mcm) 3036fc05b8 [FIX] web: fix widget wrapper and weekdays widget
Before this commit, `WidgetWrapper` tried to redirect the call to
`updateState` on its wrapped component but it can happen that the
wrapper is not mounted yet and thus calling a function on its wrapped
component will crash.

This commit changes the implementation of `WidgetWrapper.updateState`
to redirect the call to `this.update` which will update the props of
the wrapped component and not directly its state.

task 2504521

closes odoo/odoo#69421

X-original-commit: 67f09b9a9df248fec26f53758e76070ab3171435
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-04-16 16:04:00 +00:00