Commit Graph
147686 Commits
Author SHA1 Message Date
Andrea Grazioso (agr-odoo) 0744aaf6f7 [FIX] point_of_sale: cogs entries wrong currency conversion
1) Have Accounting and POS.
2) Activate multi-currencies (EUR and USD available).
3) Main currency should be USD, set a rate to EUR (i.e. 0.5).
4) Activate automated inventory valuation [CATEG].
5) Create storable product [TEST]:
  - Storable, Category [CATEG]
  - with public price $10 and cost $1
  - available in POS
  - no taxes needed
6) Have a POS in EUR (Pricelists, Journal, Payment methods +
their journal in EUR).
7) Sell [TEST] (it costs ($10/2) = 5EUR)
8) Close the session and post entries.

Result: in the journal Items, some of the COGS entries (110300
Stock Interim (Delivered) and 600000 Expenses) are multiplied by
the ratio between $ and EUR. This occur because the system attempts to
convert an amount which has been created in company currency.

opw-2613739

closes odoo/odoo#78227

X-original-commit: 91d6a81fef551a03e6af94c356b7e943ef53c473
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2021-10-13 18:24:25 +00:00
Rémy Voet (ryv) b33983d532 [REF] stock*,mrp*: clean setUp vs setUpClass
In a lot of test class, we use `setUp` instead of
`setUpClass`. `setUp` is execute for each test method and `setUpClass`
will be execute only once by Class (and use savepoint + rollback).

Then change setUp into setUpClass reduce the time to make all tests
and avoid to repeat this error for the future.

closes odoo/odoo#78082

Related: odoo/enterprise#21563
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-13 18:24:16 +00:00
Yenthe Van Ginneken c3f593db78 [FIX] account: allow overriding portal domain
Before this commit the only way to modify the domain is to completely override portal_my_invoices.
Since this function is so big this is not clean/easy to do.
By creating a separate function we can simply override it and we can reuse the function on two places.

closes odoo/odoo#77446

X-original-commit: b7effc442cd7ff47e00718adf5b1af43e9f326ee
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
2021-10-13 18:24:02 +00:00
Nicolas (vin) 66b721236c [IMP] account: Log changes on bank statements
With bank synchronization, having information about changes done by
the user on the bank statements can be useful when looking into issues.

We'll now log changes in the starting/ending balance as well as the
state of the statement to keep better track of what is happening on
the statements.

Task id #2647224

closes odoo/odoo#78264

X-original-commit: 3f2379347dae2482669aded034f3a5249aececa5
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-10-13 16:33:57 +00:00
baa dfd75f39f8 [FIX] l10n_ae: missing if statement to avoid executing UAE related code when COA is not UAE
closes odoo/odoo#78303

X-original-commit: db21ea740a49dd98004bd75ad9fc7412e5686c0e
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2021-10-13 15:23:01 +00:00
Kevin Baptiste 5437dbf5dc [FIX] hr: fix avatar generation on employee rename
It was not possible to rename an employee with an existing image
profile, as it was trying to assign the size of the avatar (coming from
the webclient) as the avatar itself.

closes odoo/odoo#78299

Taskid: 2660773
X-original-commit: 425ddb217664ba3fdae9e8c1527317fee0fe9368
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-10-13 15:22:56 +00:00
Bruno Boi b710b6d323 [FIX] web: missing test for usePosition hook
The commit a27bbda37f1ad4 did not add a unit test.

Here it is.

closes odoo/odoo#78297

X-original-commit: e3a32191b6b9411abaf4c15550e537c666d615bd
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-13 12:31:02 +00:00
William Braeckman 7529e4a15d [FIX] hr_holidays: fix displaying negative allocations
When the attendance app is installed and the extra hours option is
enabled, it could happend that we have an allocation with negative
virtual_remaining_leaves, however it does not make sense to display it
to the user.
This commit filters out that possibility from showing on the dashboard.
This commit also fixes a display mismatch between extra hours and other
time off types.

TaskId-2655689

closes odoo/odoo#78295

X-original-commit: c943b55237447ad58a994602e58702c952ac019d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
2021-10-13 12:30:57 +00:00
ijas ahammed 4542e1f540 [FIX] website_crm_partner_assign: removes traceback while opening opportunity
While we try to open an opportunity from front-end page it will throws a
traceback. In this commit we have fixed the traceback, the traceback occured
because while rendering the template `portal_my_opportunity` we were using
an invalid field `res_model_id` for searching the corresponding model activity
types, in this verssion we have `res_model` field instead of `res_model_id` thus
we have updated this field instead of using the invalid field which doesnt
exist.

TaskID-2443894

closes odoo/odoo#78288

X-original-commit: 25d5d7bbfbe4ce054ebd3494a04e028498dbd441
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-13 11:18:50 +00:00
qsm-odoo 05765de195 [FIX] website: properly re-show the header when scrolling to the top
Sometimes, when using the "standard affixed" header effect, when
scrolling to the top, the header was kept hidden and left a blank space.

This happened in fact systematically when scrolling to the top very
fast. Indeed, in that case, the code went through the header update
only once and was not able to go from state 3 (page scrolled header
visible) to state 1 (page not scrolled header visible) without going
through state 2 (page scrolled header invisible) and you thus ended
with a mix of state 1 and 2: page not scrolled and header invisible).

Closes https://github.com/odoo/odoo/issues/71449

closes odoo/odoo#78268

X-original-commit: 20648ef2134672587c25fd3c7c79ed3825728b38
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-13 10:02:38 +00:00
Sébastien Mottet (oms) 667a00a029 [FIX] website: use base-1 as default palette for configurator
When using the configurator the user can upload its logo to
generate a color palette. In this case we select the base-1
palette as default palette instead of the theme's default palette.
Doing so avoids the potential customizations the theme palette
may introduces.

task-2665885

closes odoo/odoo#78251

X-original-commit: 50019c8f68b89968615f87c365095c94caeef46c
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-13 08:41:06 +00:00
Bruno Boi e8bbc5cd44 [FIX] web: pivot style in right-to-left
Headers of columns and rows are not properly aligned on RTL direction.

After this commit, they will be.

closes odoo/odoo#78261

X-original-commit: 2fb992d3ced438fd012d7702bdfbe23cce6000a6
Related: odoo/enterprise#21645
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-13 06:03:58 +00:00
Bruno BoiandSam Degueldre 3594b8cebd [FIX] web: fix crash when dropdown is unmounted quickly
Previously, when quickly mounting then unmounting a dropdown, a
traceback was shown. This is because the usePosition hook registered
listeners that were throttled/debounced, which would be called after the
component was already unmounted, causing the crash.

This commit fixes that by making cancelable the debounce timing util
and by introducing a new cancelable timing util: throttleForAnimation.
`debounce` and `throttleForAnimation` could be canceled i.e. when
a component is unmounted.

`throttleForAnimation` is used to replace throttle to avoid the popper's
scroll position not staying perfectly in sync with the page but instead
being slightly jittery, it effectively throttles a given function to the
display's refresh rate.

Also, the `throttle` util is kept unmodified but marked as deprecated.
Its implementation does not properly match its name, and we chose
to leave it as is because some code might already use it.

X-original-commit: a27bbda37f1ad444023cb1aae56675ac6c263cb2
Part-of: odoo/odoo#78261
Co-authored-by: Sam Degueldre <sad@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2021-10-13 06:03:58 +00:00
Bruno Boi 44c6946c7c [FIX] web: dropdown menus should not overflow viewport
Before this commit:
Dropdowns menus were overriding the positioning hook direction flip
order in order to always stay in the same axis.
But a dropdown menu has as its maximum height 70% of the viewport.
These two "rules" aren't enough to ensure the whole spectrum of
possibilities will always make the menus entirely visible on screen.
We could have chose a correctier formula (50vh - toggler height), but
this would have led to sadly short dropdown menus in many cases,
so we chose the following alternative...

After this commit:
Dropdown components are no longer overriding the positioning hook
direction flipping order option.
That way, the flipping axis is no longer enforced and therefore the
menus will have a greater spectrum of possibilities to reposition.
This has shown us that it fixes the visibility issue of the menus.
E.g. when the menu flips to a right-middle position it could take up to
100vh and still get displayed entirely.

The position hook directionFlipOrder option has also been made
unavailable as there is no use case anymore.

X-original-commit: b768d771018843d7bfa8aab2e1b2e624d088e3f6
Part-of: odoo/odoo#78261
2021-10-13 06:03:58 +00:00
Bruno Boi 9c0d5228d4 [REV] web: reintroduce mobile dropdown positioning
Revert "[FIX] web: dropdown: avoid positioning in mobile"
This reverts commit 1271ef80fafa4438271af0919dcca229aa20bf81.

Revert Reason:
A better alternative fix to the original
issue has been found. See preceding commit.

X-original-commit: 384169fb1b5874fd670f07fb2a6b1aca449f56c9
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
Bruno Boi 97f90b03cf [FIX] web: usePosition computations on small screens
To compute a positioning, the usePosition hook uses as the default container
the <html/> element... but in the positioning computations it is assumed
that the container is scrollable which is not the case for small screens
when web_enterprise module is installed, as its webclient_layout.scss
applies rules to make sure only the main content is scrollable.

When the <html/> element is not scrollable, it can be scrolled out of the
viewport, which is problematic as the positioning computations are based
on a fixed positionment strategy.

The way we chose to fix this is to account the scrollTop position of the
container only if the container is the <html/> node.
If so, further computations will now take into account the amount of
scrolling the <html/> node has, and thus will be correct.

See https://developer.mozilla.org/docs/Web/API/Element/scrollTop fur
further understanding.

X-original-commit: a050094cdaa5dd6b76c3f10fb49d3a9c0813425a
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
Bruno Boi 2bd8bb4d7b [FIX] web: align pivot row groupby menus to right
The row groupby menus are always aligned on the left, but when a
multiple levels of groupby has been selected, it feels weird and
counterintuitive to see them aligned on the left whereas the row
labels are right aligned.

This commit makes sure that the alignment is coherent between the menu
and the row labels.

X-original-commit: b11b760365c45409b8ea10dee2a58c2e677e9d61
Part-of: odoo/odoo#78261
2021-10-13 06:03:57 +00:00
JF Aubert 92049fc165 [FIX] mrp,mrp_workorder: Fix (+) generate serial number button
The generate serial number button uses the stock.lot.serial sequence by default
(default value for name of stock.production.lot)
Serial Mass Produce (and other parts) allow to generate serial numbers
starting from a user supplied initial value.
This fix makes the button generate the next serial number
according to the last generated.

task 2647238

closes odoo/odoo#78258

X-original-commit: b80259dff3aaafb9d11af9d936f5106bdf5ed781
Related: odoo/enterprise#21641
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Jean-François Aubert <ajf-odoo@users.noreply.github.com>
2021-10-13 06:03:37 +00:00
Didier (did) 2e2b49931f [FIX] mail: add the ability to invite on mobile
Before this commit, it was impossible for a user to invite people to a channel
or a group DM.
This commit add the invite button on the chat windows header only on mobile.

Part of task-2634175

closes odoo/odoo#78267

X-original-commit: 56ab9ffea28dd5f22a74ba269cbd5552c42953e3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2021-10-12 19:17:43 +00:00
william-andre b57b884430 [FIX] account: allow to edit some fields with Invoicing only
The only fields added in
`//page[@name='invoicing']//group[@name='accounting']`
are `unspsc_code_id`, `intrastat_id` and `email_template_id`, which
should all be available with only the rights for invoicing.

opw-2665030

closes odoo/odoo#78260

X-original-commit: 1f69445f0a7ed02030f3f16f126e34b0d507ed80
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-12 18:11:56 +00:00
lejeune quentin d919b96b7a [FIX] point_of_sale: Hold library firmware-brcm80211 for IoT build
The new version of firmware-brcm80211 20190114-2+rpt3 are unstable
when we use it with the IoT.

So we need to keep the original version of the last official version
of raspberry-pi OS 20190114-1+rpt11

closes odoo/odoo#78194

X-original-commit: 1bfb97caade7a92ff6521358b6b2f5caa6918208
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-10-12 18:11:51 +00:00
lejeune quentin 74e185cfe1 [IMP] point_of_sale: Authorizes the uses of POS in HTTPS with direct devices
To avoid the use of certificates when using direct devices
POS was redirected in HTTP

With new Chrome or Edge security measures this is no longer possible.

We add here the possibility to choose to redirect
the POS in https by adding a specific key in the parameters

closes odoo/odoo#78247

X-original-commit: 9cecb3bdbf5679b6d1d18dc2a250c86118bca6ce
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2021-10-12 17:03:41 +00:00
Aurélien Warnon 524058919d [FIX] survey: avoid returning empty navigation template
This commit fixes the survey navigation rendering by always returning valid
HTML even when no buttons are displayed.

Indeed, in some cases, such as on the "thank you" page, we don't display any
buttons, meaning that the returned template will be an empty string, which in
turn prevents the re-rendering of this part of the page in the JS part of the
survey form management.

To avoid this issue, we simply add an enclosing div tag into the template so
that the template always returns valid HTML no matter the use case.

Task-2642787

closes odoo/odoo#78250

X-original-commit: 5504f9a1c13cee053f3142ad8eeb98d75311ee78
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: awa-odoo <awa-odoo@users.noreply.github.com>
2021-10-12 15:54:43 +00:00
Arthur (ard) 9b47e248de [FIX] website: prevent snippet drop in product_catalog
Before this commit, a user would be able to drop pretty much any
snippet inside the product_catalog (pricelist) snippet.
This was not ideal as the snippet wasn't designed to receive
any other snippets inside of it.

With this commit, the configuration of the snippet is closer
to snippets such as timeline, allowing lines to be moved around
without allowing snippets to be dropped inside it.

task-2655171

closes odoo/odoo#78185

X-original-commit: 086bef8ffaff29a12836a36baed6cfb0ffea7da0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-12 14:11:43 +00:00
Sébastien Mottet (oms) e67463fbf1 [FIX] web: use full width for the onboarding banner
The owl OnboardingBanner component should be full width.

closes odoo/odoo#78228

X-original-commit: 3a0552a3a4e42bed8580715f097fad15f3e1e59f
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-12 12:57:04 +00:00
Xavier Morel cb3b3f54ca [FIX] auth_signup: bulk signup_url generation
When calling `_get_signup_url_for_action` on more than one partner,
because the `url` input parameter was re-used for the actual signup
URL before assigning to the partners map (in
559bdc976e), from the second iteration
onwards the signup URL will almost certainly get misgenerated to
redirect to the previous signup URL (accumulating).

As `signup_url` is not normally accessed in bulk this should not
usually be an issue.

Reported by Andreas Brückl

closes odoo/odoo#78223

X-original-commit: 4d9b23f60087e0e8ffcb85498f39324854f50cb8
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-12 12:56:59 +00:00
oco-odoo 26c2c705e4 [FIX] account: carryover lines: improve view
- allow editing the date of a carryover line manually

- don't display the tax report line the carryover line is linked to anymore, as the user goes through this line to open the carryover line anyway, and it shouldn't be editable.

- also remove a domain that made no sense on carryover lines: pointing to a related field depending on the field defining the domain

Manual forward-port of https://github.com/odoo/odoo/pull/77718

closes odoo/odoo#78213

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-10-12 12:56:55 +00:00
oco-odoo 394e24396b [IMP] account: foreign VAT fiscal positions: add a button to open the list of l10n modules to the banner for the admin
Before, when someone with settings rights created a foreign VAT fiscal position for a country in which there was no tax template yet, a banner was displayed, telling that the right l10n module needed to be installed. However, there was no link to the list of modules, and the user had to go back to the app switcher, then to the Apps menu to install the module he needed. We now display a link to this page, only for the users with setting rights. Other users will still see the same thing as before.

Manual forward-port of https://github.com/odoo/odoo/pull/77687

closes odoo/odoo#78209

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
2021-10-12 12:56:51 +00:00
Jeremy Kersten 05dd2169a6 [FIX] website: allow to disable cache page based on content
In some case, we know that page will contains dynamic content and that cache
should be ignored.

E.g. as soon as a s_snippet_form will be present in page, we know that we need
the real csrf, and so we cannot use the cached response from another user.

Now, we disable the cache (cache_time=0)

closes odoo/odoo#77935

X-original-commit: 262499a91cc9f2365cf2ff131796d9b61b438f9b
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2021-10-12 11:44:44 +00:00
Fabio Barbero 2d65d022d9 [IMP] website_slides: change confirmation messages for email
Purpose
=======
Clean up messages related to email verification.

Specification
=============
Rephrase messages, add confirmation of email sent and let user change
email.
Do not show "Validation Email sent" if the current user changed their
email address.

PR: https://github.com/odoo/odoo/pull/77617
Task-2647065

closes odoo/odoo#77617

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-12 11:44:40 +00:00
Mohammed Shekha c81b46d5e6 [FIX] web: custom filter on selection field shows DB value
before this commit: custom filter on selection field shows database value while
it should display user freidnly value.

after this commit: custom filter on selection field will display UI value of
selection attribute instead of database value.

task-2363112

closes odoo/odoo#78181

X-original-commit: 0f268ba36b302df9f247c746db64987a966c1dec
Signed-off-by: FrancoisGe <fge@odoo.com>
2021-10-11 16:21:52 +00:00
Julien Mougenot 48229bcfde [FIX] base: Fix duplicate asset changed message
Before this commit: the "Asset changed" log message would display
an incorrect version and name. This commit fixes that.

closes odoo/odoo#78175

X-original-commit: d4350ddace643fefa5951655e53f701b13b45333
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-11 15:08:49 +00:00
Julien Castiaux 86c27b7156 [FIX] core: lower_logging record.args not str
As per the logging documentation, it is fine to send arguments that are
not string. Logging takes care of stringifying and injecting the
arguments in the message template.

closes odoo/odoo#78172

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2021-10-11 15:08:44 +00:00
Francois (fge) 6c12a56eed [IMP] web: command Activate debug mode (with assets)
This commit adds a command to activate the debug mode with assets from
another debug mode.

closes odoo/odoo#78159

Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-11 13:52:38 +00:00
François (FRC) 377f18013a [FIX] partner_autocomplete, *: fix partner autocomplete dropdown menu hidden
base: The two elements were not distinguishable by an xpath.

partner_autocomplete: Use new ids in xpath

The class `o_text_overflow` set on the fields was also
preventing the dropdown menu from appearing. This class is
now moved to the `input` tag instead of the while `div`.

closes odoo/odoo#78141

Task: 2638570
X-original-commit: fd7bfbccd45f874d5a826e695858bc75c8467700
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2021-10-11 13:52:31 +00:00
Mathieu Duckerts-Antoine 85b8a95116 [REF] *: clean some useless %% in xml files
The commit https://github.com/odoo/odoo/commit/1b40e9265f88f57aaaf311bb8fae3d1fd1966d7d
allows to get rid of most escapings %% in xmls but there were still occurences
of useless %% in some of them. We remove them.

closes odoo/odoo#78069

Related: odoo/enterprise#21553
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-11 12:34:47 +00:00
Francois (fge) 9802d34a9e [FIX] web: add profiling_qweb_view in the bundle
In commit b4b5e8da3ee361cbdac6d5ebad29e67e24da8e81, we forgot to add
the moved files to the manifest.
We fix that in this commit.

closes odoo/odoo#78066

X-original-commit: 91e0f4a109dfdf6554c1cd2bb5c9d40b3a7fcbbc
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-11 12:34:42 +00:00
Albin 0f56c0f0be [FIX] core: env creation broken because of missing cr.transaction
A cursor created by a Connection object is not expected to be used with
environments; use registry.cursor() instead.

closes odoo/odoo#78143

X-original-commit: 6aeb73f10953f3547b7cf830718c02a3933df9e0
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2021-10-11 11:27:46 +00:00
Jacky (trj) 2fbc5cce75 [FIX]: point_of_sale: load products in the background
The limited products loading and the loading in the background did not follow the rule's order because the right method was never called. Also, the SQL query has been corrected to properly follow the rule of the loading order.

closes odoo/odoo#78142

X-original-commit: 8989811e5d61dac56d8c2b5433afa513eac88fb2
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2021-10-11 11:27:42 +00:00
kir-odoo d4fb97e655 [IMP] account: align the label of fields narration in both
Purpose of the task is to:
1) Label becomes "Notes" rather than "Terms & Conditions".
2) Fields reorganization from left to right.

So in this commit, Updated Label "Terms & Conditions" to "Notes", Fields
reorganization from left to right in 'account.bank.statement' and
'accont.bank.statement.line' model and make group_by bank statement.

Links
Task - 2613132

closes odoo/odoo#77454

X-original-commit: ce4234c98a701c0071228827187471db167a3bdb
Related: odoo/enterprise#21287
Signed-off-by: Florian Gilbert <FlorianGilbert@users.noreply.github.com>
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-10-11 11:27:37 +00:00
Lucas Perais (lpe) 5db9518ee9 [FIX] web: control_panel view switcher wrap
Before this commit, when the view switcher contained too many elements
(e.g.: CRM), in desktop mode but with a relatively small screen size
(i.e.: width ~< 1300px), the buttons of the view switcher went outside of the screen.

After this commit, the whole view switcher block is rejected on a new line.

closes odoo/odoo#78135

X-original-commit: dabc7b903340922557645c69df5858ca3360cc59
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-10-11 10:16:08 +00:00
Benjamin Vray b2325c1b7e [FIX] website_payment: use span instead of button for donation snippet
This commit replaces the <button> elements used in the custom button of
the donation snippet by <span> elements because putting inputs inside
buttons is not valid HTML.

task-2637492

closes odoo/odoo#78089

X-original-commit: 38447f80f462ebf9d0877b5e170bb5dc1bf13725
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-11 10:15:57 +00:00
Benjamin Vray fe1c1f35f7 [FIX] website_payment: update input minimum value in donation snippet
Before this commit, the minimum value of the custom button was not
updated when removing descriptions.

task-2637492

X-original-commit: 60266bf72abeac5689c8ae1cbc8d61d57a966fb0
Part-of: odoo/odoo#78089
2021-10-11 10:15:57 +00:00
Benjamin Vray 8196bb0359 [FIX] website_payment: fix visibility of the donation snippet options
In the donation snippet, do not allow user to select the option
"slider" if "display options" is disable because the slider is not
used on the pay/donation page.

task-2637492

X-original-commit: e5bc1dcd2dfdecc20d9e13f109ca206343b43069
Part-of: odoo/odoo#78089
2021-10-11 10:15:57 +00:00
wan 9b0baa3aa4 [FIX] *: product back2basics post-freeze fixes
This should have been a fixup of 37eb0dfbb54db1c062276cd8c172bf8dac9e557b but we needed
to freeze 🤷‍♂️

closes odoo/odoo#77344

closes odoo/odoo#77876

Related: odoo/enterprise#21425
Related: odoo/enterprise#21467
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-11 10:15:49 +00:00
william-andre d3f4ce1152 [IMP] core: allow set [value] in selection ondelete
In some cases we migh want to change to a value that isn't the default
one when uninstalling.
For instance: when we uninstall the module `event_sale`, a product has
the field `detailed_type` set to `event`, which is a subtype of `service`.
So we want to update the value to `service` when uninstalling instead of
the default value, which would be `consu` and wouldn't make any sense.

Part-of: odoo/odoo#77876
2021-10-11 10:15:48 +00:00
Laurent Smet e4926a24da [FW][IMP] account: partner_id not required in payment form view
Create a payment without a partner for a receipt
Go to the form view
Click on the stats button.
=> Error, 'partner_id' is required

In some cases, having the partner not required on the view is needed.

closes odoo/odoo#78124

Task: 2610780
Forward-port-of: https://github.com/odoo/odoo/pull/77727
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2021-10-11 09:02:37 +00:00
Romain DerieandAdrien Widart e5a77f2cc1 [FIX] website_sale_stock: use correct qty to show warning/error
Without this commit, if you had:
- 3 Qty for product P in WH1
- 10 Qty for product P in WH2
- no warehouse set on website
- set show stock and prevent sales if not enough stock enabled

And then:
- Add 3 P in your cart
- In cart, add more P, it would let you do it, while it shouldn't

You would then be stuck on payment step as it would tell you only 3 are
available.

This commit improves 6b05fb2b21a3 by ensuring the warehouse_id used is the
correct one (the one that will be used on the SO (required field)).
That commit was fixing a case that was not supposed to happen[1], it is that
case that should have been fixed (which is fixed by previous commit of this PR)

[1]: it would fix the 'issue' when you add a product which has no stock
     available for the warehouse that will be used when creating the SO, by
     letting you through the warning, but you would then be stuck on the
     payment step as the qty check would be correctly done.
     The fix should have been to display the correct qty and prevent the add to
     cart in that case.

closes odoo/odoo#78045

X-original-commit: 5f74b84f67222147b2eb7caadb2d831a059aae4e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Adrien Widart <awt@odoo.com>
2021-10-11 09:02:32 +00:00
Romain DerieandAdrien Widart 4680f66586 [FIX] website_sale_stock: always select a warehouse
In multi-warehouses, the available quantities shown on product page is not the
same one used to compute the max quantity that can be bought in the checkout.

Indeed, a sale order has a required `warehouse_id` field, and the quantity that
can be bought is computed based on that warehouse.
But if the website has no warehouse set to it (in settings), the shown quantity
on product page will be computed based on all available warehouses.

It will then show an error on payment step, if the user has selected more
quantities than there is available on the warehouse used for his order.

Considering the structure of `sale.order`, displaying the quantities in
several warehouses does not make sense.

To reproduce the issue:
1. In Settings:
    - Enable 'Multi-Warehouses'
    - Make sure the option Website > Inventory > Warehouse in undefined
2. Create a second warehouse WH02
3. Update the quantity of "Storage Box":
    - 18 in first WH (should already be present)
    - 12 in WH02
4. Edit "Storage Box":
    - eCommerce > Availability: "Show inventory on website and prevent
sales if not enough stock"
5. On the eShop, go on "Storage Box"
    - Note that there are 30 units available
6. Add 22 "Storage Box" to the cart
7. Process checkout

Error: When trying to pay, a Server Error is raised: "We are not able to
redirect you to the payment form. You ask for 22.0 products but only
18.0 is available." This is confusing since the available quantity on
the product page is 30

opw-2630804

X-original-commit: ee2d1c31bb0f6ee7c52b84b6c9ee5ca2d8e70e03
Part-of: odoo/odoo#78045
Co-authored-by: Adrien Widart <awt@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
2021-10-11 09:02:32 +00:00
baa b6896dae77 [IMP] l10n_sa: adding COA + Tax reports + Tax grids + Closing entry for Saudi Arabia
Adding Chart of accounts, taxes and some translation for Saudi arabia accounting

closes odoo/odoo#77960

X-original-commit: db667f486083ae7a934fd18f9023cdc2bbfb0de0
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-11 09:02:25 +00:00