Commit Graph
145771 Commits
Author SHA1 Message Date
Joseph Caburnay 9c19cadef7 [FIX] pos_coupon: do not count refund orderlines when computing rewards
1. Sell Product A with discount because of Automatic Promo on specific
   product.
2. Refund Product A with its discount.
3. Add Product A in the refund order.
[BUG] No discount for the added Product A because the total
count of Product A in the order is 0 (or less because of the discount
line).

In this fix, we don't count the refund orderlines, this way, when
a product is added which qualifies the automatic promo, that new line
will be properly discounted.

Part-of: odoo/odoo#77903
2021-10-06 10:27:04 +00:00
Joseph Caburnay 44b9f7d343 [FIX] point_of_sale,pos_coupon: correct the taxes in the paid order
It also fixes the problem when refunding orderlines with taxes.

Part-of: odoo/odoo#77903
2021-10-06 10:27:03 +00:00
Joseph Caburnay daa39e121e [FIX] point_of_sale: do not merge refund orderline to ordinary line
Part-of: odoo/odoo#77903
2021-10-06 10:27:03 +00:00
Joseph Caburnay 9c7cda274b [FIX] pos_sale: no need for the payment_communication override
Since pos is now using the invoice with payments, there is no need
for this communication override.

Part-of: odoo/odoo#77903
2021-10-06 10:27:02 +00:00
Joseph Caburnay 62afea87b4 [FIX] pos_sale: remove redundant payment information in invoice
Since the merge of https://github.com/odoo/odoo/pull/74870, pos
is now using the invoice template that contains payment information.
We can now remove this customization in pos_sale since it's already
native in point_of_sale that payments are listed in the invoice.

Part-of: odoo/odoo#77903
2021-10-06 10:27:02 +00:00
Bruno Zanotti c9fa9803b9 [FIX] l10n_ar: return vat info grouped by tax
In the method _get_vat(), used to inform AFIP about the vat taxes of an
invoice, we were assuming that in the journal items of the invoices
there is always one line per tax group, but if the user enables the
option "Include in Analytic Cost" of the tax, then it could create more
than one line per tax so it will return an error if you try to validate
the invoice in AFIP or upload the vat book.

closes odoo/odoo#77526

X-original-commit: 67f5f0e86f0170f6066579749895e7d1e68d664c
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-06 09:16:42 +00:00
Samuel Degueldre ceea5f7852 [IMP] mail: allow users to reply to other messages in discuss
This commit adds a feature where users can reply to messages of other
users, doing this will show a reduced version of the message that has
been replied to above the message once posted, clicking on this reduced
version will scroll to the original message and highlight it if that
message is already loaded.

task-2362251

closes odoo/odoo#77941

X-original-commit: cec2e69e832072dd699274187ddfa122e29d03f3
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
2021-10-06 07:03:59 +00:00
Adrien Widart c31ca41c60 [FIX] sale_stock,stock_account: ignore SVL without any qty
In some conditions, confirming an invoice will raise an Odoo Server
Error due to a division by zero.

To reproduce the issue:
(Need sale_management)
1. Create a product category PC:
    - Costing Method: Average Cost (AVCO)
    - Inventory Valuation: Automated
2. Create a product P:
    - Product Type: Storable
    - Category: PC
    - Cost: 50
3. Create a sale order SO:
    - 5 x P
4. Confirm and process the delivery D
5. Edit P:
    - Cost: 40
6. Open D and create a return R:
    - 1 x P without "Update quantities on SO/PO"
7. Process R
8. In Inventory, create a transfer T:
    - Operation Type: Receipt
    - 1 x P
9. Process T
10. Back to SO, create an invoice and post it

Error: an Odoo Server Error is raised: "ZeroDivisionError: float
division by zero"

When validating the transfer T, a stock valuation layer is created with
a zero quantity and is linked to the first SO.order_line.move_ids (i.e.,
the SM from Stock to Customer with 5 x P)
https://github.com/odoo/odoo/blob/dfab388fdf8c7597774ff1738a1b09295c12fb49/addons/stock_account/models/product.py#L439-L450

Then, when posting the invoice, this SVL is used to make a division:
https://github.com/odoo/odoo/blob/dfab388fdf8c7597774ff1738a1b09295c12fb49/addons/stock_account/models/product.py#L690-L691

In such cases, we should ignore this SVL and use the standard price:
https://github.com/odoo/odoo/blob/dfab388fdf8c7597774ff1738a1b09295c12fb49/addons/stock_account/models/product.py#L695-L699

OPW-2647921
OPW-2646419

closes odoo/odoo#77909

X-original-commit: d5eccda583e28a15e8a74a4e82f9e76ec32d0806
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
2021-10-06 07:03:54 +00:00
ijas ahammed 76f5e41bca [FIX] website_crm_partner_assign: hide activity types of other models
Right now when editing the opportunity, all the activity types are listed in
the drop-down, even those which are specific to other models.

After this commit  while editing the opportunity, we now display
only activity types which are either specific for 'crm.lead', or those
which are not linked with any models (common for all).

TaskId-2443894

closes odoo/odoo#77924

X-original-commit: eda10ddcacdcb016c1282252d3b65dc37c934221
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-06 06:00:06 +00:00
Didier (did) f56d11e45b [FIX] mail: add attachment deleted notification
Before this commit, when an attachment is deleted, there is no notification and
other client do not update the attachment status.

task-2635516

closes odoo/odoo#77937

X-original-commit: aa4d7920574852d0543e22a30fc686a7d41f9867
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:09:07 +00:00
Louis Wicket (wil) 71f6d736cc [IMP] mail: add rename guest button
This commit will display the name of the current guest in the thread
view top bar and make it editable.

closes odoo/odoo#77936

X-original-commit: 659c6a83245a396054cf26c204a7fc72fbbb971f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:09:03 +00:00
Louis Wicket (wil) 3ffad9f8a0 [FIX] mail: open attachment viewer in public views
Click on an attachment from a public thread view will now open it in an
attachment viewer.

closes odoo/odoo#77932

X-original-commit: 550dc40b022cd3b11440a1767df4d857d9fd12a9
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-06 02:08:59 +00:00
Daniel Blanco 05317ef4b1 [I18N] l10n_cl: relax the condition for registering entries in purchase journal, in order to allow to record expenses without warnings.
closes odoo/odoo#77919

X-original-commit: 790a532898c07c69da6037a674bc805e30e46f45
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-06 00:48:42 +00:00
qsm-odoo b5d357e45d [FIX] web_editor: restore overlay padding controls
Sometimes the padding controls disappeared for no apparent reason. This
was when going from a child element to a parent element -> following
BVR's investigation, it apparently appears that the UI is not updated
anymore since already visible and nothing should have to be updated
since [1].

While waiting for a deeper investigation about the onFocus / ui update
flows, this commit restores the padding controls another way: by simply
not hiding them and showing them again at each blur / focus. It does not
seem needed indeed... or at least I cannot find a reason why right now.
Indeed, it was not the case before [2] which changed the system without
any explanation. With [3], the onFocus part was later moved to updateUI
since each onFocus calls are now followed by an UI update. But in this
case, like before [2], it only seems needed to show or not the padding
controls at option initialization.

Deeper investigation and refactoring will follow.

[1]: https://github.com/odoo/odoo/commit/806a8db35b5e0e6a461422f5bba7c97180c3ef29
[2]: https://github.com/odoo/odoo/commit/4f27e52cabb77b8b1a9637a11185ddf882adc9af
[3]: https://github.com/odoo/odoo/commit/3be9ae5672f76f85cd747f57539e7bc2919850f8

closes odoo/odoo#77929

X-original-commit: 4de5d51948a121bb6df716f1b99cd86511b9cba9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 22:21:01 +00:00
Samuel Degueldre e31464db54 [FIX] mail: stop squashing message if the previous message is deleted
closes odoo/odoo#77922

X-original-commit: 92c7f11e3c3cc70a3d520f0977f474e55dc7bced
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 19:13:38 +00:00
Demesmaeker 11433284cf [FIX] payment_(adyen, authorize): fix traceback and tune the refund
- This replaces the name of `refund_amount` to `amount_to_refund`
for a variable that was renamed elsewhere, which caused a traceback.
- Adyen and authorized `_send_refund_request` now have their return,
as their parent.
- When a refund is initiated from Adyen, it's now easier to change
the merchant reference, thus, we can't count on it anymore to get
the source transaction.
- Fix the automatic refund for authorize.net with the manual capture

task-2634184

closes odoo/odoo#77916

X-original-commit: 747dbf44f37407fd415af645dac652199ac7fa6b
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2021-10-05 18:05:46 +00:00
Louis Wicket (wil) b07b123145 [IMP] mail: notify guest arrival
Post a message in the channel each time a guest is added to members of
the channel.

closes odoo/odoo#77915

X-original-commit: bf6af9b629a07d04bf582987b5144a37fa31729e
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 18:05:42 +00:00
Martin Trigaux e132c36ee6 [I18N] *: export 15.0 source terms
closes odoo/odoo#77898

X-original-commit: ad5afb1d18661784bfcf51bca66e576de1f6c49b
Related: odoo/enterprise#21478
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-10-05 16:54:21 +00:00
Tiffany Chang (tic) b6128c5d00 [IMP] mrp_account, sale_mrp: propagate MTO analytic account SO->MO
If a MO created from a MTO doesn't have a BOM with a analytic account
already assigned to it, then propagate the SO analytic account (if it
has one) to the MO.

closes odoo/odoo#77897

Task: 2648460
X-original-commit: 061037fb79f007389408136fd3ed13e5de970908
Related: odoo/enterprise#21477
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-05 16:54:17 +00:00
Tiffany Chang (tic) b0231630bd [FIX] mrp{_account}, stock_account: fix some UX
- update MO list status colors: draft = blue, in progress = yellow +
  make the WO status colors match (waiting = blue, in progress = yellow)
  and make draft MO lines all blue (to follow current design standard)
- cleanup Activity in tree view (no label in tree + "Next Activity" in
  column selection dropdown)
- make units of analytic accounting for WO = hours
- make quantity for move_raw_ids products (i.e. components for MOs)
  always have positive analytic_account_line.unit_amount (i.e. when
  changing a done move's quantity + changing a quantity twice made this
  value negative)
- make "Copy Operations" on BOM open the list view in "current" instead
  of "new" due to lack of hook to prevent form view (i.e. open BoM in
  current view) changing when clicking on lines in the new window's
  operations (also ends up being a better UX anyways since being able to
  view the operations form view is desired).

Task: 2648460
X-original-commit: 65a2d478197f5b856212225319500ca61b161809
Part-of: odoo/odoo#77897
2021-10-05 16:54:17 +00:00
Brice bib Bartoletti cbf464898a [FIX]l10n_be: vat due tag on vat due rep line
This commit aims to make the "due and deduced" taxes more consistent by
assigning the "VAT due" tags to the "VAT due" repartition line.
This way the tag representing the due VAT will be set on the account
move line that represents the due VAT instead of the account move line
that represents the deductible VAT.

Behavior before commit:
Due VAT tags is assigned on VAT to deduce account_move_line.

Behavior after commit:
Due VAT tags is assigned to the due VAT account_move_line.

closes odoo/odoo#77891

X-original-commit: 59961cc68ef001dade87bd5ab77809efaab31a17
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Brice Bartoletti <Levizar@users.noreply.github.com>
2021-10-05 16:54:08 +00:00
Nikunj Ladava 14af9048d5 [IMP] l10n_co: update latam identification type
task- 2486484

closes odoo/odoo#77878

X-original-commit: b766f14e85a02e6f4952f0170132f07d23b7aa85
Related: odoo/enterprise#21468
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-10-05 16:53:54 +00:00
Thibault Delavallée 9146b68b3f [IMP] test_mail: add test for reply_to computation on records
Purpose is to assert current behavior as this may change in master. Two
kind of tests are added: performance and multi company.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

closes odoo/odoo#77845

Related: odoo/enterprise#21456
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 16:53:46 +00:00
Thibault Delavallée 201d6bf771 [FIX][IMP] test_mail: be sure performance test include mail gateway
Purpose of query counter tests is to try to match real life use cases. In
mail those generally involve a correctly configured mail gateway. This is
why we set those parameters in performance tests, leading to a small increase
in some counters.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:46 +00:00
Thibault Delavallée f3a24527d2 [IMP] test_mail(_*): improve performance data preparation
Cleanup a bit ``BaseMailPerformance`` class: have more data available done
in setUpClass, then remove unnecessary code in sub classes. Overall purpose
is to lessen boilerplate in sub modules.

Task-2657021 (Performance tests cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:46 +00:00
Thibault Delavallée c0d16beb7e [FIX] various: update query counters to last runbot state
A lot of counters are not up to date. Seems some optimizations were done
allowing to lessen query counters.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thibault Delavallée 974f073b11 [FIX] test_mail: improve multicompany activation
Let us use existing data for multi-company tests created when calling a specific
method available in mail tools. We may then remove TestMailMultiCompanyCommon
that is used in a single test, with an hardcoded currency_id (hem).

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thibault Delavallée abd48cfb03 [IMP] mail: reorganize code added for discorduss
Just putting code where it belongs, in sections about access rights / discord
API. After a lot of updated some cleaning is always welcomes. This prepares
future code renaming and improvements.

Task-2661036 (Performance tests data cleanup)
Prepares Task-36879 (MultiCompany Aliases)

Part-of: odoo/odoo#77845
2021-10-05 16:53:45 +00:00
Thanh Dodeur af015814f6 [FIX] mail: prevent traceback when the audio of a peer is loaded
Before this commit, we would reset the audio of a peer before setting a
new one which is not necessary as the track remains the same for the
whole lifetime of the transceiver (and therefore the peerConnection).

Moreover, calling `pause` on the audioElement could lead to a race
condition with the following `play` and lead to a traceback.

closes odoo/odoo#77883

X-original-commit: e0b957cd3cd657ad15168e35fdaaeebccb7be4be
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:42:04 +00:00
Romain Derie 7a00f107aa [FIX] website_sale(_stock): remove dead code
When the `or` was introduced [1], the company_id was not required [2].
The required was added later somewhere between 11.0 and 12.0 [3].

Reaching the `or` condition was therefore not possible anymore.
Extracted from https://github.com/odoo/odoo/pull/77308

[1]: https://github.com/odoo/odoo/blame/10.0/addons/website_sale/models/sale_order.py#L350
[2]: https://github.com/odoo/odoo/blame/10.0/addons/website/models/website.py#L165
[3]: https://github.com/odoo/odoo/commit/2a9a514551ca951db656e139cb4d177657eb95e7

closes odoo/odoo#77882

X-original-commit: c33ba174d0bd534794e3daa7dc99f84140ba6d22
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-10-05 15:41:59 +00:00
Benoit Socias f2a44d192d [FIX] web_editor: handle gradient styles only when gradients allowed
Before this commit the progress bar options were broken because the
stripe effect is achieved by a gradient in the CSS, but
`SnippetOptionWidget` recognized it as a manually selected gradient, and
thus applied the gradient specific handling (such as neutralizing the
background-image when a color is selected).

After this commit the special handling for gradients is only applied
where gradients are expected to be selected manually (i.e. when the
`withGradients` parameter is set).

task-2662401

closes odoo/odoo#77881

X-original-commit: f873c1d1eb05fa25717817c85899629103dcada3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 15:41:55 +00:00
Thanh Dodeur e6fbdb91c8 [FIX] mail: remove the dataChannel entry when removing a peer.
Before this commit, the entry in `mailRtc._dataChannels` was not removed
when removing a peer, which meant that `mailRtc._dataChannels` could
contain old closed dataChannels. Moreover, the call to `close()` on the
dataChannel was not guarded, which could lead to tracebacks.

For example, if a peer was removed before creating its dataChannel (like
in crashes or successive connection recovery attempts), `close()` was
called on `undefined`.

this commit fixes this issue.

closes odoo/odoo#77880

X-original-commit: da3fce19157a07fc1abbb6d188746d4a00d3a344
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:41:51 +00:00
Romain Derie de0308e87f [FIX] web: remove the command palette from the frontend
There is multiple issue with the palette in the frontend:

First, the command palette is bound to CTRL+K, which need to be bound to link
creation as this is an universal keybind, as CTRL+P CTRL+F are, as any other
edition app in the world does.
(Note that link creation is not only for edit mode but also for end user, eg
forum post)
History of the keybind:
1. Command palette was introduced with CTRL+K
2. The keybind was changed to CTRL+M to restore CTRL+K for link edition, see
   8727ed2766
3. The keybind change was reverted and command back to CTRL+K, as CTRL+M can't
   be used on MAC

Second, the command palette do not correctly work in the frontend, the menu are
not opened when an entry is selected, and the submenu are not shown in the palette
when the menu was opened before opening the palette.

Lastly, the CTRL+K in frontend does not only open the command palette but it
also create a link in the background of the palette being opened.. which
result in very bad usability..
The one expecting a link has to deal with a palette.
The one expecting a palette has had a link created without really noticing it.

task-2659885

closes odoo/odoo#77879

X-original-commit: 6135b04738a58564592f438364f5a147ce9c471f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-10-05 15:41:46 +00:00
qsm-odoo ea93bf26f6 [FIX] base: lazy load external files if part of a lazy loaded bundle
In the payment_adyen module, files of adyen are added as part of the
assets_frontend bundle. That bundle is lazy loaded on the website... but
those external files were not, as not added within the bundle itself.
This commit fixes that, properly lazy loading "remaining" files
out of a lazy loaded assets bundle.

closes odoo/odoo#77877

X-original-commit: 8dd71bdc42c8d4ab3373a2a0601c93d1687aabca
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 15:41:42 +00:00
Thanh Dodeur 023eee86f4 [FIX] mail: prevents frozen video elements
Before this commit, when a video track ended unexpectedly, the peers
were not notified that the remote track ended, which made it so that
inactive video elements remained on screen.

This commit fixes this issue.

closes odoo/odoo#77875

X-original-commit: d868582b2b409ec01bc4983429dea723f27f5513
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:41:38 +00:00
Victor Feyens 92d4987acb [FIX] sale: enable demo SO's currency
Needed for demo flow of payment links.

closes odoo/odoo#77874

X-original-commit: 7b51d4e0ae5a9a10cfd548bc6307dac180be280f
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Valentin Chevalier <chevalierv@users.noreply.github.com>
2021-10-05 15:41:34 +00:00
Valentin ChevalierandVictor Feyens 1ded4e3689 [FIX] payment: add req param to the landing route
When a payment is made, add required parameters to the landing route.

This issue was introduced with 7fccbac

task-2645216

X-original-commit: cfcf4c64caac951783a1b39b63c024028b07b434
Part-of: odoo/odoo#77874
Co-authored-by: Victor Feyens<vfe@odoo.com>
2021-10-05 15:41:33 +00:00
Younn Olivier 1b4f640a92 [FIX] website: remove translation for technical fields
task-2629245

closes odoo/odoo#77873

X-original-commit: 472256c8539602a7bb2e81b389faf050b4d0785d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2021-10-05 15:41:28 +00:00
Younn Olivier 8563d989f3 [FIX] web_editor: reduce M2M widget rpc
Every options UI is updated when one is updated.
The Many2manyUserValueWidget is built in a way that every UI update will
trigger 2 rpc to get the records to display to the user, even if it is
not the option containing the widget that has been updated.

These rpc are now cached at the widget level.

This commit also fixes a bad computation of the Many2manyUserValueWidget
search domain.

task-2629245

X-original-commit: 847aecb4f9f4647e55e454d8c6560aa267f17c64
Part-of: odoo/odoo#77873
2021-10-05 15:41:27 +00:00
Younn Olivier 67ee284918 [FIX] website: keep focus on snippet when changing visibility
Triggering the event 'snippet_option_visibility_update' with show
parameter set to false would deactivate the snippet.

task-2629245

X-original-commit: a8d1c162ebfc8d8f80794d3a1e57008c575b3963
Part-of: odoo/odoo#77873
2021-10-05 15:41:27 +00:00
Fabio Barbero 4f2375f524 [FIX] survey: display "Correct pill" only once in results
Bug
=======
Since fb7b30b the "Correct" pill is displayed twice in survey results.

PR: odoo/odoo/pull/77620
Task-2648054

closes odoo/odoo#77867

X-original-commit: bc8e2d67b5980bb963f0e663f3c3d761ca4af169
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 15:41:20 +00:00
Aaron Bohy 25690c2879 [FIX] web: fix documents tests failing randomly
Since commit [1], several tests from the "documents" addon failed
randomly, because there were leftovers in the DOM at the end of
the tests. Those leftovers were the many2one dropdowns. Since v12,
we whitelist jQuery autocomplete dropdowns in the leftover check.
However, since [1], the many2one autocomplete has an additionnal
className, and it thus didn't match the element in the whitelist
anymore. Note that we duplicated the entry in the whitelist
because we need both (there are several types of autocomplete
dropdowns in the "documents" view).

[1] 84715436d87bb05b421bc9ccaacda67d07571690

closes odoo/odoo#77861

Related: odoo/enterprise#21460
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
2021-10-05 15:41:15 +00:00
oco-odoo eabb144fc6 [IMP] account: reconciliation models: make use of the fact currency_id is always set on move lines
In older versions, currency_id was left empty on move lines in domestic currency (as well as amount_currency and amount_residual_currency). It's not the case anymore, so we can simplify the code a little bit.

closes odoo/odoo#77260

closes odoo/odoo#77801

Related: odoo/enterprise#21354
Related: odoo/enterprise#21437
Signed-off-by: William André (wan) <wan@odoo.com>
2021-10-05 15:41:03 +00:00
oco-odoo 2df6107cd7 [IMP] account: reconciliation models: don't suggest too many matches in case of partial mathing
- Create a statement line for partner A, amounting to 90€
- Make 5 invoices for partner A, of 10, 50, 100, 500 and 100 €
- create a reconciliation model (make sure it's the only one active for testing), with
>>> "invoice matching" selected
>>> "payment tolerance" disabled
>>> "partner should be set" enabled
>>> "same currency" enabled
>>> "auto-validate" disabled

Try to reconcile your statement. The reconciliation model associates your statement line to the 5 invoices, showing a partial match of 30 for the line of 100€, as only 30€ remain after matching 10 and 50. The following lines (500 and 100) are useless in the reconciliation and confusing for the user. They shouldn't be there.

After this commit, no useless line will be proposed anymore. In our example, only lines 10, 50 and 100 will be proposed.

Task 2652915

Part-of: odoo/odoo#77801
2021-10-05 15:41:03 +00:00
oco-odoo fc1a860b3e [IMP] account: better default reconciliation models
Task 2652915

Part-of: odoo/odoo#77801
2021-10-05 15:41:03 +00:00
Sébastien Theys 3a87aaf914 [IMP] mail, *: clean up message component by introducing view model
* = hr, hr_holidays, sms, snailmail, website_livechat

Message model incorrectly contained data related to a specific component (only
one) even though there can be multiple message components per message model.

This cascaded to adapting related component/models to the same principle.

closes odoo/odoo#76718

closes odoo/odoo#77779

Related: odoo/enterprise#20964
Related: odoo/enterprise#21426
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2021-10-05 15:40:49 +00:00
Tiffany Chang (tic) 9b4ed37b41 [IMP] stock: make package type demo data company agnostic
By setting a company on the package type, this makes it so the package
type isn't selectable for packages without a company (i.e. Put in Pack
without validating a picking = package without a company). For the sake
of demos, let's make it so any company can use these package types.

Task: 2623434
ENT PR: odoo/enterprise#21179

closes odoo/odoo#77597

X-original-commit: 7ec72c3d838dd40aad921b65b998b68c59225e01
Related: odoo/enterprise#21349
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-10-05 15:40:45 +00:00
Tiffany Chang (tic) a452cef18f [IMP] barcodes_gs1_nomenclature: add more volume rules
Some already exist, but let's add m^3 and ft^3 as well for demo data
purposes since office furniture supply stores are more likely to work
with these volumes than the existing ones.

Task: 2623434
ENT PR: odoo/enterprise#21179

X-original-commit: baecc0d502b111a5652e0a2d6ce29bd0fb204843
Part-of: odoo/odoo#77597
2021-10-05 15:40:44 +00:00
Thibault Delavallée d6434fe846 [IMP] base: improve ir.mail_server form view readability
PURPOSE

Help people setuping their mail server with clear labels and form view.

SPECIFICATIONS

Rename Description to Name, as Description indicates a secondary text
field. Add a placeholder to indicate it is used as a functional name
and not a technical field.

Relabel the field for filtering to FROM Filtering. Current From Filter
could lead to think it filters incoming emails which is not the case.

Move button for testing in header as on all form views.

Use radio buttons for authentication and encryption to display available
settings directly to user. This is more user friendly than selection boxes.

Split connection information in two groups: authentication and security.
Each group comes with its options below main radio-based field.

Task-2628092

closes odoo/odoo#76301

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-10-05 15:40:36 +00:00
Moises Lopez - https://www.vauxoo.com/ ae7184eb21 [FIX] test_lint: Fix some false results
* [FIX] test_lint: Consider variables for sql-injection

Using the following code:

```python
var = 'SELECT name FROM account WHERE id IN {}'
values = (1, 2, 3)
self._cr.execute(var.format(values))
```

It has a risky sql injection ignored before of this change

And allow psycopg2.SQL way mapping the variables declaration

* [FIX] sql-injection: AttributeError: 'NoneType' object has no attribute 'parent'

Using the following code:

    queries = [
        "SELECT id FROM res_partner",
        "SELECT id FROM res_users",
    ]
    for query in queries:
        self.env.cr.execute(query)

The check sql-injection shows the following error:
 - AttributeError: 'NoneType' object has no attribute 'parent'

So, Now it is validating if it is not None

* [REF] sql-injection: Using better naming for node_ofc -> node_assign

* [FIX] sql-injection: Fix false positive using BinOp "+"

Considering the following valid case:

    cr.execute('SELECT ' + operator + ' FROM table' + 'WHERE')

The representation tree is:

    node.repr_tree()
    BinOp(
    op='+',
    left=BinOp(
        op='+',
        left=BinOp(
            op='+',
            left=Const(value='SELECT '),
            right=Name(name='operator')),
        right=Const(value=' FROM table')),
    right=Const(value='WHERE'))

Notice that left node is another BinOp node
So, it need to be considered recursively

closes odoo/odoo#77864

X-original-commit: ce1a0171f61d2808470c185a91e9f8299e4efd25
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2021-10-05 14:18:05 +00:00