Commit Graph
153376 Commits
Author SHA1 Message Date
aliya 514ff773a2 [IMP] account, base_import: improve accounting import
- Remove FEC from res.config.settings - everything is now linked in the import guide (in enterprise)
- Compute debit and credit from opening_balance
- Update import templates for account.account, account.move, res.partner
- Small UI changes in base_import: add an action title and improve the template button design

task-2888243

closes odoo/odoo#96291

Related: odoo/enterprise#29627
Related: odoo/upgrade#3794
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
2022-08-26 17:16:52 +02:00
svs-odoo 81c801c894 [IMP] mrp: BoM overview button in forecast report
In the product's forecast report, if the product has a BoM, a button is
displayed to go to the BoM overview report.

task-2628323

closes odoo/odoo#93194

Related: odoo/enterprise#28191
Related: odoo/upgrade#3686
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-08-26 17:16:42 +02:00
clesgow 2b2a7712e1 [IMP] mrp: Add automatic Days to Prepare MO
Since the new Overview report can compute the lead days and availability
delays from a BoM and all of its components and/or subassemblies, we can
use this data to compute the days that would be required to resupply all
components from a BoM.

So we add a button to compute it directly on the product form.

Task-2628323

Part-of: odoo/odoo#93194
2022-08-26 17:16:42 +02:00
clesgow a974290237 [IMP] mrp_subcontracting_purchase: Buy route for BoM Overview
Add additional requirement to identify buy route in BoM Overview report
if mrp_subcontracting is installed to not get confused between the two
cases.

Task-2628323

Part-of: odoo/odoo#93194
2022-08-26 17:16:42 +02:00
clesgow 5e2d48fbfa [REF] mrp_subcontracting: Adapt subcontracting for BoM Overview
The 'Structure & Cost' report has been changed to 'Overview', changing
some of its functionnalities. The override previously done in
mrp_subcontracting must be adapted to match the changes done in the mrp
module.

Also, the report has been converted to OWL in the process, requiring
changes in the overriden files as well.

Finally, the now obsolete code only related to the old 'Structure &
Cost' report has been removed.

Task-2628323

Part-of: odoo/odoo#93194
2022-08-26 17:16:41 +02:00
clesgow 42f1d31130 [IMP] purchase_mrp: Buy route for BoM overview
Add support for "buy" route recognition in the BoM overview report, as
well as calculating receipt delay for this kind of route

Task-2628323

Part-of: odoo/odoo#93194
2022-08-26 17:16:41 +02:00
clesgow 02cd750da6 [REF] mrp: change BoM Structure&Cost into Overview
Changes "Structure & Cost" report to "Overview", as the goal for this
report is improved.

The point is to have on a single report all components and sub-assemblies
that make it up, in parallel with the route and lead times associated to
each. This way it becomes easier to identify issues, such as:
- Missing routes.
- Longer lead times on a specific sub-assembly.
- Unavailable component in the foreseable future.
- ...

Also did the conversion to OWL, changing drastically the structure of
the report.

Task-2628323

Part-of: odoo/odoo#93194
2022-08-26 17:16:41 +02:00
Odoo's Mergebot a6791e3b95 [IMP] web_editor: handle advanced table edition
This adds many improvements to table editing in Odoo Editor, as well as some styling improvements.

New features :
- Rectangular cell selection
- Changing the color of a cell
- Buttons to add/remove/move rows/columns
- Resize rows/columns

task-2858455

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#92200

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-26 17:16:34 +02:00
Antoine Guenet f35f62599d [REF] web_editor: remove add(Row|Column)(Left|Right|Above|Below)
The commands to add rows and columns in certain positions were
superfluous as commands to add rows and columns suffice if you pass them
a position argument.

Part-of: odoo/odoo#92200
2022-08-26 17:16:33 +02:00
Antoine Guenet aca5aea475 [FIX] web_editor: prevent triggering color_leave after color_picked
When the user picks a color, the colorpicker closes, triggering
color_leave. This is conceptually wrong and can cause issues as it
reverts the current history step.

Part-of: odoo/odoo#92200
2022-08-26 17:16:33 +02:00
Antoine Guenet 7a64a04421 [ADD] web_editor: add UI for tables
This adds a menu to manipulate table rows and columns when hovering
over them. Hovering over the first row shows the menu for the hovered
column.
Hovering over the first column shows the menu for the hovered row.
The buttons in the menu allow the user to add/move/remove rows/columns.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:32 +02:00
Antoine Guenet aaea489f6d [ADD] web_editor: apply colors to whole selected table cells
With this, when whole table cells are selected and the user picks a
color in the toolbar's colorpicker, that color is applied to the whole
cell rather than to the text only.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:32 +02:00
Antoine Guenet f3cff78472 [ADD] web_editor: allow drag and drop table resizing
This allows the user to grab table borders in order to resize its rows
and columns.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:32 +02:00
Antoine Guenet d8ec51f47a [ADD] web_editor: when hovering a table border, use the resize cursors
This adds the feature of showing the appropriate resize cursor depending
on which border (vertical or horizontal) is hovered in a table.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:32 +02:00
Antoine Guenet 3d9be78fbc [ADD] web_editor: support gdocs style selection in table
This adds the possibility to select whole cells, rectangularly rather
than line per line from left to right then top to bottom.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:31 +02:00
Antoine Guenet 7da2b1f2a8 [FIX] web_editor: properly size new rows added with TAB
New rows added with TAB in a table were missing a <br> in each cell,
making them appear less tall.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:31 +02:00
Antoine Guenet 3da301fcb2 [IMP] web_editor: change selection color in editable
Update the blue text selection color to #bad3fc.

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:31 +02:00
Antoine Guenet 68999cd95f [IMP] web_editor: restyle tables in editor
- reduce the default row height to get a padding of .5rem instead of .75
- use a darker grey for table border color

task-2858455

Part-of: odoo/odoo#92200
2022-08-26 17:16:31 +02:00
Antoine Guenet d3d4443e13 [FIX] web_editor: always apply checklist class on convert p to checklist
When converting a paragraph to a checklist, we first apply the checklist
class and then take the paragraph's attributes and apply it to the new
list. If said attributes included the "class" attribute, it wrote over
the checklist class.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Antoine Guenet d2200e1088 [FIX] web_editor: trigger selectionchange in tests
When the editor's test utils set the selection, they did not trigger the
selectionchange event, which means the editor's listener didn't get
called.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Antoine Guenet 2b7b279218 [FIX] web_editor: prevent wrong DOM operations when editable not in DOM
`getDeepRange` fetched a range on potentially the wrong document and
`getTraversedNodes` created a node iterator on potentially the wrong
document, when the editable was not in the DOM.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Antoine Guenet 49de251a7b [FIX] web_editor: ensure editor is properly destroyed after each test
If an error was thrown during a call to `testEditor` (eg, a test
failed), we never went through the code that destroys the editor and
cleans the DOM. This catches any error to throw it only at the end of
the function.

Part-of: odoo/odoo#92200
2022-08-26 17:16:30 +02:00
Sébastien Geelen (sge) d32a8c53c2 [IMP] web,web_editor,mass_mailing,sms: new dynamic placeholder
Introduce a new Dynamic Placeholder Generator
in mass mailing and SMS creation.

Using a specific character (#) in subject or via the PowerBox in body
we open a field selector popup, which can be use to select
the wanted field and enter a default value. on validation, the dynamic
placeholder will be inserted in the corresponding input/editable.

task-2154624

closes odoo/odoo#71878

Related: odoo/enterprise#30333
Related: odoo/upgrade#3766
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-26 17:16:10 +02:00
Sébastien Geelen (sge) 7587f50140 [FIX] web_editor: more robust getRangePosition
Ensure getRangePosition do not crash if
the current selection is collapsed.

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:10 +02:00
Sébastien Geelen (sge) 09be8678bb [FIX] web_editor: fix t-out support
Ensure <t-out> tag inside the editable area are
not considered as no content or empty.

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:09 +02:00
Sébastien Geelen (sge) 1a82c91524 [IMP] mail,sms,mass_mailing_*: remove dynamic placeholder tab
We remove the existing dynamic placeholder generator tab,
in mail and sms creation views.
In preparation of the implementation of a new way to generate
the dynamic placeholders

task-2154624

Part-of: odoo/odoo#71878
2022-08-26 17:16:09 +02:00
Laurent Smet 8295bd1ba0 [FIX] account: Fix demo data for matching rules
Fix a bug introduced by:
https://github.com/odoo/odoo/commit/4b23d11184be9bac5ef9790cc7f38bc4d637b47a

Since this commit, the matching rules's regex "BRT: ([\d,]+)" that was matching "BRT: 100,00" is no longer matching "BRT: $ 96.67".

closes odoo/odoo#98698

Related: odoo/enterprise#30490
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2022-08-26 11:51:40 +02:00
Laurent Smet 8f7fe1aeb3 [IMP] account: Add link to statement lines used to match a payment
On the bank reconciliation widget, we need to open the statement line matched with the payment.

Part-of: odoo/odoo#98698
2022-08-26 11:51:39 +02:00
Abdelouahab (abla) b342fe8460 [FIX] project: grouping by date_deadline access error
To Reproduce
=============

- share a project with a portal user (with editing rights)
- connect to portal with this user and try to group tasks by deadline

Problem
=======

An access error is raised stating that this user doesn't have right to read
`deadline_field:week` field.

The issue comes from this line :
https://github.com/odoo/odoo/blob/42cb8ad0a31162d9d1b93e4eae0562c89685fe3c/addons/project/models/project.py#L1621

where `fields` contains `date_deadline:week` but `self.SELF_READABLE_FIELDS` contains `date_deadline`
that's why `date_deadline:week` will remain in `unauthorized_fields` .

Solution
=========

To solve the issue we take only the field name from the groupby when computing `fields_list` that
will be checked by `_ensure_fields_are_accessible`

opw-2949047

closes odoo/odoo#98953

X-original-commit: 1d0a62d0d235a4f0686e17033bb9d144d5583907
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: abla001 <abla@odoo.com>
2022-08-26 08:07:55 +02:00
jbw 62a5af923a [FIX] account: take sequence_override_regex int account when resequencing
Before this fix, resequencing would use values from _get_sequence_format_() run from an empty model.
This method result is influenced by the sequence_override_regex param of the move journal.
This means that if the journal of the moves that are resequenced has a sequence_override_regex param, it will be ignored in the wizard.
This fix run the _get_sequence_format_() method on the first move to take the journal into account.
Note that the wizard only allows resequencing moves from one same journal.

closes odoo/odoo#98926

Task: opw-2825699
X-original-commit: b22c37a5f173161b4a5f798462ea05142bb9334a
Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-26 06:55:46 +02:00
qsm-odoo 06e93c2489 [FIX] web: prevent wrong date format if picker used too soon on frontend
If datetimepickers were used too soon after page loading, they would use
the wrong format and UI options as the code in charge of initializing
those options was not fully lazy loaded yet.

With this patch, we prevent the tempusdominus lib to consider pickers
that are in a body that is marked by the lazyloader during the lazy
loading of JS files. We could potentially not add the lib attribute
(data-toggle="datetimepicker") on those elements and let the business
code initializing the pickers add it but that would not have been a
stable fix and it may be better this way as this works generically.

opw-2944720

closes odoo/odoo#98917

X-original-commit: 7e012340d3adcd64e829a5dca34173da24d649bc
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-26 06:55:43 +02:00
Audric Onockx (auon) 2d0e0bff45 [FIX] project: display partner_id dropdown
Steps :

In a ONE company environment,
\- Go to Project Task list view.
\- Display 'Customer' column.
\- Select multiple records (multi-edit).
\- Click on a 'Customer' cell to display the dropdown list.

Issue :
Traceback : company not found.

Cause :
partner_id's domain refers to company_id,
which is not present in the vue if not in multicompany.

Fix :
Add it in ivisible.

closes odoo/odoo#98913

Signed-off-by: Xavier <xbo@odoo.com>
2022-08-26 05:40:10 +02:00
Adrien Widart 4ee5df7660 [FIX] sale_mrp: decrease kit quantity after the delivery
When decreasing the SOL qty, if the SOL product is a kit and if the kit
has already been delivered+returned, an additional and useless return
will be created

To reproduce the issue:
1. Create two products consumable products P_kit, P_compo
2. Create a bill of materials:
    - Product: P_kit
    - Type: Kit
    - Components: 1 x P_compo
3. Create and confirm a sale order SO with 4 x P_kit
4. Process the delivery
5. Process a return with 1 x P_compo
6. Edit SO:
    - Quantity: 3 (instead of 4)

Error: once the SO is saved, a second (and useless) return will be
created

When updating the SOL quantity, we try to adapt the pickings. To do so,
we first get the quantity that is currently in delivery, then we compute
the difference between that quantity and the new SOL qty. Eventually, we
create a procurement based on that difference.
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L553
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L573-L578

In case of a kit, the "in delivery" quantity is too simply computed: we
return the old SOL qty (see diff). So, in the above case, we have:
- In delivery : 4
- New sol qty : 3
- Difference : -1

That's the reason why a new return is created, to fulfill the
difference.

We could apply a smarter computation of the "in delivery" qty thanks to
a mix between the computation of the delivered quantity of a kit:
https://github.com/odoo/odoo/blob/e85de8f2d342ac1e69d8eb4020dbb2d4c69ad90b/addons/sale_mrp/models/sale.py#L111-L118
and the way we compute the "in delivery" quantity for a non-kit product:
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L501-L504
https://github.com/odoo/odoo/blob/e11dfa341baf82fedee753502aef5ef2972f75cb/addons/sale_stock/models/sale_order.py#L511-L515

Note: if the kit has several components, and if the user does not return
an entire kit, a similar issue will occur. That's the reason why this
commit solution is smarter than the current code but is not the
smartest. For such a use case, we would need a bigger
solution/refactoring (handle the components one by one instead of the
kit for the quantities and the procurements)

OPW-2917209

closes odoo/odoo#98899

X-original-commit: 9649e1031df60c5ba60424e9fbcf7187f6783b5c
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-08-26 05:40:04 +02:00
Sébastien Theys 4b2bd7b16f [FIX] mail: fixes various issues introduced by recent changes
- fix typo in model manager: "return" -> "continue" in loop
- fix typo in model field: "models" read from record not from field itself
- fix reading obsolete fields in message view
- move listeners on records directly rather than storing a map on model manager
  (code a bit easier to read, and issues on deleted records easier to debug)
- remove obsolete trigger of listener in _created (not possible to observe a
  record before it exists)

closes odoo/odoo#98892

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:22 +02:00
Alexandre Kühn 14f2a03c75 [FIX] im_livechat: guard Chatbot/data (i.e. chatbot being available)
Task-2962136

closes odoo/odoo#98848

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:20 +02:00
Alexandre Kühn 357b4437f7 [FIX] website_livechat: introduce Visitor/serverCountry
Fixes a traceback due to Visitor/country being a computed field
that is imperatively updated by server data.

Task-2962126

closes odoo/odoo#98847

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 03:43:17 +02:00
Odoo's Mergebot 2dd7c57c04 [MERGE][PRF] mail, various: improve performance of activities
PURPOSE

Improve performance of activities creation and management. Improve overall
code.

SPECIFICATIONS

Main code changes are
  * classify activities by model, to browse related records in batch per model
    instead of one by one;
  * rewrite create and _action_done main methods to be done in batch;
  * skip useless computation (use categories before browsing records, avoid
    useless ref / direct xml ID check, ...);
  * globally batch when possible;

See sub commits for more details.

LINKS

Task-2884301 (Voip synchronization simplification)
Task-2883589 (Activity creation performance)

closes odoo/odoo#93682

Related: odoo/enterprise#28421
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-26 03:43:01 +02:00
Thibault Delavallée 8f5943269f [PRF] test_mail: update counters
Update counters after all previous performance commits. It is done as a single
update due to frequent conflicts and difficulty to keep updated counters for
each commit separately.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:43:00 +02:00
Thibault Delavallée 846d66ae9d [PRF] mail: improve check assignment by doing it in batch
When assigning activities to people we check target user has the rights to
access to document. Otherwise they end up with notifications and activities
for records they can't see.

This code is currently a loop doing browse and access checks one record
at a time. We improve it by grouping activities by related record model
and target user, allowing to batch some calls.

Note that this somehow reverts odoo/odoo@c38a0d6768 and odoo/odoo@a98c15f443
as normally odoo/odoo@16351e4879 should be sufficient to handle MC use
cases. Lack of clear unit tests for those corner cases make it difficult to
clearly reproduce issue anyway.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:43:00 +02:00
Thibault Delavallée 33d7ea6fb8 [PRF] mail: improve performance of closing activities
MailActivity model has an ``_action_done`` method that is quite heavily
used and overridden. It notably posts messages, create next activities but
also has some specific behavior depending on category.

Purpose of this commit is to improve code of this method to avoid useless
queries, improve performance, and rethink the computation with batch in
mind.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 17b8d7062c [PRF] mail: improve batch creation of activities
Purpose of this commit is to improve batch creation of activities by trying
to group checks by user and/or model when possible.

Notably

  * subscribe partners in batch when several activities are assigned to the
    same user (use case: batch assign on leads, users may be assigned on
    several records in a single udpate);
  * check in batch access on partners;

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 115f5663f1 [PRF] mail, note: improve default activity type computation and remove useless ref
Change some ``ref`` to low level method ``_xmlid_to_res_id``. The latter one
does not call exists, which allows to gain one query that we do not need
here.

Default methods on activity / activity mixin to find the default activity
type (todo, model-based, generic) are cleaned. Notably code was duplicated
between mixin and activity, it now always call the same code.

Remove an unnecessary ref, probably a leftover of new rendering methods on Qweb.

Remove an unnecessary sudo.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 9aa934e683 [PRF] mail: send activity bus notifications in batch
No need to send bus notifications one by one, we may use sendmany. Various
activities crud methods send notifications, better group them when possible.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:59 +02:00
Thibault Delavallée 0a380fec77 [PRF] mail: create activities in batch in activity mixin
Improve performance by batching activities creation through the mixin. This
helps saving some queries.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 3aa938cc05 [IMP] mail: add helpers to order/group activities
Purpose is to add helpers on activity model, notably to ease batching based
on models. As activities are linked to records using a res_model / res_id
pair most code is not optimized (checking records one by one). Purpose of
this tool is to ease doing computation by batch of models.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 6bea3c7605 [IMP] mail: return generated records in mail composer
We now return generated records when calling ``_action_send_mail`` on mail
composer. This allows to have access to generated emails (in mass mode) or
posted messages (in comment mode). Otherwise we have to access sub-fields
like activity_ids / message_ids, which may be inefficient or generate extra
ACLs checks.

Also replace some |= with += when usage of OrderedSet is not necessary. To
keep ordering, ordered sets are used when doing an or between record sets.
However in some cases we know we are simply adding records not already in
a previous record set, meaning we can just use +.

Task-2883589 (Activity performance and cleaning)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Thibault Delavallée 3cc931ef58 [IMP] mail: add helper to find customer partner on thread
Purpose is to use it notably in Voip where we link activities / phonecalls
to partners when possible. Future commits will use it more often in thread
methods.

Method to have the primary email is moved with that helper method in a sub
section, in order to have "model" helpers in the same section. Its code is
also simplified and fixed (return missing). Its name is made coherent with
other naming in the file.

Task-2884301 (Voip activity synchronization simplification)

Part-of: odoo/odoo#93682
2022-08-26 03:42:58 +02:00
Alexandre Kühn f5304e4c80 [FIX] im_livechat: remove imperative update of Chatbot/state
Task-2961956

closes odoo/odoo#98817

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-26 01:55:39 +02:00
Raphael Collet 07744c64e9 [FIX] core: in ir.model.fields, discard deleted fields from registry
This patch discard the fields to delete from data structures like field
triggers, field inverses, and fields to compute.

This is quite useful when uninstalling modules.  This commit fixes the
uninstallation of modules base_setup, bus, mail, web_tour.

closes odoo/odoo#98668

X-original-commit: 49398a769b2ec4965bf148f10b5e13d0a6c1acff
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-08-25 22:46:04 +02:00
william d92a8b5ffd [IMP] web: continue to edit lists when editable=top
Previous behavior
================

When `editable=bottom`, when we hit tab until the end of the line, the
user starts to create a new record.
But when `editable=top`, when hitting tab multiple until the end of the
line, the user starts to edit the first line that was existing before
instead of creating a new one.

New behavior
============

The behavior is consistent between both cases: the user can always
continue to edit lines one after the other.
The behavior for `editable=bottom` is not changed, but `editable=top`
continues to add lines on top one of each other.

linked to task-2879904

closes odoo/odoo#98603

Signed-off-by: Georis François (fge) <fge@odoo.com>
2022-08-25 22:46:00 +02:00