Commit Graph
148305 Commits
Author SHA1 Message Date
Audric Onockx (auon) 290b09fb11 [FIX] product : save price when create and edit a product
- Steps :
Sales > New Quotation > Order Lines > in a new product line :
 Write a price
 Write a name, Create and Edit
In the form, change the price of it and Save.

- Issues :
When first getting in the form, the price is not correctly computed from
the sol.
When saving the form, the price is not saved.

- Cause :
`lst_price` is the product's price.
`list_price` is the template's price.
The sale/quotation view puts `default_lst_price` in the context with the
unit price of the sol.
Yet lst_price is not in the form, so its value remains zero as this context key is not taken into account.
However, list_price is in the form. After this has been changed
manually, when the form is saved, it takes the value of lst_price = zero.

- Fix :
Add an invisible field lst_price in the product form.
This way, the context key is taken into account, so lst_price is
changed, and list_price accordingly.

opw-2731620

closes odoo/odoo#83793

X-original-commit: d3ec94f1c79ecb76acb8de027bf47b0f0b7a3b0f
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
2022-02-02 09:03:52 +00:00
Sébastien Geelen (sge) 207a49275e [FIX] *: adapt some html fields in views
Some html field are not in their ideal style.
As the style for html fields is now dependent of
where you are in the xml view ( in group or not),
we have to adapt some views and flags some fields
to ensure they have the correct look.

This change is only be a visual enhancement
and should not prevent the function of said html fields
even if the views are not updated.

task-2637488

# Conflicts:
#	addons/mail/wizard/mail_compose_message_views.xml
#	addons/website_slides/views/slide_channel_views.xml

# Conflicts:
#	addons/sale/views/sale_views.xml

closes odoo/odoo#83792

Related: odoo/enterprise#23911
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2022-02-02 09:03:44 +00:00
Sébastien Geelen (sge) 26bbac2b61 [FIX] web_editor, project: better field html sizing
Allow wysiwyg field html to blend better in odoo view,
Remove the default resizer and make the field html's size
automatically fit its content

task-2637488

# Conflicts:
#	addons/project/static/src/js/project_form.js

Part-of: odoo/odoo#83792
2022-02-02 09:03:44 +00:00
Sébastien Geelen (sge) 14f4bd526a [FIX] web_editor: adjust codeview button placement
Move the codeview button to avoid conflict with the Translate button.

task-2637488

Part-of: odoo/odoo#83792
2022-02-02 09:03:43 +00:00
Sébastien Geelen (sge) c61150eb16 [FIX] web_editor: fix placeholders for multi editor
Fix placeholder not working properly when multiple editor exists

task-2637488

Part-of: odoo/odoo#83792
2022-02-02 09:03:43 +00:00
Lucas Perais (lpe) 60643090d3 [IMP] tests: support of touch feature detection for test suite
This commit brings the ability to use some feature detection
mechanism used in Odoo. The jquery.touchSwipe library
implementation requires the browser to get ontouch* events from
the window to be available to assert that the browser has touch.

The switch will make the mechanism to work as expected, and
allow tests to use touch events while being correctly executed
because the library expects such events.

closes odoo/odoo#83588

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-02 09:03:35 +00:00
Insiya Shakir 2473b9091a [CLA] Signature for InsiyaShakir02
closes odoo/odoo#83788

X-original-commit: f4b52df4d14e7d7c8f97a8c5366d4666054cab5b
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-02-01 18:07:15 +00:00
Andro Gvivradze 3f5fd479e8 [FIX] point_of_sale: create picking when invoicing after completing order.
in version 14, if you have anglo-saxon accounting and are posting inventory at the end of the session, and create a PoS order without invoicing it, then leave the session without closing and validating,
and open said order and invoice it outside the session, picking for said order will not be created. So, once the session is closed and validated, there will be an invoiced order without any picking in it.
After this commit Odoo will check if order that is being invoiced already has picking order, and if not, will create one for it.

OPW-2725930

closes odoo/odoo#83787

X-original-commit: 894dfa892c92d55ce9897193b4016a5e1f40858d
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-02-01 18:07:11 +00:00
pedrambiria 19a079df4c [FIX] payment: preserve type of all-digits transaction references
Before this commit, it was impossible to make a payment if the
transaction reference exclusively contained digits. This is because the
reference is extracted from the data-* attribute of the <form/> element
of the payment form and wrongly cast into an integer by jQuery before
being passed to the server. Indeed, as of jQuery 1.4.3, HTML5's
data-* attributes are automatically pulled into a jQuery's data object.

To reproduce the issue, remove the prefix from the sequence of the sales
orders and attempt to pay a quotation from a payment link.

This commit forces the reference to be cast into a string as it is the
variable type that the server expects, and it crashes if the reference
is an integer.

opw-2732448

closes odoo/odoo#83753

X-original-commit: 57d9997fa59c82e03c46b149daece5ce32395c5c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2022-02-01 18:07:06 +00:00
Sébastien Theys 47bda95b98 [FIX] mail, sms, snailmail: fix perf of fetching failures of user
We are currently lacking an index with (author, failure) due to the information
being spread out in two different tables which are both rather big (there are a
lot of non-failure messages for the current user, as well as a lot of failure
messages for other users), so the fetch of failures for the current user can
become extremely slow (> 20s).

With this new index, the query takes less than 1ms.

task-2742946

closes odoo/odoo#83451

Related: odoo/upgrade#3204
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 18:07:02 +00:00
Victor Feyens 79f7c233ec [FIX] web: do not send unmodified data to the server on record save
Following recent conversion of onchanges to computes in the sale scope,
it was observed that updating one line triggered price recomputation in other
lines (which isn't expected).

After investigation, it seems that the `product_packaging_id` field is considered
modified and sent on SO save for all the lines, which triggers the `product_uom_qty`
record computation, then the whole price computation is triggered, since it depends
on that quantity field.

This commit aims to fix this case by only considering a m2o field as modified
if its value was effectively changed.

closes odoo/odoo#83252

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-01 18:06:54 +00:00
JF Aubert 6acfb2e630 [IMP] mrp : split / merge manufacturing orders
Split a manufacturing order in several parts
using the back order mechanism

Merge several manufacturing orders related to the same product/bom
by cancelling all of them and creating a new one

closes odoo/odoo#82427

Task: 2662566
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2022-02-01 18:06:50 +00:00
Denis Ledoux a08a0b6454 [ADD] auth_totp_mail: 2FA using code sent by email
Add the possibility to force the two-factor authentication for all users,
using a two-factor authentication by email
when the 2FA using an Authenticator app is not configured for the user.

Two possibilities:
 - Force the 2FA only for employee users using the system parameter `auth_totp.policy=employee_required`
 - Force the 2FA for all users, employees and portals, using the system parameter `auth_totp.policy=all_required`

closes odoo/odoo#83750

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-02-01 17:15:30 +00:00
Guillaume (guva) 8b5f613cc0 [FIX] account: compute the journal_id for payment register wizard
Steps to reproduce:

- Create an invoice and confirm it
- In Accounting Dashboard, on the Customer Invoices card,
  click on 'Unpaid Invoices'
- Select the invoice with the checkbox
- Click on button 'Register Payment'

Issue:

- The journal_id is not set by default

Before this commit, the default fields inherited 'journal_id',
if it's not the good one, we delete it in order to compute it..

opw-2729754

closes odoo/odoo#83770

X-original-commit: 9e2f96598f3d62b501e894eab7151af8390937e1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
2022-02-01 15:32:29 +00:00
Patrick Hoste b89f630d73 [FIX] event_booth_sale: add ondelete cascade to sol in registrations
PURPOSE

Before this commit it's impossible to unlink a sale order line containing
a booth product (the ondelete parameter is unset thus default to restrict)
After this commit this bug is fixed.
Further explanation on the task implying a bug on the database setting
the on delete to cascade despite the default value...

LINKS

Task-2749521
PR : odoo/odoo#83685

closes odoo/odoo#83767

X-original-commit: e8d96fb1cfd5016f12dc43b988a8a0450bf36a04
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 15:32:26 +00:00
std-odoo d497dbe919 [IMP] fetchmail_gmail, google_gmail: simplify the mail server form view
Purpose
=======
A field `use_google_gmail_service` has been used in stable to define
a mail server which use Gmail authentication.

But now that the fields `smtp_authentication` exists, we want to use it
to simplify the mail server form view. For the incoming mail server,
the field `server_type` will be used for the same purpose.

Add a new field to have the option to install `google_gmail` in the
main settings page.

Task-2170676

closes odoo/odoo#83413

Related: odoo/upgrade#3199
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 15:32:16 +00:00
Hubert Van de Walle e5f35a6074 [FIX] crm, sales_team: compute company within allowed_company_ids
Steps to follow

  - Select only one company in the company selector but not the default one
    from the current user;
  - Go the the CRM app;
  - Create a lead;
  -> A multi company error appears !

Solution

  - The default team is now restricted to the companies in the context
  - When computing a lead's company_id when the team has no company, keep only
    the ones within the allowed_company_ids;

opw-2713757

closes odoo/odoo#83764

X-original-commit: 58b9b3e839c7725fdcd66376564ce6554a4b82ac
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 14:37:54 +00:00
Hubert Van de Walle db353f94d0 [IMP] crm: add multi company tests
Purpose is to add some tests involving unsync of env.companies and current
user's company. Tests are added trying to mimic notably assignment cron
using sudo().

Next commit will fix some side issues.

opw-2713757

X-original-commit: 70b9f3aaa86acc6d32bee21fbd6114541115d310
Part-of: odoo/odoo#83764
2022-02-01 14:37:53 +00:00
oco-odoo 67cd29a6c3 [FIX] account: partial revert of 9311b087e1, for usability
The part of 9311b087e1 affecting field labels on account.payment's form view was mistakenly merged. The actual fix regarding those labels is done in 15.0 here https://github.com/odoo/odoo/pull/83674 .

closes odoo/odoo#83744

Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-01 14:37:48 +00:00
Rémy Voet (ryv)andrco-odoo f9442f47eb [IMP] core: bulk insert
The `_create` don't batch the SQL request to insert of data which it
isn't efficient we there is a several record to create.
Batch the SQL insertion and measure performance
depending of batch size to avoid any regression (see result in the
PR: https://github.com/odoo/odoo/pull/80961).

task-2299314

closes odoo/odoo#80961

Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
2022-02-01 14:37:43 +00:00
Rémy Voet (ryv) 27fe7bf3a3 [REM] core: remove check decorator
The `check` decorator in  `sql_db.py` was on a lot of `Cursor` methods.
It checks if the cursor is close before be using a the method.
Remove it because:
- It is completly redundant because `psycopg2` do already the job
to check the cursor before usage.
- It complicated the call stack and lead to a small overhead of
highly use methods (can be more than 1% of the execute call)
- Also the nature of
the Error isn't correct: raise `OperationalError`
(https://www.psycopg.org/docs/module.html#psycopg2.OperationalError)
instead of  `InterfaceError`
(https://www.psycopg.org/docs/module.html#psycopg2.InterfaceError).

Part-of: odoo/odoo#80961
2022-02-01 14:37:42 +00:00
Florian Charlier ca0f936dd1 [IMP] hr+resource: populate: link users and resource calendars
Previously for `appointment`, now for `appointment_hr`, the computation of
users' availability for appointment slots can be dependent on that person's
work schedule if:

* The user is linked to an employee
* The user's employee has working hours defined (resource calendar)

This commit provides working hours to all employees and a user to some, within
a multi-company setup.

Task-2728093
See odoo/enterprise#22642

closes odoo/odoo#80688

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 14:37:37 +00:00
roen-odoo 26009fec93 [FIX] mail: Access error closing chat
Current behavior:
After creating a group chat in the discuss app you were not able to close it.

Steps to reproduce:
-Create a group chat with more than one user in the discuss app
- Try to leave it
- You get an access error

opw-2736464

closes odoo/odoo#83717

X-original-commit: cc1c132ee092368e77108f327ecdc5a6d2c490a6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-02-01 13:38:59 +00:00
Odoo's Mergebot 7adb866ac5 [IMP][FIX] mail, mass_mailing: add constraint for required res_id
Activities and mailing trace models are linked to records through a model and
a many2one reference field. The latter one is required but is implemented like
an integer field, meaning writing 0 is actually a valid value for 'required'.

In this commit we add a constraint to ensure we never update activities with
a void res_id value. Same for mailing traces.

Source: internal feedback about activities with 0 as res_id

Task-2694133

closes odoo/odoo#81292

Related: odoo/upgrade#3106
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-02-01 14:38:51 +01:00
Thibault Delavallée fa477a21f9 [FIX] sale: do not create activities on transient records
Oversight of odoo/odoo@cd885ad2cd . On transient record (having newID) this
line leads to creating activities with res_id being 0.

Part-of: odoo/odoo#81292
2022-02-01 13:38:49 +00:00
Thibault Delavallée 04ef6bee10 [IMP][FIX] mail, mass_mailing: add constraint for required res_id
Activities and mailing trace are linked to documents through a model and
a many2one reference field. The latter one is required but is implemented like
an integer field, meaning writing 0 is actually a valid value for 'required'.

In this commit we add a constraint to ensure we never update activities with
a void res_id value. Same for mailing traces. This allows to remove the
required attribute on fields to avoid having redundant sql constraints.

Source: internal feedback about activities with 0 as res_id

Task-2694133

Part-of: odoo/odoo#81292
2022-02-01 13:38:49 +00:00
stefanorigano (SRI) f17b3aaaec [FIX] mail: AttachmentImage, remove unused div
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

closes odoo/odoo#83108

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 12:45:06 +00:00
stefanorigano (SRI) 8b1cdef47e [FIX] mail: AttachmentImage, remove unused class
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

Part-of: odoo/odoo#83108
2022-02-01 12:45:05 +00:00
stefanorigano (SRI) cf42d54653 [REF] mail: AttachmentImage, review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

Part-of: odoo/odoo#83108
2022-02-01 12:45:05 +00:00
stefanorigano (SRI) 035df6293b [ADD] web: opacity utility classes
Add new utility classes to handle basic opacity behaviors.
Once migrate to BTS5 these classes should be generated using the
upcoming utility classes API.

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

Part-of: odoo/odoo#83108
2022-02-01 12:45:05 +00:00
stefanorigano (SRI) e9d284bbdd [FIX] mail: AttachmentImage, remove unused css class
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2731819

Part-of: odoo/odoo#83108
2022-02-01 12:45:04 +00:00
stefanorigano (SRI) 20a71db401 [REF] mail: ActivityMarkDonePopover review and simplify scss
Part of the overall v16 SCSS optimization/restyle, task-2704984

task-2731819

closes odoo/odoo#83041

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 12:44:55 +00:00
Dharmraj Jhala 81bcc95122 [FIX] mail: correctly load chatter related data for archived records
With a recent commit[1], we now gather the chatter related data with a
single controller ('/mail/thread/data') which was a bit scattered
previously. With this controller, instead of searching in dedicated
model, we now simply use the main document/record itself and it's
fields whenever possible. For example, previously for the followers,
we used to search data from 'mail.followers' model, but now we simply
use `message_follower_ids` field of the record itself.

The problem with this approach is, if the record is archived, we won't
be able to fetch the related data. That leads to empty follower list/
activities and a trackback while getting suggested recipients.

This commit fixes the issue by loading the record even if it's
archived, and thus fetching the data required by chatter.

commit[1] - https://github.com/odoo/odoo/commit/e0913197ac84b25b40e7599a6432362141d104c9

TaskID-2748030

closes odoo/odoo#83731

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 11:53:09 +00:00
John Laterre (jol) a8628c5697 [IMP] account: add test for fiscal positions with delivery address
The goal is to test various use cases related to fiscal positions
having a specific delivery address.

The use cases are as follows:

- Case : 1
Billing (VAT/country) : BE/BE
Delivery (VAT/country) : NL/NL
Expected FP : Régime National

- Case : 2
Billing (VAT/country) : NL/NL
Delivery (VAT/country) : BE/BE
Expected FP : Régime National

- Case : 3
Billing (VAT/country) : BE/BE
Delivery (VAT/country) : None/NL
Expected FP : Régime National

- Case : 4
Billing (VAT/country) : NL/NL
Delivery (VAT/country) : NL/NL
Expected FP : Régime Intra-Communautaire

- Case : 5
Billing (VAT/country) : None/NL
Delivery (VAT/country) : None/NL
Expected FP : EU privé

- Case : 6
Billing (VAT/country) : None/US
Delivery (VAT/country) : None/US
Expected FP : Régime Extra-Communautaire

closes odoo/odoo#83714

X-original-commit: e7f112ab658b2254d0663207831f4eabdfcec166
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-01 11:53:05 +00:00
John Laterre (jol) 1f24bd28aa [FIX] sale: fix archived tax on sales orders
When archiving a Tax, you do not want that action to
invalidate Sales Orders and Invoices confirmed in the past
and that were using it.

The purpose of Archiving it is that it would not appear
or be proposed to new items created.

Until now, we had an inconsistency between Sales Orders and Invoices
when a Tax was archived.
The tax "disappeared" from old SOs,
but the amounts remained unchanged, which created an inconsitency.

The domain in the field definition no longer works
because a custom domain in the view is shadowing the current domain.

task-2745094

closes odoo/odoo#83712

X-original-commit: 09f6d682669e4e9d898f89706fece3fa9ce59da3
Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-01 11:53:00 +00:00
Victor Feyens 0707554baa [FIX] sale_stock: disable undeterminstic tests until fixed
closes odoo/odoo#83735

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-02-01 10:54:40 +00:00
jbw 16feec36da [FIX] account: fix change period reconciliation for automatic entry wizard
When creating automatic entries for multiple moves on different dates with the automatic entry wizard, the wizard would reconcile all the lines on the accrual account of the destination move with the lines on the accrual account of each accrual move. As this would imply reconciling the same lines multiple times, it triggers a reconciliation error.
What must be done is, for each accrual move, reconcile it’s lines with only the related lines on the destination move.

closes odoo/odoo#83732

Task: 2717578
X-original-commit: 502003ac548d6620374dfbab4fb7be6dee3c1bf5
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
2022-02-01 10:54:36 +00:00
jbw 3eb760c567 [FIX] account: fix _compute_percentage returning > 100%
Sometimes _compute_percentage would return a percentage slightly over 100 due to a rounding error. This would then  trigger the constraint asserting that percentage must be >= 0 and <= 100.

Task: 2717578
X-original-commit: 813d52ed7daff408819d8838c8c36fcee825905f
Part-of: odoo/odoo#83732
2022-02-01 10:54:36 +00:00
Adrien Widart ecf66e6507 [FIX] mrp_subcontracting: process delivery with several backorders
In case of a MRP subcontracting, it is not possible to process the
delivery with several backorders.

To reproduce the issue:
1. Create two products P_compo, P_finished
    - Both storable
    - P_compo must have the route "Resupply Subcontractor on Order"
2. Update P_compo's quantity: 5
3. Create a BoM:
    - Product: P_finished
    - BoM type: Subcontracting
    - Subcontractors: a partner P
    - Components: 1 x P_compo
4. In Inventory, create a planned transfer T:
    - Operation Type: Receipt
    - Receive From: P
    - Operations: 5 x P_finished
5. Mark as Todo
6. Inventory > Resupply Subcontractor, find the delivery of P_compo for
P and process it
7. Back to T, set the done quantity to 1.25
8. Validate T (with backorder)
9. On the backorder BO1, set the done quantity to 1.0
10. Validate BO1 (with backorder)
11. Open the second backorder BO2 and validate it

Error: a Validation Error is displayed "You can not enter negative
quantities.", which doesn't make sense

The issue comes from the inner method `_get_available_move_lines` in
`_action_assign`. When validating a picking, at some point, we are here,
at the beginning of `/mrp_subcontracting._action_done`:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L36-L37
To understand what happens next, we need to note that, in this method,
the associated MO will be marked as done later (on line 76). Back to the
current line (L37), we are calling `super` which leads to the
problematic `_get_available_move_lines`. Suppose we are on step 10 (we
are validating the first backorder), we have
https://github.com/odoo/odoo/blob/58a9f57c0827a51e46ef0f52a3d48ba343667fe0/addons/stock/models/stock_move.py#L1390-L1391
`move_orig_ids` contains two stock moves, each one associated to one MO.
However, as said above, the second MO is not yet marked as done, this
will be done later on in `/mrp_subcontracting._action_done`. Therefore,
`move_lines_in` is only defined with the first SM, from the first MO,
with a quantity of `1.25`
Further in `_get_available_move_lines`, we have:
https://github.com/odoo/odoo/blob/58a9f57c0827a51e46ef0f52a3d48ba343667fe0/addons/stock/models/stock_move.py#L1403-L1405
`move.move_orig_ids.mapped('move_dest_ids') - move` gives two SM, and
here is the issue: the second one is already processed, so both are kept
in `move_lines_out_done` and the sum of their quantity is equal to
`1.25 + 1 = 2.25`
Therefore, at the end of the method, when computing the difference, it
gives a negative difference. This negative value will be used to create
a SML and later on, it will trigger the validation error.

Once the above issue is fixed, there is another "invisible" issue that
need to be fixed: when generating several backorders on the deliveries,
only the first one will trigger the creation of a new MO. Suppose we are
back in `/mrp_subcontracting._action_done` (still on step 10 in the
above case), in the first for-loop:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L39-L43
`move._get_subcontract_production()` returns the two MO (from the
initial picking and from the first backorder). However, since the first
one has already been processed, the if-condition is validated.
Therefore, this for-loop is done and the second MO is not processed (the
quantities are not recorded and its field
`subcontracting_has_been_recorded` is not defined to `True`). As a
result, still in `/mrp_subcontracting._action_done`, we are now in the
second for-loop:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L71-L72
`_subcontracting_filter_to_done` removes the two MOs because the first
one is done and the second one has not its field
`subcontracting_has_been_recorded` set to `True`. The condition in the
first for-loop is not accurate enough.

OPW-2731658

closes odoo/odoo#83658

X-original-commit: 1b740ae148acfc832b124122763817b08ea110ab
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2022-02-01 10:54:31 +00:00
Didier (did) 494799106b [IMP] mail: add combined index to mail_message
Before this PR, the query from _channel_last_message_ids could take a
significant amount of time.
This add an index to speed up the query.

task-2746108

closes odoo/odoo#83476

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-02-01 10:54:27 +00:00
anhe-odoo b358c3debb [FIX] mail: hide 'View' button in mail
Expected Behaviour

When a user get a mail from the data cleaning about records to examine, the View button should be linked to the same url as the 'here' hyperlink or not be in the e-mail.

Observed behaviour

Clicking the link in the View button lead to an error page

Reproducibility

This bug can be reproduced following these steps:

1. Duplicate a contact
2. Wait for the scheduled task to launch
3. Click on the View button of the mail you'll get about te duplicate

Problem Root Cause

This issue is coming from the way we create the 'View' and 'View Task' button, and can't be changed easily. The easier way to fix this issue is then to hide these button

Related Issues/PR

opw-2674138

closes odoo/odoo#83284

X-original-commit: 3a61747b366a315488837e2e560b305e89217dbd
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 10:54:23 +00:00
Rémy Voet (ryv) 5fb6200f46 [REM] base: remove field attribute 'deprecated'
It was only used one time on a unused field.
We don't want to keep useless fields anymore,
the migration is done for that.

task-2735546
odoo/upgrade#3194

closes odoo/odoo#82727

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-02-01 10:54:19 +00:00
Rémy Voet (ryv) 3189b031a2 [REF] base: simplify the _write
Issue:
`_write` checked that the number of modified row in DB was equal to the
number of ids in the RecordSet (raise `MissingError` if not).
This behavior was only used by the ORM to retry
(with exists() on the RecordSet before) if the Missing Error raised.
Then it makes the job a second time (for no reason).

Then:
- Remove the check of number of row (and simplify the call of `_write`)
- Remove the useless return value (always `True`)
- Remove the `set(` before the `split_for_in_conditions`, it adds
randomness for nothing because the `_write` should be call without
duplicate id (even if it is not the case, we don't care).

task-2735546

Part-of: odoo/odoo#82727
2022-02-01 10:54:19 +00:00
Rémy Voet (ryv) ae41be0c5c [REM] base: remove column_format of Field class
The `column_format` of the `Field` class was unused and create useless
noise in the ORM. Then remove it and simplify some flows.

task-2735546

Part-of: odoo/odoo#82727
2022-02-01 10:54:18 +00:00
Rémy Voet (ryv) 6000179384 [REM] base: remove _sequence attribute of BaseModel
The `_sequence` was only used for the insertion of data in the DB for
the `id` value. But in Odoo, the `id` is always a `SERIAL`, then the
PostgreSQL fill already the value by the right SQL sequence. Then,
avoid doing the job of the DB by ourselves.
Sadly, we need to manage the case when we create an empty record to
always get a valid query.

task-2735546

Part-of: odoo/odoo#82727
2022-02-01 10:54:18 +00:00
Julien Van Roy e44f866853 [FIX] l10n_fr_fec: remove duplicated translations
closes odoo/odoo#83677

X-original-commit: 466327d4e79434d06d37ef5f2db700cafaa66c5b
Signed-off-by: Laurent Smet <las@odoo.com>
2022-02-01 09:54:21 +00:00
Florian Damhaut ac98d89a98 [FIX] mail: _get_recipient_data return groups for pids
Note: fix not necessary since odoo/odoo@https://github.com/odoo/odoo/commit/a62927e7e2d7df4047f8606b41e70ef61ac29b73 landed in master. This
forward port contains only the test.

Step to reproduce:
- Go to a project with visibility set on 'Invited portal users and all internal users'
- Go a task
- Send an follow invitation to Marc Demo (an internal user)

Intended behavior:
The mail has a 'View task button'

Current behavior:
No view task button

This behaviour is due to the function _get_recipient_data which is supposed to return groups when given pids but doesn't.

See _get_recipient_data docstring.

opw-2727410

closes odoo/odoo#83594

X-original-commit: d113cb6398806a1a744085d041b73b827f9f4ada
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-02-01 09:54:17 +00:00
aliya 9311b087e1 [FIX] account: make recipient bank account readonly
Currently: "register payment" wizard allows selecting different bank accounts or even creating one when registering a payment on customer invoice/vendor refund.

Should be: the field should be set to partner_bank_id and be set as readonly. When cash journal is selected, "Recipient Bank Account" field should be hidden

Task ID: 2710936

closes odoo/odoo#81319

Signed-off-by: Olivier Colson <oco@odoo.com>
2022-02-01 09:54:13 +00:00
Christophe Monniez e34430c822 [IMP] various: implement _neutralize method
As an overridable _neutralize model method was added in a previous
commit, the method is now implemented for various models.

closes odoo/odoo#67825

Related: odoo/enterprise#19042
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2022-02-01 09:54:08 +00:00
Christophe Monniez 4fc7b9e329 [IMP] iap, various: implement _neutralize method
An overridable model method was added in a previous commit in order to
neutralize a database.

This commit adds the implementation of this method on the `iap.account` model.
A _get_iap_config_paremeters method is also added on this model.
Each iap service must override this method to extend the list of
`ir.config_parameter` that need to be neutralized.

Part-of: odoo/odoo#67825
2022-02-01 09:54:08 +00:00