Commit Graph
148490 Commits
Author SHA1 Message Date
Victor Feyens a73fb16da0 [IMP] product,website_sale: pricelist API cleanup
* query pricelist filters/domains directly for the correct company 
instead of relying on context/session/... content
* pass the record instead of the id to avoid useless browse calls
* also clearly highlight sudoed partner record

Part-of: odoo/odoo#82374
2022-02-21 08:41:29 +00:00
Victor Feyens 06f417012c [IMP] product: clean res_partner.py
Part-of: odoo/odoo#82374
2022-02-21 08:41:29 +00:00
Victor Feyens 5a58ba9d1a [IMP] product: clean product_pricelist.py
* rename default method according to guidelines
* reorder fields
* clean fields attributes & indentation

Part-of: odoo/odoo#82374
2022-02-21 08:41:28 +00:00
Victor Feyens 753ac6b30a [IMP] product: clean product_pricelist_item file
* order fields, methods according to guidelines
* fix some typos
* rename methods according to guidelines
* remove useless field attributes and class specifications in super()
calls

Part-of: odoo/odoo#82374
2022-02-21 08:41:28 +00:00
Victor Feyens 35bc99a77e [IMP] product: split python files by classes
Part-of: odoo/odoo#82374
2022-02-21 08:41:28 +00:00
Nicolas (vin) 9e27a1fd4a [FIX] account_reports, l10n_it_reports: carryover fix
There is an issue with the Italian carryover, line vp14b.
Use case:
 - Month 1, have a value of 25 in this line => will trigger a carryover to line vp7
 - Month 2, add more value to vp14b so that it goes above 25.82.
   This will set the bound as None, and thus this will not impact the carryover.
This is wrong, because then the next month we will see a value of 25 in vp7
while it should be 0.

closes odoo/odoo#84938

X-original-commit: ffbc7af321a36d4fd0aebb94d7a636cb1fc34b88
Related: odoo/enterprise#24555
Signed-off-by: Olivier Colson <oco@odoo.com>
Signed-off-by: Nicolas Viseur <vin@odoo.com>
2022-02-21 07:49:49 +00:00
Katherine Zaoral 69e31db6ac [IMP] l10n_ar:_sanitize vat number method
* fix traceback when vat is not defined, return directly 0.
* remove api.model
* add ensure_one() to avoid misuse of the method

closes odoo/odoo#84952

X-original-commit: 5cd4df745462fcc12b9d92def9cf903ebd0df143
Related: odoo/enterprise#24565
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-20 20:39:50 +00:00
Julien Mougenot 915191cb18 [FIX] web: assign numbering system to luxon
Before this commit, the numbering system used by luxon was the default
one set by the browser (in most cases: 'latn'). This caused issues when
translating luxon dates with moment dates, as moment supports some
locales differently (e.g.: ar_001 uses the 'arab' numbering system
while Intl uses 'latn').

To have proper consistency, this commit assigns (as much as possible)
the same numbering systems as luxon for each supported locale.

Warning: since the numbering system is now set according to the user
'lang' parameter, it's now unsafe to use `DateTime.fromFormat(...)` with
static date strings, as they might not be parsable with the current
numbering system.

closes odoo/odoo#84833

X-original-commit: 8bd8b299d57ea930b0549446900bd51d03800041
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
2022-02-19 22:17:32 +00:00
Benoit Socias 07290bfe8d [FIX] website: disable fuzzy search if search term contains numbers
Since [1] when fuzzy search was introduced, fuzzy search was also used
when the search term contained numbers.
This is a problem for companies where the shop search is used on
references: the fuzzy search does not match against the whole database
and therefore the exact match might not be found.

After this commit the exact search is used whenever the search term is
made of 80% of numbers or more - because it is very likely to be a
reference or an identifier.

[1]: https://github.com/odoo/odoo/commit/7559626c54e34b41e1549e28276a650accec6986

opw-2715647

closes odoo/odoo#84943

X-original-commit: 7b44907c322a7b78ef4a5cb46627df4f72b21240
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 21:04:54 +00:00
Paolo (pgi) d2d50ba63b [ADD] l10n_it_edi_sdicoop: user settings for demo mode
- A new flag is added to the Setting (l10n_it_edi_sdicoop_demo_mode)
  that is computed from the ir.config_parameter
  'account_edi_proxy_client.demo'.

  If the flag is 'demo', Odoo will not send invoices through the EDI,
  if the flag is 'test', Odoo will send invoices to an IAP test server
  instance that operates with a test SDICoop service
  if the flag is 'prod', Odoo will send invoices to production IAP,
  that routes them to the official SDICoop service.

- Some minor UI rework for the EDI parameters on res.company
  The EDI settings in the res_company form, under the
  'Electronic Invoicing' tab, must stay on the left

closes odoo/odoo#84925

X-original-commit: c5d049c55d21f9885e79182df2bd5f433c5bb782
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-18 18:13:37 +00:00
root 41b5d4306e [IMP] purchase: create hook to override searchbar sortings
With this commit we can now call a hook when we want to modify the code for this route.
Before this commit the only way to modify/extend this would be by taking over a big part of the code.

closes odoo/odoo#84905

Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-18 15:30:47 +00:00
William Braeckman caefc5b048 [FIX] hr_holidays: fix invalid first level next call date
Prior to this commit the next call date for the first level would not
take the second level into account, as such it could be that the first
level would be completely skipped instead of being prorated properly.

TaskId-2768435

closes odoo/odoo#84899

X-original-commit: 791b801c7b96a94353031a06dd5da4eeb20ee08b
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-02-18 15:30:43 +00:00
Julien Mougenot f6b051a828 [IMP] web,*: Deterministic mock server sorting
This commit orders the records coming from the mock server the same
way they are ordered by the ORM, while also allowing it to support
multiple levels of orderby.

This has been done to increase consistency in the test suite and provide
a more accurate representation of how records would be returned by the
actual server.

Some tests performed their assertions based on this previous
undeterministic system and have been adapted, either by altering
the base setup or the assertions themselves.

closes odoo/odoo#84718

Related: odoo/enterprise#24509
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-02-18 15:30:39 +00:00
Sébastien Geelen (sge) b160eabafd [FIX] web_editor: keep cursor in empty inline tag
Ensure the user can keep typing inside a newly emptied inline tag:

* Add Zero-width Spaces (ZWS) in empty html tag

> We add zero-width spaces in elements in certain cases where they would
> not be correctly displayed by the browser if they were truly empty.
> This also ensure the user cursor can stay in an empty elements,
> and thus we keep the ability to add content in those elements.
>
> See the `fillEmpty` utils function.

* Remove lingering zero-width spaces

> However, we never remove those zero-width spaces when they are not
> useful anymore. In particular, keeping those invisible characters in the
> content prevents the ecommerce from saving the new price of a product if
> the previous price was previously completely emptied during edition.
> This commit fixes that.
>
> The issue didn't happen with the previous editor because they were
> using non-breaking space instead, which is removed by the text_content
> method of lxml. However, non-breaking space were visible during edition,
> which was weird on its own.
>
> Some changes had to be made to the deleteForward and backward commands,
> to ensure the new behaviors.
> Author : @dmo-odoo

* Adapt the deleteForward and backward commands

> To ensure the added ZWS do not break the Deletes behaviors,
> we need to adapt the `deleteForward` and `deleteBackward` commands.

Co-authored-by David Monjoie <dmo@odoo.com>

task-2622455

closes odoo/odoo#84891

X-original-commit: 4360643a446271d4ff1898d67a5b5287722a0820
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-02-18 14:29:30 +00:00
Sébastien Geelen (sge) 9e12a209de [FIX] web_editor: add missing tests + fix some tests
* Fix some tests that will break when we change the empty inline tag handling.
* Add missing tests to ensure the new empty tag management
  behave correctly.
* Improve some tests with `contentBeforeEdit` and `contentAfterEdit`

X-original-commit: af379b11462d9393c3c9846aaecb9488ffaa9212
Part-of: odoo/odoo#84891
2022-02-18 14:29:30 +00:00
Sébastien Geelen (sge) c2b37d7cfb [FIX] web_editor: fix and add missing test utils
* Ensure the test environment is clean from previous editor instances.
* Provide a way to clean the successfully test cases
  to have a better and quicker overview of the failed tests.
* Better error messages in test report

X-original-commit: 9a362195ad7b3485877946d18d64fd84c62605f9
Part-of: odoo/odoo#84891
2022-02-18 14:29:29 +00:00
Sébastien Geelen (sge) ef404e974d [FIX] web_editor: Fix linting errors
X-original-commit: 554f4871d913cc24decfff07b55f8d7bf80f89db
Part-of: odoo/odoo#84891
2022-02-18 14:29:29 +00:00
Yannick Tivisse 6ea9f4845f [FIX] website_crm_partner_assign: Copy lead geolocation to created partner
Purpose
=======

The module website_crm_partner_assign has its own partner_longitude
and partner_latitude values that are resolved independently, when the
linked partner doesn't exist yet.

So when a lead is turned into an opportunity and a partner is created,
the address info is copied to the new partner, but not the geolocation.

In case these partners are supposed to be geolocalized (for example
on the FSM application), the geolocation will be recomputed despite
the fact that this information was already available at the convertion
time.

closes odoo/odoo#84890

Related: odoo/enterprise#24517
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-18 14:29:21 +00:00
Yannick Tivisse dc3ad1381f [FIX] base_geolocalize: Partial revert of #84266
Purpose
=======

This @depends could be 'dangerous' because it would trigger a
lot of calls to the GeoIP API.

It would be more reasonable to make it lazy instead.

So we just reset the geolocation to 0 when the address is modified
without providing the new values, and the user can manually trigger
the geolocation again when needed.

For FSM, it will be updated when needed as the computation is
triggered when the geolocation information is empty.

Part-of: odoo/odoo#84890
2022-02-18 14:29:20 +00:00
root c33419cfd2 [FIX] sale: allow overriding portal domain
Before this commit the only way to modify the domain is to completely override portal_my_quotes/portal_my_orders.
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 same domain in two places.

closes odoo/odoo#84886

X-original-commit: ff50844da0e4423372746e767f482a2a71148be4
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-02-18 14:29:13 +00:00
Yolann Sabaux 61f429c274 [FIX] product: variant exclusion not taken into account
Steps to repoduce:
- Go to Sales - products
- Create a product
- Add variants (3 attributes and 2 values each) Total is 8 variants.
- onfigure variants: Select 1 attribute and exclude it for 1 variant (for example: exclude for size 12x12)
-> the number of variants remains at 8. The one that is excluded is still visible in the Product variants tab.

Solution:
When an exclusion is created, archive all the not-possible-combination.

OPW-2729329

closes odoo/odoo#84883

X-original-commit: 91642f4e29beb89d110084a20443fb300ee26530
Related: odoo/enterprise#24512
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 14:29:06 +00:00
Adrien Widart eb1ddbf115 [FIX] stock: compute replenishment info
The history of the replenishment info may be empty while it should not

To reproduce the issue:
(Set your device on January)
1. Process a delivery for product P
2. (Inventory > Operations > Replenishment, create a new one for P)
3. Click on the information icon (I) of the P's line

Error: The sales history does contain anything

When calling `relativedelta`, `month` is considered as an absolute value
and will replace the corresponding value while `months` is a relative
value and will be added/subtracted to the corresponding value.

OPW-2740123

closes odoo/odoo#84881

X-original-commit: c87fea0916b61cb4b0c37f3fe2ddad8359e6aeb2
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-18 14:29:02 +00:00
Arnold Moyaux 66179e552b [FIX] stock_picking_batch: new stock.move added to wave picking
Usecase to reproduce:
- Create a batch picking from a new location to customer
- Put some `stock.move.line` in a wave
- Validate the remaining of the initial `stock.picking`
- Create a new `stock.move` with the same data and without `picking_id`

Current behavior
The stock.move is added to the existing wave. However the
stock.move.line created could not match the current wave specification

Expected behavior
A new picking is created and it could be merge in the wave picking if
wanted

closes odoo/odoo#84875

X-original-commit: 4ea418ed1cceff4aee916cf791011a1dc67c77a1
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-18 14:28:59 +00:00
Arthur Detroux (ard) 283219f64e [FIX] website: use default website lang for configurator
The configurator introduced at [1] uses a frontend controller to
display its content. However this results in inconsistent language
translation as the python code uses the users's language but the
localization services uses the frontend's language when on a frontend
page.

Steps to reproduce:
- Create a database with the only language being french
- Install website
- In the configurator, all the pages will be in french except
  "Pages and Features"

With this commit, the language for the configurator will always be
the language of the website it's configuring. A test also make sure
that this is the current behavior.

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

task-2687416

closes odoo/odoo#84810

X-original-commit: a0f8fdc65566fafe98dab21f5c2dbab9505c3d5c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 14:28:53 +00:00
FrancoisGe d84cc6329a [IMP] web: onClose Command Palette
Adds the option to apply an onClose function when the Command Palette
closes.

closes odoo/odoo#84619

Related: odoo/enterprise#24356
Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-02-18 14:28:49 +00:00
Gorash 94c5caa4d6 [REV] website: revert commit ability to restrict groups on website menu
revert https://github.com/odoo/odoo/commit/b5091c7017a08806e2730765c14261408307aeec

fp asks to remove the groups on the menus to simplify the
model and allow the menu to be cached in the future. The user can change
the templates, use the big menu, add custom t-if, groups...

task-2737973

closes odoo/odoo#83505

Related: odoo/upgrade#3208
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 14:28:40 +00:00
Zelong Lin ec0109b7b2 [IMP] mail: add default explicitly in channel_create to be more clear
Specify 'channel_type' explicitly in channel_create. This makes the
method more clear and decoupling from default value.
Once the default values changes, the method can work as expected as well.

task-2767635

closes odoo/odoo#84867

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 13:26:55 +00:00
tsm-odoo 0862f2fab0 [IMP] mail, *: make mail module's beforeEach functions async
*: calendar, hr, hr_holidays, im_livechat, note, sms, snailmail,
website_livechat, website_slides.

This commit prepares the ground for the model definitions PR.
In order to reduce the noise, all mail module's beforeEach
functions will be made async.

task-2767820

closes odoo/odoo#84845

Related: odoo/enterprise#24489
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 13:26:49 +00:00
tsm-odoo 814140b227 [IMP] mail, *: glob patterns for test helpers in manifests
*: hr, im_livechat, website_livechat, website_slides

task-2767820

closes odoo/odoo#84842

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 13:26:46 +00:00
Alexandre Kühn 932116ddfd [FIX] mail,web: fix typo for oi-large icons
Large icons should use `oi-large` instead of `oi-lg` or `oi-2x`.

closes odoo/odoo#84838

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-18 12:29:09 +00:00
Paolo (pgi) 202264b4dd [FIX] hr_expense, hr_timesheet, l10n_sa_invoice: Adapting barcode API callers to the new API
The change in the `barcode` API has broken many callers.
This PR and the enterprise one will change 'type' -> 'barcode_type'

closes odoo/odoo#84722

See: https://github.com/odoo/odoo/commit/ee324e8374536cebca4d7302210b07e8f33d3852#diff-8f0bbb50491623995fba965c3d64585c6cbfdbbe519ec95473e472826d253826R1977-R1979
Related: odoo/enterprise#24430
Signed-off-by: William André (wan) <wan@odoo.com>
2022-02-18 12:29:00 +00:00
Benjamin Vray 952b2eb390 [FIX] website: gives acces to ir.asset to the website admin
Before this commit, the users with the "editor and designer" role no
longer had access to the theme tab options (and also other flows like
assets regeneration in debug mode, etc). This is because when the
website assets have been changed to be handled by ir.asset records, in
this commit [1], the "editor and designer" rights were not updated to
have an access to ir.asset.

After this commit, the users with the "editor and designer" role have
the rights to access ir.asset (read, write, create, but not unlink
because the admin does not need it).

This mimick what is done with ir.ui.view, which is way more critical
than ir.asset, so it should be relatively safe to add this right to the
website admin for assets, as it is already the case for views.

We could have added sudo() everywhere (as no need of a -u, and which is
less risky that adding rights directly through csv but the ir.asset
rights covers too many different flows to do so.

[1]: https://github.com/odoo/odoo/commit/8cc066173dfb61bd95b8e1f0716f71f4e251810a

task-2748004

closes odoo/odoo#84847

X-original-commit: e3515a7b73c3e173a3ddf0bc48e4a888024c8817
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 10:47:01 +00:00
Aurélien (avd) 34c192761f [FIX] mrp: speedup _post_inventory for MO batches
Rewrite _post_inventory to make it work better
with mo batches. This mainly improves the
time it takes to mark_as_done manufacturing
orders from the Workorders ListView.

stock.move._action_done is faster
when called outside of a for loop, i.e.
directly on self.

opw-2760394

closes odoo/odoo#84846

X-original-commit: 4cc6083ea1bd28be07e275322481ad11d8995d58
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-02-18 10:46:57 +00:00
qsm-odoo 8d591ee3e2 [REF] web, *: move the openhand.cur file to the right folder
*: point_of_sale, pos_restaurant

With [1], we introduced a cursor file for the grab icon in 13.0. It was
then forward-ported up to master... but it should have been adapted
starting from 15.0 as the 'img' folder of web moved around at [2].

This commit fixes that to not have two 'img' folders in web.
Unfortunately, [1] was not merged yesterday so we cannot really "fix"
the stable 15.0 version whose custo may already rely on that wrong
image location. So this fixes only master.

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

closes odoo/odoo#84837

Related: odoo/enterprise#24484
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-02-18 10:46:53 +00:00
dbkosky 1906584e02 [FIX] l10n_it_edi: import fattura pa expected singleton product error
Sometimes when importing products that share the same internal reference code (default_code) the _import_fattura_pa function will throw an expected singleton error. This is because, in order to find the product for the line of the invoice, it will search for the product reference code (e.g. [CONS_0001]), which is not necessarily unique.

I've set the limit to one on the search to fix the immediate error for
now, but I will add more logic to better search for the relevant product
in a future commit.

closes odoo/odoo#84826

Task-id: 2764978
X-original-commit: aae609915cb1f76c32c518ff8959674853633f55
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-02-18 10:46:47 +00:00
dbkosky 276cc1d647 [FIX] l10n_it_edi_sdicoop: fix bug where retry after notificaScarto does nothing
Set the l10n_it_edi_transaction value on the invoice to false after
receiving notificaScarto from the edi. This is so that the methods
associated with posting the invoice will detect it again and process it
for posting.

Task-id: 2764978
X-original-commit: 925fc0ff3914e83ddaac4fd5f6c1bdb7b4b2c68b
Part-of: odoo/odoo#84826
2022-02-18 10:46:46 +00:00
dbkosky 732f21dd71 [FIX] account_edi_proxy_client, l10n_it_edi_sdicoop: adapt config params to make use of the test iap server
This commit adapts the l10n_it_edi_sdicoop and account_edi_proxy_client
modules to make use of the existing config param
'account_edi_proxy_client.demo' in order to target the correct odoo iap
server for italian edi requests.

When the config param is set to:
'prod' or False (when the config param doesn't exist): Target the
production odoo iap server (by default), which submits and collects edi from the
production channel. Though if the config parameter
'account_edi_proxy_client.edi_server_url' exists, we use the value
provided there instead.

'test': Target the test odoo iap server, which submits and collects edi
from the test channel

'demo' or anything else not above: don't send anything, and simulate the
flow of italian edi submissions in odoo

task-id 2764978

X-original-commit: 32683b70a34a900a112d19bf780446a973753ae5
Part-of: odoo/odoo#84826
2022-02-18 10:46:46 +00:00
roen-odoo dbdccd99c5 [FIX] mail: Onchange error after done & schedule next activity
Current behavior:
In any chatter, if you schedule an activity then use the "Done & schedule next" options you had an error if you try to modify some fields of the record linked to the chatter.
For example in CRM you couldn't modify the probability after using "Done & Schedule next"

Steps to reproduce:
-Go in CRM
-Go on a lead page
-In the chatter schedule an activity
-Click on mark done and then on Done & Schedule next
-Try to edit the probabilty field of the lead
-You get an error : Record does not exist or has been deleted. (Record: mail.activity(x,), User: xx)

opw-2648685

closes odoo/odoo#84841

X-original-commit: b45f024e96e17790427ad12e7f201567db0a249b
Signed-off-by: Anh Thao PHAM <pta@odoo.com>
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-18 09:49:41 +00:00
Kevin Baptiste 3f106f216a [IMP] hr_holidays: open corresponding record on Time Off Analysis
Add a button to directly open the leave/allocation in the Time Off
Analysis view.

closes odoo/odoo#84729

Taskid: 2762014
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-18 09:49:37 +00:00
Brieuc-brd 3463583f1f [IMP] web: revamp pivot view
This commit simplifies the SCSS of the Pivot View.
It also adds the possibility to detect if the Pivot View is embedded in
another one (eg. if the view is embedded in the Dashboard view). This
last change was made to adapt the size of the Pivot table depending of
the context.

task-2731553

closes odoo/odoo#82575

Related: odoo/enterprise#23701
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-02-18 09:49:27 +00:00
Demesmaeker 8442ea9c1a [IMP] payment_adyen: allow splitting authorization and capture
Being able to first authorize then capture a payment has several
advantages:
- Confirm a quotation when the payment is authorized and capture it
  when the order is shipped.
- Review orders before capturing the payment.
- Prevent credit card fees in the case of a refund

This commit implements this feature for the payment acquirer Adyen.

task-2507304

closes odoo/odoo#70591

Related: odoo/upgrade#3088
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-18 09:49:20 +00:00
Yannick Tivisse 99f7e35fc3 [FIX] base_geolocalize: Disable geolocalize on update/test mode
Purpose
=======

Avoid making useless external requests.

X-original-commit: 6742e410e4c28a1cd24d1f7ea679a563db693f00
2022-02-18 10:19:08 +01:00
William Braeckman fcb5a0ed66 [FIX] hr_attendance: fix attendance report
This commit contains two fixes.
The first fixes the absence of a multi company rule for the attendance
report model.
The second fixes the wrong widget being used in the pivot view of the
attendance report.

TaskId-2765671

closes odoo/odoo#84668

Related: odoo/upgrade#3251
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-02-17 19:32:40 +00:00
Louis Baudoux b4c29da0d3 [IMP] account: add separate settings for digitalization and OUT invoices
The settings that determines the digitalization mode (disabled, manual
or automatic) used to be common for both vendor bills and customer
invoices.
As many users only want to use the service on vendor bills and not on
customer invoices, the settings has been split for both types of
invoices.

closes odoo/odoo#84184

Task: 2751408
Related: odoo/enterprise#24083
Related: odoo/upgrade#3240
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2022-02-17 17:37:58 +00:00
Demesmaeker 371c593422 [ADD] test_sale_product_configurators: test the product configurators
Before this commit, some tours from `sale_product_configurator` and
`sale_product_matrix` were not working since there wasn't a dependency
with `sale_management`.

They are now in a test module with all the other configurators and the
missing dependency.

Additionally, other tests are added to improve the coverage of the
configurators' logic.

task-2049081

closes odoo/odoo#82108

Related: odoo/enterprise#23199
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-17 17:37:51 +00:00
Odoo's Mergebot 8ac81e6cbe [IMP] website[_event|_crm]: clean website.visitors and consolidate information
PURPOSE

Consolidate information on a 'main' website.visitor when using multiple
devices / browsers.
Which in turn allows a much deeper cleaning of irrelevant and inactive
website.visitors instead of archiving them, saving a lot of DB space.

SPECS

This purpose is reached in 3 steps:

### First step

First move the concept of 'parent_id' of website.visitor into the 'website'
module.

The implementation of 'parent_id' was done in website_event because of stable
development requirements but it makes sense to move it to the website module.

### Second step

Then enforce the consolidation of all visitors information onto the
'main visitor'.

Visitors are linked when we are able to identify a single user through its Odoo
account. The browser where the last connection has been made will be linked to
the main visitor, other visitor records are linked to it through the parent_id
field.

When using multiple devices / browsers, we want to consolidate all the relevant
information on the main visitor, including:
- Created crm.leads
- Subscriptions to events
- Wishlisted tracks
- (Subscriptions to push notifications, done in enterprise counterpart)

Once we have clean visitor records containing necessary important information,
we can safely go ahead and modify the CRON cleaning inactive visitors to DELETE
them instead of archiving them, leading less database space required / improved
query performances.

### Third step

Clean now unnecessary code for wishlisted tracks.
This code was necessary when we had to keep track of all visitors and its
children records when there was only one push_token allowed per
website.visitor.

Now that a website.visitor can have multiple push subscriptions (see enterprise
counterpart), this code is no longer necessary, leading to better logic and
increased performances.

Check underlying commits for detailed information about those 3 steps.

LINKS

Task-2429652

closes odoo/odoo#65113

Related: odoo/enterprise#16781
Related: odoo/upgrade#2111
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-17 18:37:42 +01:00
Aurélien Warnon 8ba14334b2 [IMP] website_event_track: clean website.visitors wishlisted tracks
This commit is the community counterpart of the enterprise commit that
consolidates push tokens on website.visitors.

We now don't need to keep wishlisted tracks on children records of a
website.visitor and we can keep the whole wishlisted tracks list consolidated
on the parent only.

This allows some code cleaning and some simplification as well as a few
performance improvements.

Task-2429652

Part-of: odoo/odoo#65113
2022-02-17 17:37:41 +00:00
Aurélien Warnon a0d33b1c29 [IMP] website[_event|_crm]: unlink visitors when inactive & enforce linked visitors
PURPOSE

Visitors are useful in terms of marketing analysis but they can bloat the
database really quickly if you have a lot of traffic on your website.
This commit aims to relieve the database by fully deleting inactive visitors.

SPECS

On an active website, you can easily reach hundreds or even thousands of
visitors per day.
While active visitors are useful for marketing purposes, inactive ones were
archived after a period of inactivity (i.e: not connected for X days in a row,
where X is configurable as a parameter and 30 by default).

But archiving visitors is not really useful either.
We don't see any specific cases where you would want to restore some visitors.
That means we are better off unlinking the visitors completely to save database
storage space.

We want to make exceptions and avoid deletion of inactive visitors in some
cases:
- When they are linked to a partner (meaning most likely linked to a
  registered user)
- When they are linked to leads
- When they are registered to events

Several tests were added to ensure that leads matching these conditions are not
unlinked.

We also took this opportunity to enforce the "_link_to_visitor" rules in those
tests to make sure that:
- When visitors are linked, the leads are merged into the main visitor
- When visitors are linked, the event tickets are merged into the main visitor
- When visitors are linked, the wishlisted tracks are merged into the main
  visitor

This is also preliminary work for a commit that will move the push_token of
website.visitors to a separate table.
That will in turn allow us to link the push_tokens within the
"_link_to_visitor" method and delete the linked visitor instead of archiving
it.

LINKS

Task-2410217

Part-of: odoo/odoo#65113
2022-02-17 17:37:40 +00:00
Aurélien Warnon 0641cb20e8 [REF] website_event: move website.visitor's parent_id to website
The concept of 'parent_id' on website.visitors was introduced in the saas-13.3
stable while implementing the "event online" feature:
However, it should have been part of the website module from the start since
it's a 'global' concept that does not depend on events at all.
See #53540 for more details.

This commit aims to clean the code by moving the field to the website module,
which allows a nice cleaning of associated overridden methods as well.

Along with that, we move the website.visitor demo data from the event module to
the website module, allowing a fresh install of website to showcase some of our
visitors feature.

We also took this opportunity to do some minor improvements in the visitors
kanban view in order to make relevant information more visible.

Task-2429652

Part-of: odoo/odoo#65113
2022-02-17 17:37:40 +00:00
Merlin (megu) d6e774f8db [FIX] web: many2many tag always shows delete icon
The delete icon of many2many tags disappears when the text is too long
for the column

Steps to reproduce:
1. Install Invoicing
2. Open Invoicing and create a new invoice
3. Add any product (a tax should be added for that product) and reduce
the size of the 'Taxes' column until the tag is too long for the column
4. The tag's content overflows and the delete icon is not accessible
anymore

Solution:
Change \<span> element back to \<t>

Problem:
This commit https://github.com/odoo/odoo/commit/0915ac5a0e95ef9511559fded7cf1e149b19ce67
changed the element of `_badge_text` to \<span> which broke the
adaptability of the many2many tags

opw-2755293

closes odoo/odoo#84824

X-original-commit: d859c6328b3374b17f0b0be190ca62fe2597289d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-02-17 16:42:08 +00:00