Commit Graph
154901 Commits
Author SHA1 Message Date
William Braeckman ee9a282c19 [FIX] web: fix file upload service event listeners
The event listeners were added to the upload object instead of the xhr
object making them being called before they were supposed to.

closes odoo/odoo#102061

X-original-commit: 804467d7b0a583ab36a47212d482b41d29ca2203
Related: odoo/enterprise#32247
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 17:01:29 +02:00
Louis Wicket (wil) 9cc35e276d [IMP] mail: move code from components to models (ComposerTextInput)
+ Create ComposerTextInputView model
+ Replace uses of useRef with useRefToModel
+ Replace use of useUpdate with useUpdateToModel
+ Remove dead code (ComposerTextInput._isEmpty)

Task-3001200.

closes odoo/odoo#101707

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-10-04 17:01:26 +02:00
Arnold Moyaux 35023260ee [FIX] stock: warehouse demo name in data
San Francisco is in data since commit 33950bfdc3
However the task aims to clear demo data but warehouse0 is the default
warehouse in data and should not have a demo name

closes odoo/odoo#101305

X-original-commit: 0fd86c9ab1bbd237b3c7cb3c22b3362612142993
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-10-04 17:01:21 +02:00
svs-odoo 61bc8347eb [REF] stock: convert stock_orderpoint_list to OWL
X-original-commit: 262366c693ffdb5b9d4bc3c7bef293f52bd6a344
Part-of: odoo/odoo#101305
2022-10-04 17:01:21 +02:00
Arnold Moyaux 989c6df74d [REF] stock: counted qty, forecast, json stock widgets to owl
This pr follow the framework refactoring and translate the widgets
of stock module to wowl.

CountedQuantityWidgetField needs to add an upper listener on input since
the function onChange and onInput of `useInputField` are not overidable.

Json fields had their template in the json send from the server. With
wowl, the template needs to be declare before the setup. So a new wiget
is create for each template and those widgets extends the
a common component that put the json content in the props.

co-author svs-odoo <svs@odoo.com>

X-original-commit: 350a7a0d6f4816ee75676b80a9a5b9769bf80fe6
Part-of: odoo/odoo#101305
2022-10-04 17:01:21 +02:00
Arthur Detroux (ard)andqsm-odoo 84f6010fc1 [FIX] mass_mailing, *: fix options conflicts between modules
*: web_editor, website

Prior to this commit, the template structure for declaring the snippet
options used in a specific context (website, mass_mailing, ...) made it
hard to easily modify SnippetOptions defined in web_editor.

Indeed, the structure was as below
```xml
<template>
    <t t-call="web_editor.snippet_options" />
    ... Additional Options ...
</template>
```
If someone wanted to alter the behaviour of an option from web_editor
for their module, they had 2 solutions

- To extract that option inside another template, extend that template
inside their own module, remove its call from web_editor and instead
call manually the option inside each module (preferred method)

- To impact the web_editor template directly with an extension instead
of a new primary template or override JS options using include or
replacing an option inside the registry.

The second solution was often used but created extra code to make sure
that other modules were not impacted... and it was often not properly
done. For example:

- [1] and [2] introduced javascript code inside the web_editor options
  and isolating it by checking if they are in fact, inside mass_mailing.

- [3] adds code in mass_mailing mentioning JS classes of website, and
  actually broke parallax for website (after [5]).

- [4] broke the image transform option for website (after [5]).

- [6] added some shapes for mass mailing images but ended up adding them
  for the website builder too.

- [7] created different images options for mass_mailing... but ended up
  impacting website options too. Half of those can actually either be
  put in web_editor to improve everything or just in mass_mailing to not
  break the website.

- ...

This commit tries to fix everything "the right way" in master (and will
be backported for the recent 16.0). Other stable fixes will need to be
made to restore the website options in a stable way.

To fix that, this commit changes the structure to
```xml
<template inherit_id="web_editor.snippet_options" primary="True">
    <xpath ...>
        ... Change existing options ...
    </xpath>
    <xpath expr="." position="inside">
        ... Additional options ...
    </xpath>
</template>
```
This allows each module to modify the existing web_editor templates
without impacting it and each other. They can even change the JS
behaviour by using an XPath to replace the data-js of an option, and
changing it to their own extended version of the JS option.

[1]: https://github.com/odoo/odoo/commit/f296992317e96562c66bd7ad59a5080d6c551ed5#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R134-R138
[2]: https://github.com/odoo/odoo/commit/cd403480f90cf7103651f3be818a14b06d3c73ca#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R175
[3]: https://github.com/odoo/odoo/commit/e9237ae8004502a3071e8ceb132d9dac11fe00b3#diff-df5e4ff426027c53ebe6e25c25820fb92237c17a036f6202a93e5ca681ec8c16R372
[4]: https://github.com/odoo/odoo/commit/ff422df49201be6ed7baa11ef3deb5b9a41042a7
[5]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b
[6]: https://github.com/odoo/odoo/commit/24a4c7f897d4db6bdf0f3cbfc91a3ce7351241a2
[7]: https://github.com/odoo/odoo/commit/d0c2d8e9a1436a8eaf263797c790329f81d7615b

closes odoo/odoo#99850

Related: odoo/design-themes#597
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
2022-10-04 17:01:17 +02:00
MerlinGuillaume eeecb6f7c0 [FIX] resource: show planning resource in its timezone
Work hours in a planning do not respect the timezone

Steps to reproduce:
1. Set your computer timezone to 'America/New_York'
2. Install Manufacturing
3. Go to Settings > Manufacturing > Operations and enable Work Orders
4. Go to Settings > Technical > Resource > Working Times and open
   'Standard 40 hours/week' (San Francisco)
5. Edit the timezone to 'America/New_York'
6. Go to Manufacturing > Planning > Planning by Workcenter and trigger
   the day view
7. The work hours are not correct as they do not respect the timezone

Solution:
Add the timezone of the resource's calendar when computing
unavailabilities

opw-2903591

closes odoo/odoo#102066

X-original-commit: c7ac0ec29d69abdd5eda8887b6ec194db53419fd
Related: odoo/enterprise#32250
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-10-04 16:01:19 +02:00
William Braeckman cd14193919 [FIX] loyalty: make it possible to import coupons etc
TaskId-2991207

closes odoo/odoo#102062

X-original-commit: d4a92b112d0554a2624f7768feb7d54e0484469f
Related: odoo/enterprise#32249
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 16:01:13 +02:00
Antoine Vandevenne (anv) aab9d987f0 [FIX] website_sale: prevent users from modifying paid carts
Bug: Users are able to modify their eCommerce cart after it has been
paid when they fail to return to Odoo through the payment provider's
return route. This prevents the cart from being confirmed.

Steps to reproduce:
1. Install the payment provider Mollie and set it to test mode.
2. Go to the /shop page, add a product to the cart, and select Mollie
   for the payment.
3. On Mollie's hosted payment page, use the card number 4111111111111111
   with the expiry date 03/30 and the secret code 123. Select 'paid' as
   the payment outcome.
4. Confirm the payment but take care not to be redirected to the
   /payment/status route. For examples, close the tab before or comment
   out https://github.com/odoo/odoo/blob/15.0/addons/payment_mollie/controllers/main.py#L38.
5. Go back to /shop/cart and modify the cart.
6. Wait up to 20 minutes for the "payment: post-process transactions"
   cron to try to confirm the cart.
7. Check the cart's chatter: the confirmation failed because the cart's
   and transaction's amounts mismatch.

Explanation: The post-processing of the transaction is responsible for
confirming the cart, but it failed to be triggered because the user did
not visit the /payment/status page. The post-processing cron takes care
of pending post-processings after 10 to 20 minutes, which is long enough
for the user to modify their cart.

Fix: Force creating a new cart as soon as the current one is paid and is
being requested by the website.

task-2995504

closes odoo/odoo#102060

X-original-commit: 5f8674621cbf5919e10e32f29b66ae171fe05993
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 16:01:08 +02:00
Walid HANNICHE (waha) 82265c52ca [FIX] tools: fix underline and italic in logged notes
Steps to reproduce:
- in any app log a note using full composer
- add styles to the text (underline, strike-through, italic)

Bug:
styles except bold are removed

Fix:
added missing styles to the whitlelist

opw-2956374

closes odoo/odoo#102056

X-original-commit: eb07ab104d5f47574e14db811108a7d0cbbbe4b2
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-10-04 16:01:06 +02:00
Pierre Verkestandwan 2762c3c387 [FIX] account: account move report date label
Change 'Invoice date' label on report according move_type

closes odoo/odoo#102005

X-original-commit: c8991f2760c1ac81ec2a64553744cef9321f2531
Signed-off-by: William André (wan) <wan@odoo.com>
Co-authored-by: wan <wan@odoo.com>
2022-10-04 14:57:02 +02:00
Olivier Dony cf9f3c6f18 [FIX] sale: multicompany fpos access
This repeats the fix from #80049, which already solved the same problem.

That `compute_sudo` was dropped by #81510 afterwards, but only in the
`sale` module.

closes odoo/odoo#99840

X-original-commit: f1d30dd3bb55b756120fa298b3b2c7d591cedbf3
Signed-off-by: Olivier Dony <odo@odoo.com>
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-10-04 14:56:54 +02:00
Arthur Detroux (ard) 74f04adf54 [IMP] website: make dynamic snippet slide from the start
Prior to this commit, the dynamic snippet would only start sliding after
the first interaction.

This commit makes it slide right away.

task-2677203

closes odoo/odoo#80128

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-04 14:56:52 +02:00
Arthur Detroux (ard) 374558390f [REF] website: review options for the dynamic snippet
Prior to this commit, the Dynamic Snippet options would modify the DOM
at places were it is not supposed to.

PR [1] aimed at making it more stable, but the changes required to make
the option conform to the framework cannot be done in stable as some
methods' signatures needed to be changed (Changing a sync function to
async).

This commit aims at making the option follow the flow of an option:

- Modify the target's DOM either on build or on a change of option
- Modify the UI either during willStart or updateUI

To do so, the methods that fetch the template data needed to be split
from the methods that creates the buttons.

The benefits of this commit are that the option is less likely to cause
race condition and errors while performing its tasks.

[1]: https://github.com/odoo/odoo/pull/82222

task-2677203

Part-of: odoo/odoo#80128
2022-10-04 14:56:51 +02:00
Arthur Detroux (ard) 093a281b75 [IMP] website_sale: add tour for snippet products
This PR added new templates and features to the dynamic snippet
products. The goal of this commit is to test these features by selecting
every newly made template, saving, and adding a product to the cart.

Another tour was added to test the functionality of the recently
viewed product filter.

task-2677203

Part-of: odoo/odoo#80128
2022-10-04 14:56:51 +02:00
Brieuc-brdandArthur Detroux e67498156c [IMP] website, website_sale: improve design of templates
This commit improves the design of dynamic products templates.
It introduces templates using multiples rows and fine tunes the
design of the other ones.
To make thumbnails work in the template selector, an extra
data-attribute can now be processed by the snippet option.

- data-thumb: it references the location of the thumbnail for a
template. If present the option will show the svg / img.
If not it will display the name of the template.

task-2677203

Part-of: odoo/odoo#80128
Co-authored-by: Arthur Detroux <ard@odoo.com>
2022-10-04 14:56:51 +02:00
Arthur Detroux (ard) fe15ba21e5 [FIX] website, *: make cta button work on debug dynamic snippet
*: website_sale

Previously, on the debug dynamic snippet, you could choose a product
filter and a template that had an add2cart button but that button
would not work.

This commit fixes that by creating a widget per card and moving the
card specific code to this widget.

task-2677203

Part-of: odoo/odoo#80128
2022-10-04 14:56:51 +02:00
Arthur Detroux (ard) d3307aaa08 [IMP] website, *: give flexibility to dynamic snippet templates
*: website_blog, website_event

Commit [1] introduced new templates. This commit's goal is to build on
that template system to provide more flexibility for designers.
It adds new data-attributes to set on the first node of a template.

- data-row-per-slide: Allows for the template to tell a dynamic snippet
carousel how many rows of cards it should display.

- data-arrow-position: Allows for the template to tell a dynamic snippet
carousel where the arrows should be positioned.
(for now just bottom, or side)

- data-extra-classes: give the template the possibility to add extra
classes to the dynamic snippet instead of just the card.

This commit also removes options to select the amount of elements
displayed on each row. This is now only changeable through templates, or
by directly editing the snippet's DOM through debug tools. This was done
to reduce the amount of options visible, so that the user just chooses
a template and it is ready to go.

[1]: https://github.com/odoo/odoo/commit/49bd79b0bdca76415780bdfa199195371c2692e5

task-2677203

Part-of: odoo/odoo#80128
2022-10-04 14:56:50 +02:00
Kevin Baptiste 5afd3607a1 [FIX] (website_)hr_recruitment: unpublished job on archive
Unpublish the job from the website when they are archived, and correct
the condition to show Archive/Unarchive on the job kanban view.

task-3001159

closes odoo/odoo#102034

X-original-commit: 653a673b980133c2304e04c93730321d9f26eebe
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 13:29:11 +02:00
Camille Spiritus 78dfa2a07d [IMP] account : cash discount: set up default accounts and configs
The early payment cash discount functionality was merged in 16.0.

This PR allows for the behavior to be as localization specific as possible.

This concerns :

The tax computation (some countries leave it untouched after the discount, some countries discount it, and Belgium has a mixed behaviour)
The account in which the cash difference resulting of the cash discount should be put.
task- 2983913
related to #99572

closes odoo/odoo#102032

X-original-commit: 591757902dcdf1e3609d9c5ae23e2b134ee8e4da
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2022-10-04 13:29:08 +02:00
Florian Charlier 740df02e35 [FIX] mass_mailing: fix kanban card joined contents
Purpose: split words with whitespace, as it's usually done.

Task-3004148

closes odoo/odoo#102021

X-original-commit: 0504aff9e4ffd731f3457126385b35f426877f56
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-04 13:29:06 +02:00
Yolann Sabaux 7a77d0a311 [FIX] sale_stock: prevent displaying vendor's info in DO
Steps to reproduce:
- Activate Dropship and multi routes
- Create a SO and select the route Dropship
- Confirm the SO
- Confirm the purchase
- Click on Customer Preview

Issue:
In the customer preview, if the customer click on the do, vendor's info will be displayed.

opw-2961884

closes odoo/odoo#102020

X-original-commit: 672a3edce29bd1e16de64c4bcc8452842d3e16d4
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2022-10-04 13:29:00 +02:00
Ahmed Khalaf (ahkh) d1b3081639 [FIX] stock: immediate transfer message alignment
This commit fixes the alignment of the message shown when validating
transfer without quantities set.

The `group` tag caused the misalignment as it created a grid class div
and aligned content into div column to the right. since the form just
displays a message and the grid is not needed the `group` tag was
removed entirely.

closes odoo/odoo#102001

X-original-commit: 1a63edc684512330ca64682ec9b626681b6a95cf
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Ahmed Khalaf  <ahkh@odoo.com>
2022-10-04 13:28:55 +02:00
Didier (did) 7ffb5a0eff [IMP] mail: reintroduce mail_template_ids in activity
Task-2998135

closes odoo/odoo#101998

X-original-commit: c00828010f1245200b30451fb25a239047986421
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-10-04 13:28:52 +02:00
Nidhi Patel 2a47e097c0 [FIX] l10n_in_edi: correct reference of tag_ids
Before this commit
==================

before this commit, it will raise the error when submitting EDI
because the tax report line does not exist and it will be removed
from this PR #99401

After this commit
=================

no error will be raised and it will get related tag_ids

closes odoo/odoo#101988

X-original-commit: 9a60822ae9227d7fa815b06cb0a26629ec075e1e
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-10-04 12:30:16 +02:00
Pierre Paridans f52486dcc4 [FIX] web: Dialog Form buttons' spacing
This commit applies the proper spacing between FormView's buttons in a
Dialog's footer.

Steps to reproduce:
- Open Notes
- Enable debug mode
- In Debug menu, open "Edit View: List"
=> dialog's buttons have no spacing

closes odoo/odoo#101974

X-original-commit: f67a8fff6c86a67ce2f6a162f1de992fe25eefbd
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-10-04 12:30:14 +02:00
Arnaud Joset 6c73b6be4e [FIX] sale: use str2bool to make sure the boolean sale.automatic_invoice is
correctly used

When a boolean ir.config.parameter is set to False,
self.env['ir.config_parameter'].sudo().get_param('parzm_key') will return
'False'. As the string is not falsy, the parameter value match as true.
This commit fix the behavior for the sale.automatic_invoice to keep coherence
with the subscription module

closes odoo/odoo#101906

X-original-commit: ade1a1f5ee00baa88347bfd151f028bd17d7f4f1
Related: odoo/enterprise#32173
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-10-04 12:29:57 +02:00
Demesmaeker 259f1fcfd3 [FIX] test_sale_product_configurator: remove edit
With the `always edit` changes, the edit button was removed. Thus, these
steps were failing and became useless anyway

closes odoo/odoo#101887

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-10-04 12:29:55 +02:00
William Braeckman 7f80831ae2 [FIX] website_sale: fix traceback on login page
auth="none" pages don't have self.env.user filled in, this throws a
traceback if you try to get the current cart.
This causes an issue when we try to fetch the cart quantity on the login
page.

closes odoo/odoo#102010

X-original-commit: d1c053158f1d306df1f5f1e9d4c81ee642a73f48
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 10:55:45 +02:00
Xavier-Do 6df3ffb81d [FIX] sale: fix test_pricelist_dates
This test is failling during nightly mainly when executed arround 23

The most likely reason for that is because of the freezetime rounding
the day and creating an error between 23 and 00.

The freezetime only wraps the create but the compute will be triggered
only after that. Adding all assertions inside the freezetime may be
enough to fix this issue.

closes odoo/odoo#101989

X-original-commit: 98693d5543e3c0b4f8f51a05e026fce8ddb77a51
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-10-04 10:55:41 +02:00
Laurent Smet 150951f61b [IMP] account_edi, l10n_*: Make the EDI engine more flexible
Add a new method `_get_move_applicability` allowing to trigger the EDI on any journal entry, using the custom functions you want.

closes odoo/odoo#101985

X-original-commit: 0e5626ca5126e6fea7fb95b694229948540764d7
Related: odoo/enterprise#32212
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2022-10-04 10:55:34 +02:00
jbw-odoo 3a96a536e7 [FIX] l10n_it_edi: fix it vat change
Manual forward port of https://github.com/odoo/odoo/pull/74064.

closes odoo/odoo#101892

Task: opw-2965529
X-original-commit: 44f5c89a48328995fb9767012c3c5b423db6f917
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2022-10-04 09:55:51 +02:00
Dossogne Bertrand 7c4da16b59 [IMP] mail, various: improve mail template usability
Allow our users to modify mail template more easily

- make the list accessible from the settings
- give them a link to update relevant views to update header/footer
- make the list and form of templates more readable
- add a description on templates, allowing to describe their usage

In order to better filter templates, a new category field is added that
is computed based on active flag, description being set and the template
having an xml ID. Master templates are active, with a description and an
xml ID.

Update master data to add description on some templates.

task-2944770

closes odoo/odoo#101730

X-original-commit: dfa867343ee8842f3f127ac62584fd471b41dde1
Related: odoo/enterprise#32079
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-04 09:55:46 +02:00
Dossogne Bertrand 218bd25fca [IMP] digest: colors following company colors
Changes the background color of the digest to follow the
company color theme the same way it has been done for
the email layout.

task-2944770

X-original-commit: 1e9db93967ee76e21dd95e7500339d1de6914fbd
Part-of: odoo/odoo#101730
2022-10-04 09:55:46 +02:00
Malay Khamar 3ed061b849 [FIX] hr_holidays: Fixed to remove supporting documents after uploaded
closes odoo/odoo#101560

X-original-commit: 72697005df46c148aa649c27430739ad0d520880
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 09:55:43 +02:00
Adrien Minne 22d35da810 [FIX] spreadsheet_dashboard_*: update dashboards
Update dashboard to latest version

closes odoo/odoo#102006

X-original-commit: 4d6fb4549d4069fc52af0ba500f91ba271e9c62b
Related: odoo/enterprise#32222
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-10-04 08:30:44 +02:00
Adrien Minne ca1998fb35 [FIX] spreadsheet: fix dashboard tests
feffe7d removed the id from the chart object at export, but this id was
used to validate the dashboard data in the test. Take the figure id
insread in the tests.

X-original-commit: 3788df2fe6e3c0b62df604a1aae89b3d81c324d4
Part-of: odoo/odoo#102006
2022-10-04 08:30:43 +02:00
Dossogne Bertrand a3313df2f0 [FIX] hr_holidays: remove default working hours on stress days
If you create stress days, the default work calendar is set to be
the company's default calendar, therefore exclude by default
every employee with a different work calendar. Since the field
is by default hidden, it is misleading, so by default no calendar
should be set.

task-2999197

closes odoo/odoo#101986

X-original-commit: 911832980786cc10bb79c7b36b2142d063917bff
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-10-04 08:30:38 +02:00
Martin Trigaux eba7ed6e9c [I18N] *: translate fr_BE based on fr
Automatically translate "avoir" into "note de crédit"

closes odoo/odoo#102002

X-original-commit: 69b141d8ec613e101b8a7050da057bfe5a74af50
Related: odoo/enterprise#32220
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-10-04 07:28:57 +02:00
Habib (ayh)andJohn Laterre 805d2c0820 [FIX] web: monetary formatter in readonly ignores currency_field in field definition
Steps to reproduce:

Select a company whose currency is USD.
Create an invoice in EUR.
Go to the "Journal Items" tab.
The amounts in the "Debit" and "Credit" columns are correct, but the currency symbol is € (invoice currency) instead of $ (company currency).

This should not happen since both of these fields have `currency_field='company_currency_id'` in their definition:
https://github.com/odoo/odoo/blob/702adc878e897461c4c9976110cee84d397ff4af/addons/account/models/account_move_line.py#L90-L99

But since those fields fulfill the conditions in `canUseFormatter`:
https://github.com/odoo/odoo/blob/702adc878e897461c4c9976110cee84d397ff4af/addons/web/static/src/views/list/list_renderer.xml#L228-L229

`currencyField` remains undifined in the `formatOptions` when going through `getFormattedValue`:
https://github.com/odoo/odoo/blob/702adc878e897461c4c9976110cee84d397ff4af/addons/web/static/src/views/list/list_renderer.js#L722-L734

Which is why the current fix looks at `options.field.currency_field` before falling back to `currency_id` when setting `currencyField`.

A test is also added to make sure the issue does not creep back in again.

closes odoo/odoo#101995

X-original-commit: a860370b8ed73c192c652b4a97ac0aa1d1c23936
Signed-off-by: Simon Genin (ges@odoo) <ges@odoo.com>
Co-authored-by: Habib (ayh) <ayh@odoo.com>
Co-authored-by: John Laterre (jol) <jol@odoo.com>
2022-10-03 21:23:03 +02:00
william 3ae786465e [FIX] account: propose values when creating new journal items
The new lines should contain the current balance, and the account of the
last 2 lines if it is the same.
* The computation of the balance was reading on `debit` and `credit`,
  leading to a cycle in the compute method. It is useless to try to read
  those fields because of `_inverse_debit_credit`
* The computation of the account was simply forgotten during the
  refactoring
Also move a constraint from `write` in a more rigorous `api.constrains`,
which revealed a bug for to find the account of payment terms of receipts.

Followup of d8d47f9ff8
task-2956509

closes odoo/odoo#101994

X-original-commit: f04f83b42bb1fbcacbb6bf92a2156ff2be1bf1b1
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-10-03 21:23:00 +02:00
william-andre df1e344391 [FIX] account: switch to refund an invoice with downpayment
If you create a Downpayment invoice from a Sale Order with a fixed
amount bigger than the amount of the SO, when you create the regular
invoice it creates a credit note but all lines are "positive" when only
the downpayment line should be.

Based the implementation existing before d8d47f9ff8
https://github.com/odoo/odoo/blob/3363e55cac2a121c29842a0b2463f940bdd866a4/addons/account/models/account_move.py#L3339

X-original-commit: 5432809bbb80c539ba11fb9aa6973669c30f5827
Part-of: odoo/odoo#101994
2022-10-03 21:23:00 +02:00
william b8729a7e60 [FIX] account: fix display of complex taxes in the tax detail widget
When using complex sub-totals, the total sum of taxes was always removed
from the total amount.

________________________________________________________________________
This also allows more flexibility for ordering tax groups.
Before cd6c33575b, it was possible to have this:
* Tax Exempt 2% (preceeding subtotal "Discounted")
* VAT 21% (no preceeding subtotal, take default)
* Reapply 2% (preceeding subtotal "Reapply")

The value for groups without preceeding subtotals was always 0 and
* before the commit mentionned above, it was possible to reach 0 too for
  the groups with a preceeding subtotal
* but after +1 was added making it impossible from the view

We now always take the group's order (or the smallest one for groups
without a preceeding subtotal)

Followup on d8d47f9ff8
task-2956509

X-original-commit: d3471336b85f17fe274acf6a01b71c5d1483e94a
Part-of: odoo/odoo#101994
2022-10-03 21:22:59 +02:00
william 5fddd22edd [FIX] account: display invoice lines in kanban
The display_type is always filled now, valid values for non display-only
purpose are `product`, `payment_term`, `tax` or `cogs`

Follwup on d8d47f9ff8
task-2956509

X-original-commit: 7528c07d0f1ea6c4c8872ec66a5609b264300908
Part-of: odoo/odoo#101994
2022-10-03 21:22:58 +02:00
Romain Derie c3e7fa0e04 [IMP] web_unsplash: allow to configure app id in settings
Since it was introduced with [1], only the key could be added in the
settings, but not the app id.

Still, both are needed to actually use unsplash, otherwise it won't
work and the media dialog will keep showing the crendentials part, where
one can also add its credentials.

Basically, without the app id field, the access key field was useless in
the settings.

[1]: https://github.com/odoo/enterprise/commit/88746157ca16af4033576361dddae0b694aca70d

task-3004144

closes odoo/odoo#102000

X-original-commit: fa45712eecd2a0fbf6236f611ddffd0b5e81dc31
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-03 20:20:07 +02:00
Romain Derie ac09392fba [FIX] web_unsplash: keep using the util method, not ICP get_param
The util method to get the key was removed with [1] as no more useful in
our codebase. But it was still actually needed for internal reason [2].

This commit restores that.

[1]: https://github.com/odoo/odoo/commit/e10493711879c7f0cc8832db3f1936c622ea605c
[2]: https://github.com/odoo/internal/commit/de3532b3640793049d356c659df0497edd9a7fc6

closes odoo/odoo#101999

X-original-commit: a48692d105dc2321b1799f5ef1013c022efbb7c3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-03 20:20:04 +02:00
Jérémy Hennecart (jeh) bd665c1d5b [FIX] website: add the search params intro the editedObjectPath
In some place the search params are mandatory in the route.
We now add the search and hash params to the editedObjectPath to
avoid having an error when trying to go back.

task-2993826

closes odoo/odoo#101996

X-original-commit: 2bed20392084bcbec2683939e5659b03e3ea7acf
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-10-03 20:20:01 +02:00
xO-Tx b0484d64c4 [FIX] website, *: fix website content kanban views
*: website_blog, website_forum, website_hr_recruitment, website_sale,
   website_slides

The goal of this commit is to set the missing 'view_ids' on some
actions linked to website 'pages' tree/kanban views.

Linking a form view to actions will make the 'Edit' & 'Configuration'
buttons work correctly (on kanban record dropdown for 'hr.job' &
'slide.channel').

The website url on "product pages" kanban should start on a new line
after this commit too.

Related to task-2889981

closes odoo/odoo#101814

X-original-commit: a61e730cd9f92b2c343646f33f3e59cef518c3bf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-10-03 20:19:53 +02:00
xO-Tx 0d6ca33f5d [FIX] website, *: add multi-edit for jobs pages
*: website_hr_recruitment

After [1], the multi-edit was added on the pages list views not using it
except 'hr.job' records since editing the 'Department' field leads to a
traceback.

The goal of this commit is to fix this issue by setting an invisible
'company_id' (to be available in domains since necessary to change
'Department') and add multi-edit on the view.

The 'home' icon for 'home page' records on list view should be hidden
after this commit (on multi edit mode) to edit the fields correctly.

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

Related to task-2889981

X-original-commit: d101be46a2a9c392e2d63f491fcc5ccec2d65c78
Part-of: odoo/odoo#101814
2022-10-03 20:19:53 +02:00
Adrien Schoffeniels 66bf0516ee [FIX] survey: fix sample surveys form view
Purpose:
--------
When opening one of the sample surveys, the name of the survey was not
displayed entirely, and deleting the sample survey didn't do anything.

Specs:
------
Removed "target" parameter of the show sample action which was set to
"main", which clears the breadcrumbs. Since the breadcrumbs were cleared,
when opening a sample, one could not go back to the kanban view and was
stuck in the form view when deleting the sample.

Also removed the "form_view_initial_mode" which was set to "edit", which
is not required anymore since the introduction of the always edit mode.

Task-3004137

closes odoo/odoo#101976

X-original-commit: 519cabbe0202c94027e044dd1b598f1539320e27
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-10-03 19:22:55 +02:00