Commit Graph
165814 Commits
Author SHA1 Message Date
Alexandre Kühn d064d3728d [FIX] mail: do not autoscroll attachment box when initially open
Before this commit, when a form view choose to open attachment box
initially and chatter is at bottom, opening the form view was
scrolling down to the attachment box.

The auto-scroll to opened attachment box is desirable when the
user explicitly interact with the attachment button, to show
the attachments. However, it should not be triggered when opening
the form.

This commit fixes the issue by limiting auto-scroll to attachment
box only when explicitly chosen by the user.

closes odoo/odoo#135205

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 04:37:02 +00:00
sofiagvaladze 7e20111e48 [FIX] hr_homeworking: show location correctly
current behavior:
If you have a weekly location defined on the employee,
and a exeptional, location for that day defined on the Calendar,
the presnece icon shows weekly and not the exceptional.

Expected behavior:
Presence icon should be based on the exceptional location,
and if there are none, take the weekly one.

task-3482527

closes odoo/odoo#135191

X-original-commit: cbb4d588e3a1dd1f89f19ac3a413bd531f8a5729
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-13 04:37:01 +00:00
Didier (did) 8e2d0e9f8d [IMP] mail: port test from 135122
This PR import the test created in https://github.com/odoo/odoo/pull/135122

closes odoo/odoo#135183

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-13 03:38:09 +00:00
Nasreddin Boulif (bon) 42203ac2f2 [FIX] mail: return str instead of bytes when post processing attachment
Steps to reproduce:

  On Odoo:
  - Install `Documents` module
  - Go to `Settings` and set a Custom Email Server(ex. `mydomain.com`)
  - Ensure an alias exist for the model `document.document` with `inbox-financial` as alias name

  In mail client:
  - Send a mail with an image in the body to the following email: inbox-financial@mydomain.com

Issue:

  Mail not received (traceback in logs)

Cause:

  Since we use the email alias `inbox-financial`, we process the mail
  through the `document.document` model where we have an override of the
  `_message_post_after_hook` method that is called after that the
  `msg_values` values are post-processed and where we do another
  message_post() for the new document create for the attachment (in
  this case, an image).

  https://github.com/odoo/enterprise/blob/2c3596e4e18c201809558d3ea878b141e366a027/documents/models/document.py#L305

  During the parsing, the mail values are updated through the
  `_process_attachments_for_post` method:

  https://github.com/odoo/odoo/blob/6c0d2d7a9d44459f3e09a38bd80ef9b018e8c946/addons/mail/models/mail_thread.py#L1881-L1904

  On posting the first time, the original type of the `body` value is a
  `str`, but the post-processed value (because there is some CIDS in the
  body) is of type `bytes` (because using `encoding='UTF-8'` with
  `lxml.html.tostring`).

  https://github.com/odoo/odoo/blob/510a997017a9cbe14522a0013a578f6d1d9b257a/addons/mail/models/mail_thread.py#L2209

  Then in the `_message_post_after_hook` we call post again on the
  newly created document record by using post-processed value of body
  who is of type `bytes`.

  On posting the second time (for the document record), the `body`
  value is of type `bytes` and when checking if the body is empty with
  `is_html_empty` that received a string as param, an error is
  raised.

Solution:

  Use `encoding='unicode'` to return a string instead of bytes.

  https://lxml.de/api/lxml.etree-module.html#tostring

opw-3273583

closes odoo/odoo#135172

X-original-commit: 394031561179af6930eb71fcf7017f8f9d285aed
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-09-13 03:38:08 +00:00
aliya e12e0b0caa [FIX] account: fix the bank account onboarding
If a bank account is added through the onboarding step and the user creates one instead of linking it,
the dashboard is not reloaded to show the completion of the step and the new account.
To make sure that the view is reloaded to show new data,
the easiest fix would be to return a reload action in `validate`.

task-3431961

closes odoo/odoo#135170

X-original-commit: cc793b303da5ea2dbe931bac1da266a121429ede
Related: odoo/enterprise#47302
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-09-13 03:38:05 +00:00
Saurabh Mishra a96e9fa184 [FIX] l10n_ch: display qr bank options in ch localization
When a user having CH Company tries to Add a Bank Accout then they will face the
issue.

Steps to produce:
- Install `l10n_ch`.
- Change company to CH Company.
- Invoicing > Configuration > Banks > Add a Bank Account.

Applying this commit will solve the issuse by allowing the user having
CH Company to add a bank accout. The user was facing the issue because
of the code:
https://github.com/odoo/odoo/blob/2476a3ae2e3ed66875a2ea855be640d127b58cf2/addons/l10n_ch/wizard/setup_wizards.py#L21
In above code `self` is passed in as an arguement in the compute function
while calling the function which is invalid.

Error: `TypeError: ResPartnerBank._compute_l10n_ch_display_qr_bank_options()
takes 1 positional argument but 2 were given`

sentry-4389863088

closes odoo/odoo#135169

X-original-commit: aa22fd8c51b635dd084520e108eb7452a91ca032
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Mishra (sami) <sami@odoo.com>
2023-09-13 03:38:01 +00:00
Nicolas Martinelli 95de052040 [FIX] website_sale: add index to website_sequence
On a DB with 2M+ products, the computation of the
`_default_website_sequence` [1] takes several seconds. In case of a
product creation in batch, it can negatively affect the whole
server performance.

Adding an index solves the problem.

[1] https://github.com/odoo/odoo/blob/1b9c7fecc5b4031c5d7b9bbe4f26e1e510063d12/addons/website_sale/models/product_template.py#L368

closes odoo/odoo#135164

X-original-commit: 44c707814f1d415a5b13086942188629b0bb7d28
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2023-09-13 03:38:01 +00:00
Eteil Djoumatchoua(etdj) 81136e4dc9 [FIX] stock_account: Display the value field on StockQuant list view
Steps to reproduce:
- Go to Inventory -> Reporting -> Location.
- Enable the 'Value(value)' to be displayed on the view.
- Group by Location.

Issue:
There is no value displayed under the 'value' column

Reason:
When overriding the ``_read_group()`` in ``StockQuant``, in the stack it's called by the ``BaseMode.read_group()`` where the
aggregated fields are computed. As ``StockQuant.value`` is a computed field(not stored), it will never be part of it
https://github.com/odoo/odoo/blob/6d785a9cacf9f592eb76e8edccabf514bf348f08/odoo/models.py#L2516.
So when entering the ``StockQuant._read_group()``, ``{'value:sum'}.isdisjoint(aggregates)`` will always be true.

opw-3440766

closes odoo/odoo#135150

X-original-commit: 4fb6415c8ddfbcf691b92441e72fbfda6f2f3875
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Eteil Junior Djoumatchoua (etdj) <etdj@odoo.com>
2023-09-13 03:37:59 +00:00
Gauthier Wala (gawa) 4a24d76170 [FIX] l10n_pl_jpk: rename table of tax offices
_name should have a separator ".", separating the model and the module.

closes odoo/odoo#135144

X-original-commit: e1672460399bc6ce53431450d24b6f345e062640
Related: odoo/enterprise#47293
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-09-13 03:37:57 +00:00
Gauthier Wala (gawa) 7582e66c71 [IMP] l10n_pl_{jpk/sale_stock}: Add fields necessary for JPK
For the JPK and the EDI, a lot of additional informations are needed.
We provide them in community, so it's available later for EDI.

The delivery date is needed in Poland, and we compute it if
sale_stock is installed. It will be done later for all localizations,
but not in stable, so we will merge it with the other ones later.

X-original-commit: 8b14d098a65b84a842514e644b262a0d714f4b48
Part-of: odoo/odoo#135144
2023-09-13 03:37:57 +00:00
Gauthier Wala (gawa) 4f3b6a1dfc [FIX] l10n_pl: tax report and tax changes for JPK
Some taxes and tax report lines are needed for the export of JPK
(and EDI that will be done later)

X-original-commit: c496d5b85d7ec226f4a28db95b07f747c6b6ec37
Part-of: odoo/odoo#135144
2023-09-13 03:37:57 +00:00
tsm-odoo 4be75dd002 [IMP] im_livechat: allow visitors to receive calls
task-2900771

closes odoo/odoo#135109

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-09-13 03:37:56 +00:00
Vraj Panchal eaf7e6d581 [IMP] mrp_subcontractiong: hide action button on portal
Remove the cogs icon on the subcontracting portal page.

task-3471491

closes odoo/odoo#135090

X-original-commit: f02aeeb30180bdc096442fcf82df6f0a0c70fdb9
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-13 03:37:55 +00:00
miad-odoo 5a6fbaacc7 [FIX] mass_mailing: fix finding duplicate mails
Before the commit, the _get_seen_list() function in the mass_mailing module was
not able to correctly identify all the duplicate email addresses in a given mass
mailing. This was because the function chose and used only one way to find an
email address for each record in the mailing list, even though there are many
ways to find an email address for a record.

For example, a crm.lead record might have an email address in its partner_id
field, but it might also have an email address in its email_normalized field.
This can vary from record to record.

To fix this issue, the _get_seen_list() function was updated to only look at the
email address to which emails have already been sent, rather than trying to
fetch it from the record itself. This ensures that all duplicate emails are
correctly identified and that no duplicate emails are sent in the mass mailing.

Task-3234378

closes odoo/odoo#135081

X-original-commit: 66f9aa25af049aa3faf0f76475a4a2b63b5d0903
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-13 03:37:54 +00:00
padh-odoo c29d8ea52b [IMP] sale: improve sale product catalog button color
Improve the color of quantity selector and add button.

- Currently, if we look at the selected quantity, it is not that visible on the
  projector.
- The color of the quantity selector and button change to primary and secondary
  respectively.

closes odoo/odoo#134244

Task: 3489423
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-13 01:34:55 +00:00
Katherine Zaoral 0a41d64d18 [ADD] l10n_ar_pos: new module
closes odoo/odoo#133881

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-09-12 22:12:54 +00:00
Miquel Raïch c93a57ccab [IMP] models: only log "long name constraint" when the constraint is added
This way, we avoid spamming the log each time new constraints are added in the constraint's table.

closes odoo/odoo#132681

Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-12 22:12:53 +00:00
Gabriel de Paula Felix (gdpf) 69d23262f8 [IMP] microsoft_calendar: Credentials module and don't sync old events
Before this commit, when the first synchronization with Outlook Calendar was done or when the synchronization was restarted, all events previously created in Odoo (before synchronizing) were being synced with Outlook, triggering lots of emails and notifications for attendees. Additionaly, all microsoft credentials information were concentrated within the res_users file, difficulting updates in this file.

After this commit, only events created or updated after the synchronization starts (or restarts) are synced with Outlook Calendar, with 5 minutes of time acceptance for avoiding network delay issues. Moreover, a Microsoft Credentials module was added for gathering microsoft credentials in one place.

closes odoo/odoo#128150

Task-id: 3410651
Related: odoo/upgrade#5047
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-09-12 20:52:14 +00:00
Nasreddin Boulif (bon) 3f55f57c44 [FIX] calendar: allow admin to edit any event
Steps to reproduce:

  - Install `calendar` module
  - With demo user, go to calendar and create a new event
  - With admin user, go to the calendar and try to edit the event

Issue:

  Admin can't edit the event.

Cause:

  Only allowing the user who created the event or who is in the
  attendees list to edit it.

Solution:

  Allow to edit the event if user is admin (or created the event
  or is in attendees list).

opw-3185743

closes odoo/odoo#135071

X-original-commit: bf79086886e053c9f7fa2f784297bcb9b1e8d51d
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-09-12 17:16:29 +00:00
Habib (ayh) 0d806fc515 [IMP] web: trigger fast owl re-render from python
Because why not?

We often need to re-render the user interface from python, but limited to call a browser reload (redirect to current URL).
With this simple client action tag `soft_reload` - we can quickly reload the UI, without a hard refresh.

An example use case: refresh the kanban when an onboarding step is done via a dialog. See `validate` in 'account.setup.bank.manual.config'

closes odoo/odoo#134929

X-original-commit: 422d2b0512216514aa856bffedc774d17faf6bcb
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-12 17:16:28 +00:00
Yannick Tivisse c2ebe70ed4 [IMP] *: Remove todos we won't do
closes odoo/odoo#134836

Related: odoo/enterprise#47144
Related: odoo/upgrade#5129
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-12 17:16:23 +00:00
Yannick Tivisse fb29d7623c [IMP] hr_work_entry: Remove deprecated method
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Yannick Tivisse 681a09a749 [IMP] ir_http: Remove company_id from session_info
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Yannick Tivisse 0a88ae45d6 [IMP] l10n_be_hr_payroll: Move departure reason to hr
Part-of: odoo/odoo#134836
2023-09-12 17:16:23 +00:00
Patrick Hoste a2ba702a3d [FIX] survey: fix duplicate timer
This commit fix a bug introduced by 910897fc97
which displayed two timers when starting a survey.

Task-3497526

closes odoo/odoo#134686

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-12 17:16:22 +00:00
Samuel Degueldre 5b61256976 [IMP] web: datetime picker support for custom invalidity/class per day
This commit allows users of the datetime picker service to pass
functions that will be called to check the validity of specific days or
that generate a class for a given day. This can be useful in some
contexts for example when you want to prevent the user from selecting
days on the weekend for certain operations, or to highlight some days
where a given product is not in stock.

closes odoo/odoo#134647

Related: odoo/enterprise#47061
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-12 17:16:20 +00:00
Adrien Guilliams (adgu) e19cc8eac8 [FIX] pos_self_order: fix combo price when changing combo quantity
When changing the quantity of a combo, the price was not correctly
updated due to a miscomputation in the backend.

closes odoo/odoo#134622

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-09-12 17:16:19 +00:00
Samuel Degueldre 239d8c0a06 [FIX] website: fix editor unable to open with filled date field
In odoo/odoo#133349 some code in website was adapted to use the new
datetime picker and luxon instead of tempusdominus and moment, but some
conversions were improperly performed causing a crash that would prevent
the website editor from opening. This commit fixes this issue and also
formats the chosen default date/datetime correctly while within the
editor.

This commit also fixes a minor issue with props validation of the
datetime picker, where we would give it an empty string instead of null
or false, causing props validation to fail in debug mode.

closes odoo/odoo#134493

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-12 17:16:18 +00:00
niyasraphy 654948ea63 [FIX] base: missing upgrade and uninstall button in apps kanban
before this commit, the uninstall and upgrade option is not
shown in the kanban.

introduced in: https://github.com/odoo/odoo/commit/5b68871097df5e7a13966dee4c650d1f34f9e7c1

* open apps kanban
* click on kanban menu(3 dots) of installed app
* upgrade and uninstall button is not shown

after this commit, the upgrade and uninstall button will be
shown in the apps kanban menu depending on the state of
the app

closes odoo/odoo#135132

X-original-commit: 90184ff280b4225522797528af51a32591eb5347
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
2023-09-12 14:41:26 +00:00
luvi 44d9b70b8e [IMP] mail: add a pager to Activity view
This commit adds a pager to add a limit to the number of activities
displayed by the view. This reduces the risk of performance issues
when many activities have to be fetched and displayed in the view.

There is no need to display an infinite amount of activities, so a limit
had to be set.

The 'get_activity_data' method from the model now takes the limit and
offset parameters, to only fetch activity data from maximum of 100
records.

Activity tests have been adapted to reflect this change, and that the
parameters are correctly used.

task-3487762

closes odoo/odoo#134510

Signed-off-by: Florent Dardenne (dafl) <dafl@odoo.com>
2023-09-12 10:51:08 +00:00
Laurent Smet d3707cf954 [IMP] account: allow to remove placeholders attachments in send & print wizard
In 16.1 and before, when you used the Send & Print, you could manually remove the attachments when using
the Send by Email. Even though the use case is weird (sending an invoice by email without attaching the document),
we have feedback of user actively using that option before.

Also, prevent the deletion of the PDF report from the wizard:
- Create and invoice and send it by mail
- Open again the send & print, remove the PDF and send by mail
=> The PDF is deleted from the invoice

closes odoo/odoo#135101

Task: 3476700
Opw: 3378840
X-original-commit: 00dc68955c8e4c35fab29617eed7f03e45fc6643
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-12 08:31:42 +00:00
Aaron Bohy 57da33a9ff [FIX] web: form: no "oh snap" dialog after view button clicked
Have a form view with a view button. Make some changes in the form
s.t. the create/write rpc will return an error. Before this commit,
the "oh snap" dialog was displayed, providing 2 choices to the
user: stay here (basically, close the error dialog and do nothing
else) or discard (discard changes, and continue the flow). In this
case, the flow is to do the "call_button" as we clicked on a view
button. It means that if the user clicked on discard, we still
call the method/action, even though the record was invalid (and
maybe not even existing if it was a new record). This can cause
other issues afterwards.

The "oh snap" dialog was designed for navigation flows (e.g. menu,
breadcrumbs...), when the user tries to leave the form view. It
doesn't fit very well with flows involving the current record that
couldn't been saved.

This commit thus prevents the "oh snap" dialog from being displayed
if the save preceeding a call_button fails. The error returned by
the save is simply displayed in a basic dialog that can only be
closed.

opw~3395109

closes odoo/odoo#135050

X-original-commit: 50b2a24f22cb470bcc1a9befe677cf794211d7b2
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-12 08:31:40 +00:00
Dylan Kiss (dyki) c81e89adf7 [FIX] account: fix drag and drop on journals
When trying to drop an invoice on a journal on the journal dashboard,
it fails with a message "Could not upload files". The issue is that
commit 6f95be6884 changed a CSS class
where the upload functionality depended on, making it fail.

This commit fixes this issue by adapting the CSS selector of the upload
field.

task-3496997

closes odoo/odoo#134965

Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-12 08:31:39 +00:00
Ali Alfie (alal) 04be1dff54 [IMP] account: add printed report name for invoices
Before: when attempting to print an invoice, the downloaded file had the generic name "Invoice".

Now: downloaded files have the correct invoice number as names.

task-3477659

closes odoo/odoo#135093

X-original-commit: 6b3555d93221ef6db9e3265a95b127a2bb743469
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Ali Alfie (alal) <alal@odoo.com>
2023-09-12 07:12:40 +00:00
hupo-odoo 8b35a2b54a [IMP] l10n_es_edi_facturae: include edi documents when mass export
in the following commit https://github.com/odoo/odoo/commit/f8654b3501aca6e5d77ced5f73cb351c61684cd2 , we fixed the feature to mass export edi documents from the journal entries list view. However, we forgot to include the Spain localization edi documents to be included in the export.

task-3477482

closes odoo/odoo#135072

X-original-commit: e62e1a647991fdd1ed38486b1a00f8de2812768c
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Hugo Poncelet (hupo) <hupo@odoo.com>
2023-09-12 07:12:39 +00:00
Maximilien (malb) 1fa963d55f [FIX] l10n_de: din5008
During this pr (https://github.com/odoo/odoo/pull/121413), we have made a few
css changes on the din5008 format, some of them needed to be revert because they
 broke the layout.

closes odoo/odoo#135000

Task: 3495712
X-original-commit: 650606708ae863fbc7f7c04903891047776fc903
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-09-12 07:12:37 +00:00
Sohail Jaidi (soja) 01761f8471 [FIX] account: fix unwanted reconciliation on draft reversed move
The aim of this commit is to prevent reconciliation with credit note  to be triggered when a reversed move is reset to draft

Context: reconciliation between credit note and invoice (same for vendor bill)

Previous to this commit:
Post invoice
Create and post credit note
Reset to draft both the invoice and the credit note
Post (confirm) again the credit note
-> User error due to attempt of reconciliation between credit note and draft invoice

After this commit:
The credit note is posted but not reconcilied

task-3492197

closes odoo/odoo#134526

X-original-commit: b61395337ca139b6a663628c70c52f8cce87d76f
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-12 07:12:33 +00:00
Yolann Sabaux 547a48f77b [FIX] account: display the move to check
Steps to reproduce:
- Set "To Check" for a bill in the Bill list view
- go back to the dashboard

Issue:
There won't be the "To Check" shortcut as it was the case in 15.0

opw-3455414

closes odoo/odoo#134432

X-original-commit: d8498091bc6e2cd441f5e4387e3833d1a2a1abc0
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-09-12 07:12:32 +00:00
Gaetan Vanden Bergh (gavb) bb3d665079 [FIX] auth_signup: False is different than NULL in SQL
Step:
- Setup one app free trial
- Create user on a trial database
- Go to the signup generated (token valid)
- Signup/Reset password

Actual result:
Token is "false"

Expected result:
Token is False/Null/None

Cause by #113753
opw-3482042
opw-3484705

closes odoo/odoo#134137

X-original-commit: e668e15f7ebc4e82cd08270733fa9c68e9944149
Signed-off-by: Vranckx Florian (flvr) <flvr@odoo.com>
Signed-off-by: Gaetan Vanden Bergh (gavb) <gavb@odoo.com>
2023-09-12 06:02:36 +00:00
Chong Wang (cwg) ddfdba9424 [FIX] core: update model terms for en_US and other
For model_terms translated fields if a translation for a lang(fr_FR) has never
been defined

before this commit
when update translations for both en_US and fr_FR, the new translation for fr_FR
cannot be saved.

after this commit
new translations can be correctly saved when en_US and fr_FR are updated at the
same time.

closes odoo/odoo#135103

X-original-commit: ef4b195eeac178a14eb47f4e6cc61ddc97f78866
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Chong Wang (cwg) <cwg@odoo.com>
2023-09-11 23:59:51 +00:00
william dacbe1d496 [FIX] web: company selector usability
Since 0eff29409d, the behavior was
unpredictable when clicking on multiple companies before a reload.

This simplifies the implementation and the behavior:
* the behavior is always the same even if there were already multiple
  companies selected: if one wants to add new companies they should use
  the check box instead.
* there is no more confusion due to the storage of the symetrical
  difference when toggling multiple companies and their children before
  the reload.

closes odoo/odoo#135086

X-original-commit: b07b30cd4b2a3e821a24761075ae0aecee332b14
Related: odoo/enterprise#47265
Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-11 23:59:51 +00:00
Soukéina Bojabza 68d89150b1 [FIX] website: fix traceback when customizing Google Map API key
Since commit [1], which converted the wysiwyg to Owl, trying to
customize the Google Map API key causes a traceback.

Steps to reproduce:
- In edit mode, go to the "Theme" tab.
- Click on the Google Map "Custom Key" button.
=> A traceback appears.

It happens because when getting the parent with the `this.getParent()`
call, the parent is now a `WysiwygAdapterComponent` component and so,
calling the `trigger_up` function on it does not work anymore.

This commit triggers the `gmap_api_key_request` event in a way that is
compatible with the Owl component.

[1]: https://github.com/odoo/odoo/commit/76d4f9811b756f0e57b0a33dbba534c900c7fe15

opw-3489976

closes odoo/odoo#135069

X-original-commit: 355a593fe2dea05a96d0491d684722770533ab7d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-11 23:59:48 +00:00
padh-odoo 619e5e0dad [FIX] sale: fix the sale order portal view
issue-:
   Broken the portal view because of totals.

Why the problem occurred:
    The col and margin both class are removed in below commit-
 https://github.com/odoo/odoo/commit/22c47fb003c7cfaccb732de5b8ea7277b9dade54

 fix:
  we re-induced col and margin class

task-3442343

closes odoo/odoo#135068

X-original-commit: a2fbda054a75e8dafcfa7d6f2c5897dda8846e4c
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-11 23:59:47 +00:00
Odoo's Mergebot 0304ede923 [MERGE] (test_)mail, various: prepare MC environment for mail tests
Purpose of this merge is to further cleanup and prepare tests for
multi-company enabled aliases, notably

  * activate multi-company environment by default in all mail tests;
  * avoid multiple init of gateway parameters;
  * fix leftover of bad alias management;

Followup of odoo/odoo# 130768 and odoo/enterprise# 45204

Followup of Task-3453577 (TestMail: Update Alias/Gateway tests for MC)
Followup of Task-3453343 (Mail: Cleanup Alias Usage)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

closes odoo/odoo#135055

Related: odoo/enterprise#47243
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-11 22:41:16 +00:00
Thibault Delavallée 3ea89e4d57 [FIX] test_mail, various: remove extra gateway initialize
When inheriting from the mail test class gateway initialization is done
automatically. No need to call it again.

Task-3453577 (TestMail: Update Alias/Gateway tests for MC)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#135055
2023-09-11 22:41:16 +00:00
Thibault Delavallée 3cbd037d02 [IMP] (test_)mail: activate multi-company by default
Have all mail tests be in a controlled multi-company environment by default.
Remove extra calls to '_activate_multi_company' as it is now part of the
base 'MailCommon' test class.

Task-3453577 (TestMail: Update Alias/Gateway tests for MC)
Prepares Task-36879 (Mail: Support MultiCompany Aliases)

Part-of: odoo/odoo#135055
2023-09-11 22:41:16 +00:00
aliya d914e60b2c [FIX] account: fill the journal code for general journal type
Currently, when a journal is created during import, we just use the journal name as the code.
However, that gets truncated to 5 characters on create, which can conflict with existing journals.
The import should be as flexible as possible, as it's better to let users import and fix things
after the import rather than debug the import file.
- If there is a journal with a shortcode that matches the truncated name of the new journal,
  just use the existing journal (enterprise PR)
- If the shortcode conflict arises within the imported file
  (so the journals don't exist before the import), keep track of the codes in `vals_list`.
  The `get_next_bank_cash_default_code` is modified to avoid duplicating code.

See also odoo/enterprise#46101

closes odoo/odoo#135051

X-original-commit: 1161307dc59d0c98eb1352fd80d95da7dc98e700
Related: odoo/enterprise#47242
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Aliya Tastemirova (alta) <alta@odoo.com>
2023-09-11 22:41:13 +00:00
Aaron Bohy 3faa9ab0a5 [FIX] web: resequence x2many ordered by id but id not in view
Have a form view with an x2many list with handle field and a
default_order containing id (e.g. sequence,id), but id not being
defined in the list view. Before this commit, on an existing
record, it was impossible to resequence records of the x2many.

The reason is that after resequencing (drag&drop), the model tried
to sort the records, and since the "id" field wasn't in the view,
but was in the default_order, records were reloaded and the changes
(the new sequences) were lost.

The "id" case is special because the field doesn't need to be set
in the view, it is always known by the model. However, it is only
available in record.data if it is defined in the view. This commit
treats the "id" field individually in the sort algorithm.

Bug reported in the new relational model feedback pad.

closes odoo/odoo#135045

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-09-11 22:41:11 +00:00
Touati Djamel (otd) 237748a980 [FIX] mrp: clear component when the BoM Changes
Steps to Reproduce the Bug:

- Create a storable product "P1" with 2 Bills of Materials:
   - BoM 1:
     - Component: C1
   - BoM 2:
     - Component: C2

- Create a MO:
   - Select BoM 1.
   - Save.
   - Select BoM 2 without saving. Result: The component C1 is deleted
   and replaced by the component of BoM 2.
   - Select BoM 1.

Problem:
The component of BoM 2 is not cleared. Because we check if the new BoM
is different from the original one, but since we didn't save the change
when selecting BoM 2, the `move_raw_ids` are not cleared.

Solution:
Clear the `move_raw_ids` if any move with `bom_line` is not linked to
the current BoM.

OPW-3473387

closes odoo/odoo#135044

X-original-commit: f874fd46fcf8c2668c6d2ab42224196868ec0f0a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-09-11 22:41:11 +00:00
Mathieu Walravens 6a0952a5b1 [FIX] stock: clean-up sequences at uninstall
When stock is uninstalled, the sequences used in the warehouses for the
picking types are kept. However, since [1], picking types cannot be
duplicated anymore. When the module is re-installed, the picking types
are created with the same name, which is not allowed by [1].

[1]: https://github.com/odoo/odoo/commit/9034602a028fb22fbd139cf41a2f5c71d9d8d032

opw-3484352

closes odoo/odoo#135036

X-original-commit: 7b0f38fea8bc9a541972d29f289e6175ee15919b
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Walravens Mathieu (wama) <wama@odoo.com>
2023-09-11 22:41:10 +00:00