Commit Graph
151522 Commits
Author SHA1 Message Date
Victor Feyens 131c19f2d8 [FIX] hr: settings user doesn't have access to hr.employee
The field pos_employee_ids (pos_hr) links hr employees records to 
settings records
but this model isn't readable for Pos Administrators by default.

This commit gives read rights on hr.employee model to settings users,
reusing a confusing existing ACL whose name targeted system users,
whereas the group effectively targeted was the internal users.

Since this rule didn't give any rights, we might as well correctly 
replace
it so that the name can match its purpose.

Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Victor Feyens 53f2cfac23 [FIX] point_of_sale: access to settings for non pos users
Part-of: odoo/odoo#91909
2022-06-23 23:48:31 +02:00
Victor Feyens d2fb479d31 [FIX] mrp: settings user unable to save settings
Settings user is not able to access Bill of Material (mrp.bom) records
unless they have additional groups (account, inventory, manufacturing, ...)

This commit makes sure the operation is done in sudo so that any setting user
is able to save the settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 1bd7c55b5d [FIX] point_of_sale: missing field in view
Now that settings views are only loaded for the ones able to see their content,
the field group_cash_rounding might not be present if a pos manager without
account manager rights opens the settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens d6c887f791 [FIX] delivery: settings user doesn't have access to delivery carrier
Since #87636, delivery carrier model is referenced in the settings when
website_sale_picking is installed.

Because of that, users with only settings access are not able to
open the settings anymore.

This commit adds read rights on delivery carriers so that base settings
users are able to update settings.

Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 9750a3c194 [FIX] sale_project: settings user doesn't have access to SOL
Part-of: odoo/odoo#91909
2022-06-23 23:48:30 +02:00
Victor Feyens 954c85dc96 [FIX] account: tests
It seems most accounting tests relied on the fact that the "accountman"
test user has both the user AND manager groups (but previously, the
manager group was given by the implied group relation "Settings" ->
"account manager")

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Victor Feyens 76d5879c1e [REF] *: clean settings views inheritance
* make sure xpath expression content is specified in parent view.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Victor Feyens fba6ea5a47 [IMP] *: do not force admins to be app admins
For bugfix purposes, app administration groups have been given to
(implied by) the "Settings" group because without those rights,
opening/saving the settings crashed.

1) Do not load hidden view content

This commit uses the conditional inheritance of views
(depending on user groups) to avoid loading unnecessary view
& record content client-side.

This improves performance for admins without the specific application
admin rights, but also fixes the main bugfix problem,
caused by the webclient querying name_get for the records in relational
fields content.

Example:

sale_management adds a res.config.settings field to specify
the default sale.order.template for the current company.

If a 'Settings' user without 'sale.group_sale_manager' opens the
settings, he won't see this setting, but if a default template is
specified for the current company, the webclient will still request
the name_get of this template to the server, because the field
was present in the view, only hidden with a groups attribute.

With this commit change in sale, the field won't be in the view unless
you have the Sale manager group, avoiding the error/traceback/bug.

2) Remove implied application administration groups

Do not force the specific application groups on all 'Settings' user,
they globally do not need those rights, and if they need it, they
can add it to their account themselves.

3) Add a test to make sure settings user are able to manage settings.

4) Enforce 'settings' -> 'access rights' -> 'internal user' groups

As the previous test highlighted some 'false positives' because
it considered a settings user unable to read `crm.team`
and `stock.warehouse` records, we also took the opportunity to enforce
the fact that 'Settings' & 'Access rights' users must be internal users.

It makes no sense for a portal/public user to have access to the
settings, and didn't work anyway.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Victor Feyens df613fad41 [FIX] website_sale: wrong view inheritance
the div with id auth_signup_documents is specified in the view
`sale.res_config_settings_view_form`, which is not a parent of
`website.res_config_settings_view_form`.

This led to an error during view rendering because of the changes in
the following commit, where the sale settings view is modified to be
only loaded for sale managers.

Part-of: odoo/odoo#91909
2022-06-23 23:48:29 +02:00
Florian Damhaut fda68f9e34 [IMP] payment_ogone: add possibility to use sha256
SHA1 is going to be deprecated by ogone.

This change try to keep current behaviour while adding the
possibility to use SHA256 and SHA512 via a Selection field
available in the developer mode.

opw-2766648

X-original-commit: b0df4af

See also:
- https://github.com/odoo/upgrade/pull/3490
- https://github.com/odoo/documentation/pull/1902

closes odoo/odoo#88628

Related: odoo/documentation#1902
Related: odoo/upgrade#3490
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-23 23:48:08 +02:00
Kevin Baptiste 69cc858937 [IMP] hr_skills: add default group by on reports
Add a default group by on the reporting views.

closes odoo/odoo#94177

Taskid: 2884672
Related: odoo/enterprise#28685
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-23 17:17:03 +02:00
Kevin Baptiste 45b175a18d [IMP] (hr_)fleet: usability changes (b2b)
Minor usability changes:

  * Reorganize menu to be more consistent with other HR apps;
  * Tweak several views;
  * Don't expire contract when date is set to Today - they will be
    automatically expired the next day;
  * Show contract name on form view.

closes odoo/odoo#92604

Related: odoo/enterprise#27919
Taskid: 2856135
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-23 17:16:57 +02:00
Alexandre de Pape (alpa) 112abd5b91 [IMP] website_sale: show comparison price on product page
add the compare_list_price to /shop, if there is a compare_list_price and a
price_list price for a product, the fixed_price will be displayed

task-2813257

closes odoo/odoo#90195

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-23 17:16:55 +02:00
Valentin Chevalier 4d2b04a843 [IMP] sale: improve sale flows
Rework and code cleanup of automatic invoice and auto-confirm order
flows.

task-2541188

closes odoo/odoo#72368

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-06-23 17:16:49 +02:00
Valentin ChevalierandDemesmaeker ae3bca08d3 [IMP] sale: make a method more predictable
Method: _find_mail_template()

Before this change, the method returned only the id of the template.
Now, it will return the template, as the method name suggests. Also, it
will simplify the method by avoiding complicated research into XML.

Code imported from #68965 that contained a new feature that was at last
abandoned.

Task-id: 2541188
Part-of: odoo/odoo#72368
Co-authored-by: Demesmaeker <edm@odoo.com>
2022-06-23 17:16:49 +02:00
Adrien Widart 5581c01ab8 [FIX] {purchase_,}stock: recompute orderpoints on SM's date change
Updating the scheduled date of a delivery doesn't update the quantity to
order of an orderpoint

To reproduce the issue:
(Need purchase)
1. Create a storable product P with a seller
2. Create and confirm a planned delivery D with 1 x P
3. Open the replenishment page
    - There should be a line for P (Forecast: -1, To Order: 1)
4. Edit D and postpone the scheduled date
5. Go back to replenishment page

Error: The line is still present, its forecast qty is correct (0) but
the quantity to order is still 1 (instead of 0)

`qty_to_order` is a stored field, so when loading the replenishment
page, its compute method is not called. Moreover, even though
`qty_to_order` depends on `qty_forecast` and the compute method of
`qty_forecast` is called, it still won't trigger the compute:
when setting the value of `qty_forecast` from its compute method, it
will lead to:
https://github.com/odoo/odoo/blob/b54f78de307543efcea934206806f361eaac811a/odoo/fields.py#L1106-L1109
So, as shown and explained, we bypass the `write` of `BaseModel` and
skip the business logic and the recomputations

The compute of `qty_to_order` should actually be triggered earlier: when
we edit the scheduled date (step 4). That's the reason why this commit
adds a dependency to the compute of `qty_forecast`: it makes more sense
and becomes an implicit dependency of `qty_to_order` -> update the
scheduled date will trigger the compute of `qty_to_order`

OPW-2868167

closes odoo/odoo#94400

X-original-commit: 791b68fc02cbc4dc5b376e5fc5d37e725f88d0dc
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-23 13:46:53 +02:00
Alexandre Kühn 3caac9399b [FIX] im_livechat: no unamed attachment on public livechat messages
Follow-up of https://github.com/odoo/odoo/commit/0c30945d364a8b986f0b48db28e42c7b355471e3
Commit above changed the message formatter in python,
so that `attachment_ids` now always return a list of field commands.

This work fine in backend code of discuss, but in public livechat,
it still uses legacy code. The legacy code do not support field
commands, so instead it thinks the command is data of an attachment,
thus showing an "unamed" attachment.

Actually attachments are not supported in livechat. Code had some
handling of attachments just because this was shared with the
backend in the past.

This commit fixes the issues by simply enforcing showing no
attachment in any message in public livechat.

closes odoo/odoo#94394

Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2022-06-23 12:28:58 +02:00
Louis Wicket (wil) 1e75bd3b61 [FIX] im_livechat: fix broken avatar in livechat
closes odoo/odoo#94389

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-23 11:16:14 +02:00
Nasreddin Boulif (bon) 77afe5c37b [FIX] sale: split method _is_add_to_cart_possible for override
This commit has as purpose to split the method `_is_add_to_cart_possible`
and put only the first part in another method so it can be overridden.

Issue:

The first part of the method _is_add_to_cart_possible check that the
product is active and can be sold.
The second part check if a combination is possible.

In sale_renting module, only the first part must be overridden since
second part is a common check to all product regardless if it
can or can't be sold or rent

opw-2879711

closes odoo/odoo#94373

X-original-commit: 99dc5a963002e887d5c4a9ad403e171b627d2e8a
Related: odoo/enterprise#28777
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-06-23 11:16:04 +02:00
Andrea Grazioso (agr-odoo) 75245f4765 [FIX] purchase_stock: wrong amount in price difference account
1. Activate anglo saxon accounting
2. Create product with automated inventory valuation and standard pricing
3. Set decimal accuracy to 6
4. Set product cost price to 0,01719
5. Create PO for 30.000 items -> price = 0,01782 -> total = 534,6
6. Receive goods -> stock journal entry = 515,7 (based on the cost, ok)
7. Create vendor bill

Price difference is incorrect if you have a tax rate in the vendor bill
`price_unit_val_dif` will be rounded to 0.02
Multiplied by a great quantity the result will be wrong (84.30)
Without using the tax rate the price difference amount is the expected one

This commit partially revert 643d91ef5ebfb29fde142294ced82c470d42c136
to improve the original fix.

opw-2849074

closes odoo/odoo#94346

X-original-commit: 315a18f12f9d67284bbd8b027ca652db17aae9d2
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2022-06-23 11:15:57 +02:00
Alexandre Kühn 634eb85a97 [IMP] mail, knowledge: mark Emoji(List) component as Legacy
This commit duplicates the components Emoji and EmojiList into
other components called "LegacyEmoji" "LegacyEmojiList".

We do this so that we can implement the new EmojiPicker in Discuss
code, without affecting the code of `knowledge` during development.

When the Emoji Picker is in a good state with just the scope of
feature of Discuss, then we can integrate this new Emoji Picker
in other modules, like `knowledge`.

Task-2890268

closes odoo/odoo#94254

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-23 11:15:54 +02:00
yhu-odoo 2dd9b0b77a [IMP] barcodes_gs1_nomenclature: add support to search with gs1
Provide a preprocess method to add support to search record with gs1
barcode.

Task-2648993

closes odoo/odoo#83462

Related: odoo/enterprise#23781
Signed-off-by: Steve Van Essche <svs@odoo.com>
2022-06-23 11:15:48 +02:00
Jérôme Hellinckx bc3ce2f6da [IMP] stock: Search by package in picking list
In the picking list view, allow to search pickings by package name/barcode.

task-2648993

Part-of: odoo/odoo#83462
2022-06-23 11:15:47 +02:00
Jérôme Hellinckx 047bfa7536 [IMP] stock: add ask-always-never setting for backorder
In picking type, we introduce a new setting ask-always-never setting for
creating backorder. When a backorder is needed, the behaviour will be
different according to this setting:
 - ask: popup a wizard to ask if a backorder is needed
 - always: generate backorder automatically
 - never: no backorder

The main reasoning behind this change is that there are some scenarios
in which operators always create backorders (e.g. by validating the
transfer after scanning a pallet and setting quantities). Hence, always
asking if the user (operator) wants to create a backorder can be confusing.

task-2648993

Part-of: odoo/odoo#83462
2022-06-23 11:15:47 +02:00
Adrien Widart c7c96d61e9 [FIX] mrp: apply source location of unbuild order on SM
When unbuilding a product, the selected source location is not applied
on the SM.

To reproduce the issue:
1. In Settings, enable "Storage Locations"
2. Create two storable products P_compo, P_finished
3. Update the qty of P_compo: 1 in WH/Stock
4. Create a BoM:
    - Product: P_finished
    - Components: 1 x P_compo
5. Process a manufacturing order MO with 1 x P_finished
6. Transfer the P_finished from WH/Stock to WH/Stock/Shelf 1
7. Create an unbuild order UO:
    - Manufacturing Order: MO
    - Source Location: WH/Stock/Shelf 1
    - Destination Location: WH/Stock/Shelf 2
8. Confirm UO
9. Open the associated product moves

Error: The SML of P_finished is incorrect, its source location is
WH/Stock instead of WH/Stock/Shelf 1 (as a result, the quants are
incorrect too).

The issue only happens with P_finished. The destination of the
components is correctly defined:
https://github.com/odoo/odoo/blob/90a87d6ecd420c61ea8db8a6c571db477ee7220e/addons/mrp/models/mrp_unbuild.py#L229
(i.e., we use the destination location of the unbuild order)

OPW-2869454

closes odoo/odoo#94367

X-original-commit: 45ec5871a1ee6e3a31e790323f08df20715f4171
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-23 10:15:12 +02:00
Adrien Widart e83120936d [FIX] sale_mrp: sell kit with dropshipped component
When selling a kit with a dropshipped component, the delivered quantity
will be incorrect

To reproduce the issue:
1. Create 3 consumable products P01, P02, P_kit:
    - P02:
        - Add a seller S
        - Enable the dropship route
2. Create a bill of materials:
    - Product: P_kit
    - Type: Kit
    - Components:
        - 1 x P01
        - 1 x P02
3. Create and confirm a sale order SO with 1 x P_kit
4. Confirm the generated purchase order (with vendor S)
5. Process the two pickings of SO
6. Go back to SO

Error: The delivered quantity of P_kit is 0 instead of 1

When computing the delivered quantity, because the `dropship` flag is
not set, we don't reach the revelant code:
https://github.com/odoo/odoo/blob/3db136f19480b31ca3f60a77c0c7354161bedde0/addons/sale_mrp/models/sale_mrp.py#L37-L44

OPW-2870893

closes odoo/odoo#94364

X-original-commit: fff6edad8cfb45b9a622bceefa4b83f620d7fe86
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-23 10:15:08 +02:00
Adrien Widart 92a049ecff [FIX] mrp: find child/source MO
When a MO is generated in order to supply another one, the smart buttons
"Source MO"/"Child MO" are still invisible.

To reproduce the issue:
1. In Settings, enable "Multi-Step Routes"
2. Enable MTO route
3. Edit the warehouse: 3-steps manufacturing
4. Create 3 stored products Super, Sub and Compo:
    - Sub has two routes: MTO and Manufacture
5. Create two BoMs:
    - For 1 x Super:
        - 1 x Sub
    - For 1 x Sub:
        - 1 x Compo
6. Create and confirm a MO with 1 x Super

Error: On confirmation, a second MO is created to produce one Sub, which
is correct. However, neither the first MO nor the generated one has a
link with the other one (through the smart button "Source MO"/"Child
MO")

When confirming the MO, a SM is created to bring one Sub to the
pre-production location. Thanks to MTO route, this will generate another
SM that brings one Sub from post-production to stock location (this will
lead to the creation of the second MO). However, the other SM (1 x Sub
from Post to Stock) doesn't have the same procurement group. This is the
reason why it is not found by the `_compute` methods.

OPW-2730830

closes odoo/odoo#94334

X-original-commit: 81e5ce05f2f79eb19489f00fb867143189fb38df
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-06-23 10:15:01 +02:00
Jeremy Kersten a6a83b6d62 [FIX] website: fix / optimize canonical url
Homepage was never considered as canonical due to the trailing /
domain.com/fr/ != domain.com/fr

Now _get_canonical_url_localized for homepage is fixed.

Remove all computation related to canonical that is usless for connected
user. It is mainly used for SEO tools/bots/crawler.

Initially planed for 13.0 with [1] but reverted with [2].

[1]: https://github.com/odoo/odoo/commit/33167b3928c767a08fdc7eedc3e6204aac9cac08
[2]: https://github.com/odoo/odoo/commit/deb23450f18196c7f8d9e819db603fccd407b82a

closes odoo/odoo#94289

X-original-commit: 375abe5e369b59a57b352d68d4835f2ef275b560
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-06-23 10:14:58 +02:00
debu-odoo 77c04ffee8 [IMP] mrp: improve wording/content in MO Report
- Change some section and column headers to make content clearer based on MO status
- Add in columns/field for in progress MOs for easier tracking of MO status
- Update words to match field names more closely (i.e. Actual Duration, To Consume, etc.)

Task ID - 2688146

closes odoo/odoo#93066

Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-06-23 10:14:54 +02:00
MerlinGuillaume 64fa6d8948 [FIX] stock: order stock.production.lot by name
Sorting the `stock.quant` by lot_id didn't work correctly

Steps to reproduce:
1. Install Inventory
2. Edit a product tracking to 'By Unique Serial Number' (e.g. Acoustic
Bloc Screens)
3. Go to Inventory > Overview > Receipts, create a receipt for 3
Acoustic Bloc Screens with serial number '05', '01' and '03' and
validate
4. Go to Inventory > Reporting > Inventory Report, remove the
'Group By' filters and sort the entries by Lot/Serial Number
5. The serial numbers are not properly ordered ('01' is between '03'
and '05')

Solution:
Order the `stock.production.lot` by name

Problem:
Sorting the `stock.quant` by lot_id used the id of
`stock.production.lot`

opw-2879464

closes odoo/odoo#94358

X-original-commit: 4c855bd3eeb7ffcebd76eb4eaa1e41edf2935021
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-06-23 09:00:37 +02:00
Kevin Baptiste 93ed43bcb3 [IMP] hr_org_chart: use flexbox
Use flex on the popover header to better handle long names.

closes odoo/odoo#94236

Taskid: 2888199
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-23 09:00:31 +02:00
Julien Van Roy c25f8d94e5 [FIX] account_edi_ubl_cii: fix edi options on journal
We only want the edi.format options to appear on the sale journals
(out_invoice, out_refund).

In addition, the warnings are no longer displayed on top of the invoice.

closes odoo/odoo#94376

X-original-commit: dca5a2844ef2e90c257b78add3e147b291a9fa18
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Julien Van Roy <juvr@odoo.com>
2022-06-23 07:59:59 +02:00
alt-odoo 1d3879b6df [FIX] account: allow billing user to register payment difference
Currently, the register payment button in the invoice form view is
accessible to any Accounting/Billing user. But in the payment register
wizard, the payment difference related fields are only visible for an
Accounting/Auditor user. This does not make sense as the auditor access
level is a read-only role, and there is no dependency between auditor
and billing rights. We should remove the group (as it is already
restricted in the access rights of the model) in the wizard to allow
billing users to use the functionality without the need for accountant
access rights.

closes odoo/odoo#94380

X-original-commit: 488bda480a38f9c09496f770be8a6f540c541044
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Alex Thuyls (alt) <alt@odoo.com>
2022-06-23 06:57:03 +02:00
Olivier Dony 038cdc66b9 [IMP] auth_totp: add trusted device method to validate user
Adds a variant `_check_credentials_for_uid()` for auth_totp.device's
`_check_credentials()`. The new method will directly verify the device
key matches the given uid.

This spares the redundant uid comparison on the caller side, and
allows extension modules to customise the user/device matching logic.

closes odoo/odoo#94365

X-original-commit: 0e266eb3c73409950d1eb160c41eb6668d439856
Signed-off-by: Olivier Dony <odo@odoo.com>
2022-06-23 02:05:42 +02:00
qsm-odoo b53feba3d0 [FIX] website: fix typo in snippets_all_drag_and_drop test
The test was introduced in [1] with a typo on the first step (which is
only there to ensure the test does contain steps).

Note: with the 15.1 forward-port, the "number of steps" check had to be
adapted because snippets were removed at [2]. This reveals however two
issues:
- Snippets which use the generic "Dynamic Snippet" as base are not
  tested by the test.
- [2] removed the s_speaker_bio snippet by mistake

Both those problems will be fixed in other PR alongside improving the
way the "number of steps" check works.

[1]: https://github.com/odoo/odoo/commit/460d5ecb926c13a79ba363f8f86442433d91bf6f
[2]: https://github.com/odoo/odoo/commit/b5c87d86cad1aa2b44f805da0b2d6635aeb85b96

closes odoo/odoo#94359

X-original-commit: 8e6a6ab532637ef9ef8d87ca4062e26b2852825a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-06-23 00:57:46 +02:00
Alexandre Kühn a008d8c078 [IMP] im_livechat, *: Refactor JS Public Livechat (step 4)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2892367

closes odoo/odoo#94347

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-22 19:33:01 +02:00
Piero (pca) b6c12771d9 [FIX] purchase_stock: restrict recomputation of qty_received_method to unconfirmed POs
This commit adds a search restriction on _compute_qty_received_method which will prevent the received method field from recomputing on orders that have already been finished.

This method is only called on the installation of this module and is used to update order lines of consumable products to use the standard computation of stock moves. In cases where purchase orders were completed ahead of this module's installation, this method effectively undoes all received quantities and resets them to zero. In orders that were already confirmed and billed, this displays the order lines with zero received quantities and no way to functionally change it.

opw-2854810

closes odoo/odoo#94325

X-original-commit: 849a561ebb26e7dca9018c6f81b8492ef21d7a7a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-06-22 18:26:56 +02:00
tsm-odoo e97214ff4e [IMP] mail, *: remove createMessagingMenu during tests
*: im_livechat, test_mail, test_mail_full.

The createMessagingMenu helper was used during tests to mount
the messaging menu and test it. However, this approach is not
very realistic and blocks some waiting PRs. In order to get closer
from the reality, let's instanciate a webClient and a systrayService
for the messagingMenu to be present at all time.

closes odoo/odoo#94301

Related: odoo/enterprise#28747
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-22 16:32:42 +02:00
Benoit Socias 3fd430bf8e [FIX] web_editor: restore finding attachment image info
Since [1] the attachments are not found by `get_image_info` anymore
because the search based on the id only does not specify the model.
Because of this the mimetype of uploaded images is not put in the DOM
image's dataset. This lack of mimetype prevents the Shape, Filter, Width
and Quality image options from being used.

This commit defaults the model to `ir.attachment`.

Steps to reproduce:
- Drop a "Text - Image" snippet.
- Replace the image by uploading one.
=> The Shape, Filter, Width & Quality options did not appear anymore.

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

task-2883695

closes odoo/odoo#94288

X-original-commit: 99fda1024ff7d809f13523acd13770c02a49d1e1
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-22 14:28:56 +02:00
thcl-odoo 75416b03a7 [FIX] hr_expense: fix expense total computation
Current behavior :
The amount shown for an expense is equals to 0 instead of the real price.

Steps :
- Install Expenses, Accounting
- Create an expense and finish the flow (register payment included)
- In Accounting app, go to Vendors > Payments
- In this view, amount is equals to 0 but the amount is correct in individual view

Note :
Since this commit [1], `expense_id` is added on move.line so that
`_payment_state_matters` now returns True [2]. We are now entering this
condition [3].

This causes some issues when recording payments for our expense.
Indeed, the 2 lines (credit + debit) enter this condition [4] but debit line
should be treated by this block [5] otherwise the 2 lines cancel each other out.

Solution :
Add `exclude_from_invoice_tab = True` receivable/payable expense payment lines

[1] : odoo@1645995#diff-5bee371350ae80995abbea23e800bfb1c52f968db6c9dc59f2681ac415d34103R27-R28
[2] : https://github.com/odoo/odoo/blob/1e3a9c90908f37d19f4aa1bbcb81568dea9fd451/addons/hr_expense/models/account_move_line.py#L9-L13
[3] : https://github.com/odoo/odoo/blob/d6ca59ed9bf6877ee6b1b311223472adfa4db549/addons/account/models/account_move.py#L1419
[4] : https://github.com/odoo/odoo/blob/d6ca59ed9bf6877ee6b1b311223472adfa4db549/addons/account/models/account_move.py#L1422
[5] : https://github.com/odoo/odoo/blob/d6ca59ed9bf6877ee6b1b311223472adfa4db549/addons/account/models/account_move.py#L1434-L1438

OPW-2838105

closes odoo/odoo#94259

X-original-commit: a6b8feabcb2323edf7ca24d3e96e6cb7f420fcc9
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-22 14:28:49 +02:00
Lucas Perais (lpe) 2cafc7be88 [REF] web, base, website_sale_loyalty: remove unnecessary flags on action
action act_window can have a "flags" field which contains tweaking parameter for the views.
A little inventory:
- ation_buttons: if true displays on List and Kanban the buttons that trigger action
  in the control-panel bottom left area. It is true by default in JS.
- withControlPanel: whether to display the ControlPanel as a whole. True by default.
- search_view: not used or dealt with.
- mode ("readonly"|"edit") whether to initiate a form view in that mode.
  (used and practical -- but will be outdated when the edit mode by default is implemented)

This commit removes the occurences of those flags keys that are useless

closes odoo/odoo#94078

Related: odoo/enterprise#28620
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-06-22 14:28:43 +02:00
Aurélien Warnon 0532a00d94 [FIX] im_livechat: correctly handle closed conversations
Currently, when the visitor closes the chatbot conversation, the script keeps
running as there is nothing in the code to tell it to stop.

Which can cause issues, because the visitor is still able to "post" messages
through the rating, which will trigger the next step of the script.

Even though the user cannot see those messages and bot reactions, we should
still correctly end the script when the conversation is closed.

Especially since the visitor can ask to receive the conversation by email, and
we don't want him too see that the script wrongly continued.

Task-2882341

closes odoo/odoo#94234

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-22 13:24:14 +02:00
Aurélien Warnon 623c8860f1 [FIX] im_livechat: fix chatbot edge case when talking to yourself
When testing the script and being logged in, a very edge case can happen when
we try to find a human operator and find "yourself" as a suitable operator.

In that case, act as if we did not find anyone.

Otherwise, the display gets strange as the bot adds "yourself" as an operator
but still acts as if he did not find anyone since there is only one person in
the conversation.

Task-2882341

Part-of: odoo/odoo#94234
2022-06-22 13:24:13 +02:00
Laurent Smet 38e4a5fbc3 [FIX] base: Fix PDF generation
Suppose we are printing a PDF on multiple records but having some of them excluded during the _prepare_html.
So, suppose these records are [20, 21].
If [21] is excluded during the rendering because nothing to render, the resulting html will contains only [20].
That is leading to a traceback when checking the outlines because of

assert len(outlines_pages) == len(res_ids)

This commit avoids to check the outlines if we don't care about generating attachments.
Then, we don't need to split the PDF in that case.

closes odoo/odoo#94204

X-original-commit: 210e63ab8b036bd20c68b1e03462c75af12aa326
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-06-22 12:15:03 +02:00
Pierrot (prro) 9773469bb3 [IMP] account: improve Journal Items list UX
Some more iterations for improving the Journal Items list UX.
- Added a searchpanel on accounts
- Added the column Residual in Currency
- Dropdown list on account edit
- Added the Residual column

closes odoo/odoo#94076

Related: odoo/enterprise#28644
Related: odoo/upgrade#3612
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-06-22 12:14:52 +02:00
Odoo's Mergebot b725981505 [IMP] web,crm: revamp mobile kanban implementation
This PR main purpose is to revamp the grouped Kanban implementation on mobile to provide a more responsive, smoother and closer to the desktop functionalities experience for the user.

In a nutshell:
- columns are displayed individually ; an horizontal scroll allows to
  switch to the other ones, "snapping" to the column (aka. carroussel-like).
- each column takes 90% of the viewport's width to give a hint of its
  siblings.
- each column scrolls (vertically) individually to avoid being lost when
  switching from one column to another.
- folded columns are "virtually unfolded": they takes the same space as
  the other ones, but content is loaded on-demand.
- some configuration modals are fullscreen for ease of use.

Also, in this PR, the WebClient's layout has been standardized between Community and Enterprise to ease the maintenance and avoid redundancy.

Part of the SCSS revamp task-2704984

task-2883057

closes odoo/odoo#94134

Related: odoo/enterprise#28652
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-06-22 11:05:21 +02:00
Pierre Paridans 2dd37982e6 [IMP] web,crm: revamp grouped kanban mobile implementation
This commit revamps the grouped-kanban implementation for smaller
screens (aka. mobile) by making it more "responsive" and avoiding
mobile-specific variation. It makes the implementation simpler and
closer to what the user expects from the desktop version.

In a nutshell:
- columns are displayed individually ; an horizontal scroll allows to
  switch to the other ones, "snapping" to the column (aka. carroussel-like).
- each column takes 90% of the viewport's width to give a hint of its
  siblings.
- each column scrolls (vertically) individually to avoid being lost when
  switching from one column to another.
- folded columns are "virtually unfolded": they takes the same space as
  the other ones, but content is loaded on-demand.
- some configuration modals are fullscreen for ease of use.

Part of the SCSS revamp task-2704984

task-2883057

Part-of: odoo/odoo#94134
2022-06-22 11:05:20 +02:00
Pierre Paridans fbf7232edc [REF] web: standardize webclient layout
This commit refactors the WebClient's layout definition to avoid
differences and redundancy between Community & Enterprise editions.

This would ease the maintenance by streamlining both implementation,
keeping them closer. It also allows to have more similar scrolling
handling by default:
- on desktop: `o_content` is the action scroll container (no change)
- on mobile: `o_action` is the action scroll container (down from `html`
  node, to keep the navbar)

Part of the SCSS revamp task-2704984

task-2883057

Part-of: odoo/odoo#94134
2022-06-22 11:05:20 +02:00
Ivàn Todorovich 0822e8c867 [IMP] mrp: use prefetch for recursive quantities computation
This commit achieves two things:

1) Avoid calling super() on an empty recordset, in case all products
   are kits. Even on an empty recordset, some queries would be fired.
   This commit avoids them.

2) Use prefetch to read kit components quantity fields, to make use
   of the recorset optimizations that ends up saving sql queries.
   Otherwise, component quantities were computed on-demand one by one.

closes odoo/odoo#94225

X-original-commit: ef4ae7f62d6b690b4745b4145ce25ff02b6b29f6
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-06-22 09:58:40 +02:00