Commit Graph
156544 Commits
Author SHA1 Message Date
shsa-odoo bd1850d30f [FIX] mass_mailing: should not crash when loading snippets
Current behavior before fix:

In mobile view when we click invite button on events module which loads the
snippet, at that time there was a traceback.

Desired behavior after fix:

Now the snippet gets loaded without any traceback.

Task-2994261

closes odoo/odoo#106734

X-original-commit: 634f6ae4d4208f0551bc2b81c359915eb47316b5
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 18:51:49 +01:00
Samuel Degueldre 2b33d2113e [FIX] web: make originalError the root of the error chain
Previously, when calling error handlers, we would give them a new error
created by the error service, as well as an `originalError` which is the
error that was caught by the error service. In some cases, this error is
part of an error chain, eg: errors that happen in the owl lifecycle are
wrapped in an `OwlError`, so that when an error occurs in a callback
passed to a lifecycle hook, the position where the hook was called to
register the offending callback is part of the stack trace.

In practice, most error handlers only care about the error that caused
the entire error chain (the root) when deciding whether they should
handle the error or not, eg: an RPCError should be handled by the rpc
error handler, regardless of whether it occured in an event handler or
in a component's willStart. It already reads the traceback to display on
the UncaughtError provided by the error service as this traceback
contains the entire error chain stack information and is annotated with
source maps by the error service.

This commit makes it so that the `originalError` passed to handlers is
now the root of the error chain, it also sets the `cause` of the
UncaughtError which is passed to handlers as the error that was caught
by the error service, so that if a handler needs to inspect the error
chain to know whether it can handle the error or not, it can still do
that.

related to OPW-3069633

closes odoo/odoo#106720

X-original-commit: dd6f103b1635868e03a7aa40eb7186861d22d377
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-11-28 18:51:47 +01:00
Romeo Fragomeli 755cb64b4a [FIX] web: titles are smaller in reports
Since the Bootstrap 5 migration the "headings" `<h1>`, `<h2>`, ... are
smaller than before.

This commit, restores the old CSS rules from Bootstrap 4 for reports.

Steps to reproduce:
* Open Sales
* Select a quotation
* Print the Quotation (using Print dropdown) => BUG title is smaller
  than the old version of Odoo (e.g. Odoo v15)

closes odoo/odoo#106721

X-original-commit: 76299a8d63e85249d30d864a777c2f142ea5daf5
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-11-28 17:54:03 +01:00
Kevin Baptiste 0a0c6917b5 [FIX] hr_holidays: take full day leaves on Day view
The default hours of a time off created from the Day view would be the
range of hours that was selected in the calendar view, thus resulting in
leaves of half an hour.

closes odoo/odoo#106719

X-original-commit: 1ea102d4a2d62308c6dfaa7c3a71fdc4c6c4db85
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-28 16:53:48 +01:00
Romeo Fragomeli 3dc6d81590 [FIX] web: kanban: quick create column text wrapped
In kanban view, the columns are in a flex container and as there is no
specific flex rules on the quick create column and is shrink by
default. So when the new column is above the edge of the viewport, it
starts to shrink.

To avoid this bug we have added the same flex rules has the kanban
column.

Steps to reproduce:
* Open Note
* Create many new column => BUG text wrapped when the new column reach
  the width of the viewport.

closes odoo/odoo#106683

X-original-commit: 62b692b6edd7d57ef14c02ecd5b731c8ba664b98
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2022-11-28 15:53:25 +01:00
Patrick Hoste 58fa3d1ece [FIX] mass_mailing: fix unsubscription_date when opt_out on create
Before this commit when creating a mailing contact with a mailing
list opt_out at creation the unsubscription_date wasn't set.
Indeed, from the mailing contact view the mailing list uses an
editable list that passes all the values at create even when not set
contrary to when one update the contact only the changed values are
passed. This commit fix this issue.

Task-3070852

closes odoo/odoo#106682

X-original-commit: e7c22094068ce5cdff7f30178cea6d4f39f09137
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Hoste Patrick (pko) <pko@odoo.com>
2022-11-28 15:53:23 +01:00
Florent de Labarre 44c407da3c [FIX] stock: impossible to search correctly location
Before this PR Odoo don't pre-search on location.

closes odoo/odoo#106680

X-original-commit: 55729e2bfb402e5af6569c8dd19ee8495fa244a9
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 15:53:20 +01:00
niyasraphy 4b04d2d7d3 [FIX] lunch: timezone field alignment in alert form view
closes odoo/odoo#106679

X-original-commit: 4b0efa700d045b6f8f8b7569d498137af4d09909
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-11-28 15:53:17 +01:00
Valentin Vallaeys (vava) 3e0c80270d [FIX] product,web: color_field fixes for product variant color
There was a typo in the color_field xml not allowing to disable the
pop-up in case of readonly. A test validates the feature is active.

The color_field now displays the transparent symbol (instead of black
color) in case the color is undefined.

The product configurator also displays the transparent symbol for
undefined non-custom colors.

task-3013110

closes odoo/odoo#106669

X-original-commit: c67c32c2dbe10b4885ec1177852839b3d18ecf05
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-11-28 15:53:11 +01:00
Odoo's Mergebot 70a6407d6c [MERGE][REF] account, mail, sale: properly locate code
PURPOSE

Purpose of this task is to cleanup attachment management done in composer overrides
in account modules and move it to model.

SPECIFICATIONS

Accounting holds code to handle attachments linked to their custom composer
(``account.invoice.send``) that uses through inheritance the mail composer
(``mail.compose.message``) that has a specific processing of attachments
to link pending composer attachments to the right records. Move it as a classic
model override for account.move

Account_edi and various l10n submodules hold some custom code to generate and
handle EDI attachments. It is used to add attachments linked using AccountMove
specific 'edi_document_ids' field when sending emails based on templates.
Move it as a classic model override for account.move and account.edi.document.

Move model-specific overrides of the mail composer directly at model level in
purchase and (website_)sale.

Update some naming and docstrings accordingly. See sub commits for more
details.

LINKS

Task-2710804 (Mail: Clean MailThread API)
Task-2792146 (Mail: Move model-dependent code from composer / template)

closes odoo/odoo#106658

Related: odoo/enterprise#34439
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-28 15:53:00 +01:00
Thibault Delavallée 04c1959456 [MOV] account, mail: move model-specific template code to model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Account_edi and various l10n submodules hold some custom code to generate and
handle EDI attachments. It is used to add attachments linked using AccountMove
specific 'edi_document_ids' field when sending emails based on templates.

Currently MailTemplate is overridden in accounting modules to hold code related
to AccountMove and AccountEdiDocument attachments manipulation. This is linked
to EDI and report naming, not mail specific. This should therefore not be
implemented at template level, but in those specific models.

For that purpose we introduce a method in MailThread that allow to handle
attachments when being in a template context. An override in account_edi
allows to implement its specific behavior.

By the way an old docstring in l10n_it_edi that was quite unrelated to the
override is also removed, as it was more confusing than helping.

Task-2792146 (Mail: Move model-dependent code from composer / template)
Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 0be5b37008 [MOV] mail, loyalty, purchase, (website_)sale: move model-specific composer code to model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Update addons

  * in purchase and sale: context key update should be done at message_post
    level, especially this is not used in mass mailing mode;
  * in website_sale: code to update sale order to avoid sending recovery
    emails several times belongs to a "post hook" method on sale order model;
  * in loyalty: remove a deprecated / unsupported 'mark_coupon_as_sent' key;

Task-2792146 (Mail: Move model-dependent code from composer / template)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 1c240f11df [IMP] mail: cleanup code bits in attachments processing
Purpose of this commit is to try to make code a bit easier to follow using
dicts, sets and tuples, as well as updating some variable names.

Also rename the method to be clearer. Tools methods may omit the namespacing
to avoid too much confusion in naming.

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:59 +01:00
Thibault Delavallée 0ea4c3110a [MOV] account, mail: properly locate attachments management on model
PURPOSE

Purpose of this task is to cleanup attachment management done in generic mail
models overrides and move it in account as model overrides.

SPECIFICATIONS

Accounting holds code to handle attachments linked to their custom composer
(``account.invoice.send``) that uses through inheritance the mail composer
(``mail.compose.message``) that has a specific processing of attachments
to link pending composer attachments to the right records.

Indeed attachments linked to the composer are pending attachments, and are
linked to the record when posting the message. This allows to know which
attachments have been added by the user, have specific rules for access
rights, ...

However this code has been wrongly added directly at mixing level at
odoo/odoo@bdcc012004. Instead ``_message_post_process_attachments`` method
should always be called based on a record, allowing to locate the override
at model level.

Task-2792146 (Mail: Move model-dependent code from composer / template)
Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:58 +01:00
Thibault Delavallée f1bb452ce4 [MOV] mail: move method to process attachments
Purpose is to make a section that will cover pre- and post- process methods
for posting or mailing records.

Task-2710804 (Mail: Clean MailThread API)

Part-of: odoo/odoo#106658
2022-11-28 15:52:58 +01:00
Kartik Chavda 49977c1116 [FIX] hr_timesheet: fix searching on is_project_overtime field
Before this commit Projects in overtime filter does not return
project as expected after project has allocated hours to set
on then.

This commit fixes by taking allocated hours into account to
search for project that are in over time.

task-3000817

closes odoo/odoo#106657

X-original-commit: cbd091cb088fba44c14c27dbbc9e8ca098742da1
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-11-28 15:52:49 +01:00
Jérôme Hellinckx 86ad480b72 [FIX] purchase_stock: avoid PO exception propagation to DONE receipts on less received quants
Before this commit:
1. Create PO with quantity 10, confirm (creates receipt-1)
2. Receive 2 quantities on first receipt (receipt-1), backorder (receipt-1 is 'done', creates receipt-2)
3. Receive 3 quantities on second receipt (receipt-2), backorder (receipt-2 is 'done', creates receipt-3)
4. Change quantity to 5 in PO
5. An exception is created on all receipts (1, 2 and 3)

In the scenario above, receipt-1 and receipt-2 are partial receipts that are set to 'done'.
It is not necessary to create an exception in these receipts when the quantity is changed to less than originally expected in the PO.
Since the system checks that the new quantity has to be equal or greater than the received quantities, the already received quantities cannot be impacted.

After this commit:
The exception is only propagated to the receipts that are not done.
e.g. in the example above, an exception appears only in receipt-3.

task-2648209

resolves #76297

closes odoo/odoo#106633

X-original-commit: d6fad232c3dd4a4f7cd54bd255b75314d54ed065
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:42 +01:00
Mathieu Duckerts-Antoine 74c5692f48 [FIX] web: fix the error that the name of the line is too long
- Currently the label of the lines is not limited to the number of characters. When the user gives a name that is too long, the graph will not be displayed.
- This commit limits the number of labels, if exceeded it will display as ...

closes odoo/odoo#106623

X-original-commit: 54657151957c5be5e885c245db9e1830709833c0
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-11-28 14:51:39 +01:00
Jinane Maksoud 4e06b34bce [FIX] mrp: fix the filter order in _bom_find_domain
Only active boms should be returned by the domain even if
they match a product id.

closes odoo/odoo#106615

X-original-commit: 2a73890d304476833d76bac9a36ef92f12f267a3
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:36 +01:00
Donatas cd704e7119 [IMP] website_sale: adds search_product to shop values
closes odoo/odoo#106613

X-original-commit: 3772da47af7e1de2d9608372c9306e61a91ded82
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-28 14:51:33 +01:00
Lucas Lefèvre 4bb43e2554 [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/ab6f47f9 [FIX] InternalViewport: compute the actual visible rect of a zone
https://github.com/odoo/o-spreadsheet/commit/966c311e [REF] plugins: unify position getters API
https://github.com/odoo/o-spreadsheet/commit/9f1c9695 [IMP] model: ignore type property in command payload
https://github.com/odoo/o-spreadsheet/commit/862dacbc [REF] selection: rename getPosition to getActivePosition
https://github.com/odoo/o-spreadsheet/commit/0144515a [REF] selection: getPosition return main position
https://github.com/odoo/o-spreadsheet/commit/38422f4f [FIX] find and replace: scroll on single match.
https://github.com/odoo/o-spreadsheet/commit/9be582c7 [FIX] selection_input: traceback when using unbounded ranges
https://github.com/odoo/o-spreadsheet/commit/49285322 [IMP] doc: add tables of contents
https://github.com/odoo/o-spreadsheet/commit/2c5d86af [IMP] model: config to provide external dependencies
https://github.com/odoo/o-spreadsheet/commit/5b442218 [REF] plugins: use object in constructor
https://github.com/odoo/o-spreadsheet/commit/ef98be1b [REM] plugins: remove useless modes
https://github.com/odoo/o-spreadsheet/commit/4f20d05f [IMP] data: reorganize data top menu

closes odoo/odoo#106583

Related: odoo/enterprise#34412
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-11-28 14:51:24 +01:00
Romain Derie 2fdd998a9a [IMP] website: improve we-urlpicker URL preview button wording
Quick feedback from client, this is following [1] that added a button
next to the URL input of `we-urlpicket` to be able to preview the link.

The wording was not great, it gives the impression it's an option to
chose to have that URL opened in new tab (eg when form is submitted).

Also, giving it the style of a conventional we-button was also giving
the same impression that it was actually an option that you could click
on to enable something.

Changing the wording and the style of those special we-button should
reduce the confusion.

Arguably, one might think about the usefulness of this button but it
acts as the counterpart of the regular links which have a "Open in new
tab" possibility when hovering the link in their preview tooltip.

[1]: https://github.com/odoo/odoo/commit/acdf3cf7f5aebd803ffa1507e81ed8801727a03a

opw-3060966

closes odoo/odoo#106538

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-28 14:51:21 +01:00
Bruno Boi 7f257a2025 [FIX] web: popovers and arrows repositioning
**Before this commit**
When a popover is shown and then repositioned to a different placement
(i.e. due to window scrolling or resize), its arrow is misplaced.

This is due to the fact that classnames added in order to correctly place
its arrow are just added to the previous ones instead of replacing all
the needed classnames.

**After this commit**
The classnames are now properly replaced instead of just being appended.

closes odoo/odoo#106495

X-original-commit: c54cc2f87930147b5addb6f447574c677ef3504d
Signed-off-by: Luca Vitali <luvi@odoo.com>
2022-11-28 14:51:16 +01:00
Simon Genin (ges) 7455bd4d79 [IMP] test_lint: remove escheck test
As of 16.1, the ecmascript version accepted in odoo is 2022.
This basically makes escheck almost irrelevant.
Escheck being only able to check up to the version 2021, it can be
removed safely.

closes odoo/odoo#106052

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2022-11-28 14:51:10 +01:00
Rodopho Cammarosano de Lima (rcdl) 3c12c5e939 [IMP] web_editor: add forceNewWindow to LinkTools
Upon instantiation of a LinkTools object, the forceNewWindow property is
now added to the options object. This allows us to take advantage of the
pre-exisiting mechanism to conditionally display the "open new window"
checkbox in the LinkTools widget
(odoo/addons/web_editor/static/src/xml/wysiwyg.xml:334).

The possibily of not having the checkbox in the DOM demanded a
modification of LinkTools._isNewWindow().

_isFromAnotherHostName(), being used by both LinkDialog and LinkTools,
was moved to their parent class Link.

task# 2789222

closes odoo/odoo#104923

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 14:51:07 +01:00
Rémy Voet (ryv) 7f7006da02 [REM] stock_account: remove useless overwrite of read_group.
Force `group_operator` of `unit_cost` to be None to be able to
remove useless `read_group` override.

closes odoo/odoo#104863

Related: odoo/upgrade#4012
Related: odoo/enterprise#33568
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-28 14:51:00 +01:00
Hugo Carlier (Huca) fb13d7c99e [IMP] project, hr_timesheet: improve UX
- Description:
    - project: Apply default filters when selecting a 'blocked by'
    task in task form (project.task form view > blocked by notebook >
    add a line > apply a default filter on the current project and on
    open tasks)
    - project, hr_timesheet: uniformize remaining hours display in
    kanban view for tasks and projects (project.project kanban view:
    add a frame around remaining hours. The color of the frame follows
    the same rules as the one used in project.task kanban view)

task-3034806

closes odoo/odoo#104250

Related: odoo/enterprise#33309
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-11-28 14:50:50 +01:00
Nicolas Bayet 0340537152 [FIX] web_editor: check method addNeutralStyle
Because of css limitation, the child of a parent that define a
text-decoration cannot "neutralize" that decoration defined by its
parent with a css property (ie. the text-decoration cannot be
overridden).

When a block define an inline style or any tag that have a class, the
method `formatSelection` tries to "neutralize" the style by calling
`addNeutralStyle`. As it is impossible to "neutralize" the style for
underline nor strikeThrough, there is no method `addNeutralStyle`
defined for those properties.

Before this commit the method `formatSelection` was crashing because
`addNeutralStyle` was not defined.

Task-3002123

closes odoo/odoo#106635

X-original-commit: ce068a3113204dc558e69e88f1d2d778fa446c73
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 13:20:47 +01:00
Mathieu Duckerts-Antoine 84a0d31ca7 [FIX] web: search model: one2many search default labels
When a one2many is used as a search default, its label has to be fetch
via a name_get in order to get a correct display of the facet
corresponding to that field in the search bar. It turns out that the
search model did not wait properly the return of the name_gets before to
start to compute the facets.

closes odoo/odoo#106624

X-original-commit: 50f58212410b321c1c4ad3d42a91cd1d23567308
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-11-28 13:20:44 +01:00
Antoine Guenet fc080b960d [IMP] web: extend form default autofocus to textarea and contenteditable
When rendering, the form view looks for the element it should autofocus,
and defaults to the first text input it finds. This extends that default
behavior to the first textarea or contenteditable element.

closes odoo/odoo#106622

X-original-commit: 82a98715ae2937bff8b58212c452a28d0b28e102
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-11-28 13:20:41 +01:00
Antoine Guenet b5af8198fa [FIX] web_editor: handle default_focus form attribute for html_field
When rendering a form view that has a truthy `default_focus` attribute,
the renderer looks for the element in its tree that has its `name` as
`id`. However in the case of `html_field` it couldn't find it since
`html_field` failed to apply that `id` to its focusable element (the
editable root). This adds the `id` to the editable root when rendering
the element in `wysiwyg`, and also directly applies `contenteditable` to
it so the `focus` method actually does what we expect it to, even though
we are waiting for `HtmlFieldWysiwygAdapterComponent` to be mounted
before actually instantiating the editor itself.

task-3073096

X-original-commit: 7e14e2a9c055f5b30b7510ffad994fa10196e34d
Part-of: odoo/odoo#106622
2022-11-28 13:20:41 +01:00
niyasraphy eb52fb3ddb [FIX] hr: disable launch plan button on warning
closes odoo/odoo#106618

X-original-commit: 19cef78284bbf85810bdf183e4462e35da902e3a
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-11-28 08:22:23 +01:00
Florent de Labarre 45b2017004 [FIX] website_crm : impossible to add a crm form
In large database with lot of user, the browser don't respond.

closes odoo/odoo#106640

X-original-commit: 0f597b3a9c4110d2984000c21564cc95e61491c4
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-28 00:25:44 +01:00
Guillaume (gdi) 63c66dbf5c [FIX] website: prevent carousel indicators errors
In this commit [1] (merged in 16.0) a bugfix has been made in the
`removeSlide` function but this one should have been applied on all
supported versions because the bug it fixes is present on all versions.
The bug it fixes is the following:
- Drop a carousel block on a page
- Remove the *first* slide

=> There is no active indicator.

Moreover, the bugfix made in 16.0 [1] introduces another error: when a
slide is removed from the carousel the indicators are not in a correct
state anymore.

Following the same steps with the changes of [1]:
- Drop a carousel block on a page
- Remove a slide

=> Indicators are no longer consistent with the slides so tracebacks
appear during the carousel slides. The list of indicators must have on
each element a `data-slide-to` attribute which must reflect the
position of the slide (starting with 0).

So this commit is to backport the fix from 16.0 [1] to 14.0 and to fix
the new bug that [1] introduces.

[1]: https://github.com/odoo/odoo/commit/f7055d3dbabfbe471f490bd65c2032f5251f3f37

task-3040931
opw-3051615

closes odoo/odoo#106639

X-original-commit: 212e8ce620f6eb95aeff6426e06cb29b2c06d0c1
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-26 14:02:14 +01:00
Antoine Dupuis (andu) 67a383a13d [FIX] account: Deferred income wiz - don't reconcile draft entries
When creating draft deferred entries in a reconcilable account,
we should not attempt to reconcile them, because only posted entries
can be reconciled.

closes odoo/odoo#106603

X-original-commit: edaf019eac9124cb64c0a1dce55291d40b542256
Signed-off-by: William André (wan) <wan@odoo.com>
2022-11-25 23:15:18 +01:00
Guillaume (gdi) 0b7d53b3ee [FIX] website: scroll to the next visible element
Before this commit, the buttons to scroll to the next element might not
work if the next element was invisible.
Steps to reproduce the bug fixed by this commit:

(Note that these steps are only reproducible from 15.0. We decided to
merge this fix in 14.0 to be custo-friendly)

- Install two languages on a website
- Drop a cover block (1), with a height of 100% and a scroll down button
- Drop a new block (2) only visible for language B below the block 1
- Drop a new block (3) visible for everyone below the block 2
- Save and go to the site in language A
- Click on the scroll down button

=> No scroll at all while the user expects to scroll to the block
visible to everyone (3). This commit fixes that by making the user
scroll down to see the next visible element.

opw-2967706

closes odoo/odoo#106477

X-original-commit: 076d7ac7795f86d48b532b6c2a1ff76e4503604e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-11-25 20:54:51 +01:00
Romain Derie 999da9c285 [FIX] website: prevent crash if unexpected cookies bar cookie value
With commit [1] we refactored the cookies bar to let the user decide if
he wants to accept the cookies (and/or only part of it).
Before that commit, the `website_cookies_bar` cookie could only hold
`true` as value, which now is holding an object like
`{"required": true, "optional": false}`.

This creates an issue if a user is coming from a previous version with
`true` as cookie value because since the refactoring it will crash both
in JS and PY because `in` instruction with a boolean value will fail in
both languages.

The decision taken here is simply to remove the cookie if we face such a
case so the user can decide again what he wants (since there is more
choices now).
It also means that we won't be holding an outdated value in the cookie
any longer.

[1]: https://github.com/odoo/odoo/commit/2cbda6c98ee947cea1d06c09880eee8c758304a8

opw-3074303

closes odoo/odoo#106621

X-original-commit: 22392755ed4c504e6ba2a5a9c9eb6643f2c95994
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-11-25 19:52:05 +01:00
amdi-odoo 57c8e7face [FIX] web: prevents not dirty forms saving
Purpose
=======
Prevents auto save of not dirty forms with
text fields on page reload and tab/browser closing.

Specifications
==============
The text field default value is making Odoo consider
the form as dirty even when it's not which triggers
auto saving for not dirty forms.

Change the text field widget setDirty condition to
prevent considering empty textarea string dirty.
Typically, if the previous value was false, false and
empty string should be considered as the same value.

Task-3031570

closes odoo/odoo#106619

X-original-commit: 787ef58dd3f91f829509f738ee40c8764c403757
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-25 19:52:02 +01:00
Walid HANNICHE (waha) 7214345b25 [FIX] web: adding toggle to view with studio
Steps to reproduce:
- edit RFQ model with studio
- add a toggle widget to the product list
- activate/deactivate the toggle multiple times on different products

Bug:
sometimes the element on the widget is undefined when trying to rerender

Fix:
check the element is defined before trying to render it

opw-3013024

closes odoo/odoo#106614

X-original-commit: 1b09a6314dbce9363f4785c670033f41846359ad
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2022-11-25 19:51:59 +01:00
Shawcker a3e9c525f5 [FIX] account: qr_code_urls bug in report invoice template
To reproduce:

1) activate qr code on invoices
2) print an invoice with a qr code
3) print a followup letter, and attach the printed invoice

-> error due to missing 'qr_code_urls' variable in invoice template

This can happen with any report calling this template, thus we decided to set the qr_code_urls
inside the `report_invoice_document` template directly, so we never need to set it again in _get_report_values()
This allows to remove the following report classes (done in master due to stable policy)
- `ReportInvoiceWithoutPayment`
- `ReportInvoiceWithPayment`
- `PosInvoiceReport` (not even used anywhere)

closes odoo/odoo#106605

X-original-commit: a87460bdb82b7b2ab88f397f3506d0f380d86cfd
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2022-11-25 19:51:57 +01:00
William Henrotin 9ee9be3f4d [PERF] mrp,stock,purchase: sql improvement
First correction: replace call to `read_group` to `_read_group` in order
to avoid useless joints on table product_template and ir_translation
when the grouping key is a Many2One.

Second correction: add an index on workorder's `state` field. The
get_conflicted_workorder_ids() method search for ready workorders that
are in conflict relate to their planning. The state value is searched to
many times to not index it

closes odoo/odoo#106582

Task: 2852423
X-original-commit: b5019eec76845316e554f2dd11a6d8bbf6fea433
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-25 18:56:02 +01:00
Hubert Van de Walle (huvw) e23f0e1125 [FIX] web: kanban: add a onPagerUpdate callback
Use case:
in the reconciliation widget, we need to know when the pager
is updated before the next render because we need to select the
appropriate id to use.

cf the following PR: https://github.com/odoo/enterprise/pull/33631

opw-3031131

closes odoo/odoo#106581

X-original-commit: 19523b511d54278613a3d3e7389a51665dcc3fc1
Related: odoo/enterprise#34408
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2022-11-25 18:55:54 +01:00
niyasraphy 4e1493fb72 [IMP] base: show knowledge and social module in community
Do like other enterprise modules in Odoo and display missing main applications
from enterprise in community: social and knowledge.

SPECIFICATIONS

Create `ir.module.module` records for knowledge, social and appointment apps
in Odoo Community, so that users searching for those apps can see them in the
correct category with the correct icon. They can then be redirected to Odoo
website for more information about the module or an upgrade plan to use the
enterprise version.

Knowledge
  * create the record
  * use the module_category_productivity category

Appointment
  * update the record to use the new icon
  * use the module_category_marketing category (instead of sales)

Social
  * create the record
  * use the module_category_marketing category

Task-3054412

closes odoo/odoo#106580

X-original-commit: 9ada5587552d50ba4731a2401d4c18589f1d59a5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-25 18:55:52 +01:00
Florent de Labarre ebc118ee19 [FIX] loyalty : don't raise if user have not access to all reward
Before this commit it is possible to archive a product if the current user have no access to all reward (multi company rules).

closes odoo/odoo#106574

X-original-commit: 5bafee8d0479367fd25b2fa2daefd4374ab38211
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-25 18:55:49 +01:00
Alexandre Kühn e888424db4 [FIX] mail: open livechat session page in non-debug
The session page could not be open in non-debug
due to create_date being restricted to debug.
This field is required for ordering of records.

There was no reason to restrict to just have it
only in debug, so we just make it available at
any time.

closes odoo/odoo#106573

X-original-commit: 322132581bf7d289943021c55940e97843ddb3a0
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-11-25 18:55:42 +01:00
niyasraphy 9b603054ed [FIX] purchase_requisition: fix singleton error
Activate Product variants and create a new products with attributes Legs, Size and color.

Now enable Variant Grid Entry and Purchase Agreements from purchase settings and now create a Blanket Order from Purchase -> Orders -> Blanket Orders with any products from above created variants.

Confirm the created blanked order and click on New Quotation, now a new RFQ will be created, and click on add an item button and select the product we have created before, now Choose Product Variants matrix will be opened. Enter some random quantities in multiple lines and click on confirm button.

Exception will be raised

closes odoo/odoo#106572

X-original-commit: ca94ace181675b6e150c0f7486de9495198dc8e8
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-11-25 18:55:40 +01:00
Jigar Vaghela 82c1443254 [IMP] mrp,mrp_*,repair: MRP back to basics 6
mrp
===
- no time has been recorded on operations then give warning with apply button

- do not allow to mass edit UOM in any manufacturing state

- set value of lot/serial from MO and set read only on unbuild from MO

- remove "archive operation" icon

repair
======
Currently it is not possible to select a return on a repair order unless save it first. so after this commit user can able to select it without save it.
only show picking related to selected product

closes odoo/odoo#106571

Task: 2845380
X-original-commit: dd60647ce41547ecd00bbde45ddf564a7ada91c7
Related: odoo/enterprise#34403
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-11-25 18:55:35 +01:00
Odoo's Mergebot 34fabe5469 [FW][FIX] web,event,mail,crm: fix form views
Purpose
=======
Fix the inline input fields which width seems broken
because of the new always edit mode.

Specifications
===========
Web :
Introduce new css classes to be added to the
input fields in order to constraint their width and avoid
white gaps in forms.

Event :
Limit the size of the confirmed attendees input
field in the event form and event type form to
display the confirmed attendees message in one line.
When using the debug mode, in the event templates,
inline the Register Button with its checkbox to avoid
line breaks.

Mail :
Limit the size of the delay count input
field in the activity type form and restore the
inline display of the schedule message to
avoid unnecessary white gaps.

CRM :
Fix the leads generation form inlined inputs
display by reducing the inputs width to match
their content display.
Fix the lead form view to align the expected
revenue with the probability for better UI.
Fix the geolocation field and send email button
of the Assigned Partner form tab by restoring
their inline property. Because of the form
grid layout, nested groups had to be used to
correctly restore the display. Alternative solutions
modify the DOM too much, which could lead to more
xpath and inheritance issues.

Task-2996467

closes odoo/odoo#106570

See: odoo/enterprise#32460
Forward-port-of: odoo/odoo#102546
Related: odoo/enterprise#34402
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-11-25 18:55:30 +01:00
amdi-odoo 7747b9e2ba [FIX] crm: fix input display
Purpose
=======
Fix the inline input fields which
width seems broken because of the new
always edit mode.

Specifications
==============
Fix the leads generation form inlined inputs
display by reducing the inputs width to match
their content display.

Fix the lead form view to align the expected
revenue with the probability for better UI.

Fix the geolocation field and send email button
of the Assigned Partner form tab by restoring
their inline property. Because of the form
grid layout, nested groups had to be used to
correctly restore the display. Alternative solutions
modify the DOM too much, which could lead to more
xpath and inheritance issues.

Task-2996467

X-original-commit: 8edd4c96ddd1fc48ea0a1b6607233f018b4cf52a
Part-of: odoo/odoo#106570
2022-11-25 18:55:29 +01:00
amdi-odoo 525d3365ed [FIX] mail: fix input display
Purpose
=======
Fix the inline input fields which
width seems broken because of the new
always edit mode.

Specifications
==============
Limit the size of the delay count input
field in the activity type form and restore
the inline display of the schedule message
to avoid unnecessary white gaps.

Task-2996467

X-original-commit: 89847a8c79fb219256364838eabbbfc14b305579
Part-of: odoo/odoo#106570
2022-11-25 18:55:29 +01:00