Commit Graph
167758 Commits
Author SHA1 Message Date
Jorge Pinna Puissant ee0b81b06d [FIX] mail: scroll-down to older messages
- Open a record with the chatter (a task for instance);
- Zoom your browser until the chatter is inline with the task (as it is
  the case on mobile)
- Write a big message.

Before this commit, the composer takes all the allowed place on the
screen, and we cannot see or scroll-down to the older messages.

Now, the behavior is the same as is done in mobile, the composer stays
sticky, but it will not take all the allowed place, and leave place to
see and scroll-down the older messages.

opw-3593032

closes odoo/odoo#143427

X-original-commit: 26e8c0a74b9f0adb728c1d76ec7f45ec12623f6c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-11-24 23:57:31 +00:00
Theo VINCENT (thvi) 2b875c5870 [FIX] point_of_sale: opening difference account
- Since dd21c708cc08d484530bc7c8433ebbb79f59323a, the opening cash difference is not posted in the suspense account. This commit fixes that.
 - Removes the error preventing the deletion of cash difference journal entries.

 task-id: 3460173

closes odoo/odoo#139975

X-original-commit: 52681b588c8353721f0b3d40f1b013bf0fc23904
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-11-24 18:46:39 +00:00
thsh-odoo 1483a4945f [IMP] pos_restaurant: changes in demodata
Purpose
========
Update demo data to better show what Appointment can do.

Specification
==============
Changing the capacity of some tables.
Tables 1-4 => from 4 to 2.
Tables 9-11 => from 4 to 6.

Task-3496910

closes odoo/odoo#137673

Related: odoo/enterprise#48438
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-11-24 18:46:37 +00:00
Prakash Prajapati bbb4a2e08a [FIX] project: default focus set on sub-task title
Issue:
      When user add sub task then first field is focused.
Fixed:
    In this commit, we have made the title the default focus so that the user does not
    have to click manually and time will also be saved.

Steps:
     - Install project app
     - Active Task Dependencies
     - Create task and add subtask

task-3471102

closes odoo/odoo#143251

X-original-commit: 487a62a249e783ca15f95675a6cf43322b61d569
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-11-24 16:22:04 +00:00
Joseph Caburnay 680eaeff50 [FIX] pos_sale: runbot error 45368 (PosSettleOrderNotGroupable tour)
In this commit, we fix the last step of the PosSettleOrderNotGroupable tour
which is deterministically failing in runbot.

closes odoo/odoo#143229

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-11-24 16:22:04 +00:00
Loukas Wets (lowe) 79f6e17a48 [FIX] point_of_sale: application of pricelist on combo
Steps to reproduce:
- create an order with a combo product
- change the customer to a customer that has a custom pricelist

Bug:
Each combo orderline will be recalculated independently

Fix:
Extract the combolines price calculation from addComboLines. Modify the
setPricelist method to use the new price calculation method for the
combolines.

closes odoo/odoo#143168

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-11-24 16:22:03 +00:00
Florian(flg) 362ef0042a [IMP] l10n_dk_oioubl: Handle payment terms in oioubl xml file
The aim of this commit is handling the invoice payment terms
in the oioubl xml file.

closes odoo/odoo#142501

Task-id: 3422407
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-11-24 16:22:02 +00:00
Valeriya(vchu) 671640cf59 [IMP] website_sale, payment: create payment button widget
Before this commit, the payment button was part of the checkout/manage
form widgets, which caused conflicts when other modules needed to
enable/disable the button depending on custom conditions.

After this commit, the payment button logic is extracted in a separate
widget that handles its enabling after checking if all conditions are
satisfied. Other modules can extend the widget and override
`isButtonReady` to add custom logic.

task-3568861

closes odoo/odoo#142265

X-original-commit: 496c22f67b840a72758640576546ba16b177aafc
Related: odoo/enterprise#50783
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-11-24 14:59:41 +00:00
Renaud Thiry 71a61fb8d9 [FIX] website_event_track{_live}: prevent traceback when missing track_live
In the recent redesign of the `website_event` module(s)
[1] a field was used in the templates of event_track
that only exists if event_track_live is installed.

The `t-att-class` argument is now overriden in `event_track_live`.

task-3597612

1: 94c5bc3d152c80fdbb6798d9b4d28bf62740856b

closes odoo/odoo#142215

Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-11-24 14:59:39 +00:00
Abdelouahab (abla) 6021fd883f [FIX] base: report html must be parsed as unicode
To reproduce
============
having a special character in url like `à` (it's possible)
try to print an invoice, a weird character is printed next to currency symbol

Problem
=======
Apparently the method responsible of converting from string to html
analyzes the few first characters to determine the encoding,
so having the base url in the beginning with its special character
leads to wrong encoding.

Solution
========
convert using html parser with unicode encoding

opw-3415418

closes odoo/odoo#143462

X-original-commit: b1cf2a209230b4ace817ff51ab5f55f19b586b11
Signed-off-by: Rémy Voet (ryv) <ryv@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
2023-11-24 11:17:03 +00:00
hupo-odoo 912a918175 [FIX] l10n_eg_edi_eta: fix rounding issue for edi document
Step to reproduce the issue:
1) Install l10n_eg and l10n_eg_edi_eta modules and select the company EG Company
2) Configure all required fields to post an Invoice with an Egyptian company (wrong credentials are ok since the issue can be triggered without really sending the e-invoice)
3) Create an invoice with an invoice line that has a quantity of 12 and a price unit of 12.8 with a 100% discount
4) Post the invoice
5) open the created json document in the 'EDI Documents' tab

Result: The 'salesTotal' field has a value of 153.60000000000002, causing the E-invoice rejection by the authorities
Expected result: 153.6

opw-3569383

closes odoo/odoo#143463

X-original-commit: bb9a5137c292c5c84ac8df1cd6a64106375286a5
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-11-24 06:53:37 +00:00
Thomas Beckers b4227b5f5e [FIX] l10n_it_stock_ddt: only get ddt if outgoing picking type
When an Italian e-invoice is generated, it will include DDT sequence of
DDT stock moves. If those stock moves have picking type different of
'outgoing' (eg: Dropshipping), the picking type does not have DDT
sequence leading to a traceback.

Now we only consider DDT stock moves if they have the outgoing picking type.

Steps to reproduce:
- Create local database
- Install accounting, purchase, l10n_it_stock_ddt
- Switch to Italian company
- Activate dropshipping in settings
- Put Fattura Elettronica mode in "test" in settings ("demo" mode should be fine to)
- Create a a storable dropship product
- Create a sale order with dropship product and confirm it
- Click on purchase smart button and confirm purchase
- Validate to dropship transfer
- Create invoice from SO and confirm it (should get the DDT smart button)
- Click "Process now" on top of invoice => Traceback

opw-3544775

closes odoo/odoo#143461

X-original-commit: 27541b1e9b80db5234aff3a2591d1eb1ce9629a0
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-11-24 06:53:36 +00:00
tsm-odoo 999277cafb [FIX] mail: do not fold chat window when hiding it
Currently, a chat window is folded when hidden and the server is
notified. This is incorrect and leads to useless rpc calls/undesirable
fold state. A chat window is only hidden when space is lacking to display
them all. Only a user interaction should be able to fold a chat window.

Since folding the chat window when hidden is an implementation detail
only used to show the chat window header in the hidden windows dropdown,
this PR removes this behavior and adapt the hidden windows menu to
achieve the same result.

Steps to reproduce the issue:
- Go to Odoo, resize your browser so that it can only fit 2 chat windows.
- Open two chat windows, server is notified twice: so far so good.
- Open another chat window: server is notified twice: this is not correct,
the server should only be notified of the newly opened chat window.
- Reload the page: the server is notified once for each window not fitting
in the screen, this is incorrect as well.

task-3600480

closes odoo/odoo#143438

X-original-commit: 27f09bfc5049b1350b7e940a7beef92f63799771
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-11-24 06:53:36 +00:00
Youssef Bashandy c3cca02ac8 [FIX] crm : Individual contact address auto population
Steps to reproduce:
1- Install CRM app
2- Go to pipeline and create a new lead
3- Write a name for contact and click on 'Create and edit...'
4- Choose 'individual' as contact type and select the company related to this individual
5- the address will remain empty and will not be auto populated

Current behavior before PR:
The address is not auto populating when creating a new individual contact through a new lead. This happens because when you choose the contact type to individual the address type is not chosen so it is not populating any of the addresses

Desired behavior after PR is merged:
The address is now auto populating as I am passing to the form a default value for the contact type which is 'Contact' which is the default value when you create a contact from Contacts app

opw-3569833

closes odoo/odoo#143408

X-original-commit: ae51afafc606e5ca568864fdf04a0ea618bf242d
Signed-off-by: Jérémy Hennecart (jeh) <jeh@odoo.com>
2023-11-24 06:53:34 +00:00
Achraf (abz) e72ae4be88 [FIX] website_sale: Allow users to checkout with a positive fixed_price
Steps:
    - Install `website_sale`
    - Enable demo payment provider
    - Set a positive delivery fixed price
    - Go to /shop, add a product and checkout
    - Error "The cart has been updated, Please refresh the page"

Because amount in kwargs in `shop_payment_transaction` was compared to
`amount_total`to check the order but `amount_total` doesn't contains
delivery cost unlike `amount`

closes odoo/odoo#143404

X-original-commit: e79a35df5a62114d292c4357fe3e047c156d179b
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
2023-11-24 06:53:33 +00:00
clesgow 7406cf29b3 [FIX] mrp: display the right real cost on MO Overview
Steps to reproduce:
- Create a BoM with a single component
- Create a MO using that bom and confirm it
- Set more consumed components than planned and validate the MO
- Open the overview

Issue:
While the overview correctly displays the used quantity, the real cost
column still uses the initial demand to compute its costs instead of the
quantity used.

closes odoo/odoo#143401

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-11-24 06:53:32 +00:00
tsm-odoo 2eac72adca [IMP] mail: add ptt extension for chromium-based browsers
Currently, discuss push-to-talk only works when the browser has focus
because key events are not fired otherwise.

This commit adds an extension for chromium-based browsers that allows
to register a system-wide push-to-talk shortcut and adapts the rtc
service in order to listen to the extension events.

closes odoo/odoo#140752

Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-24 06:53:28 +00:00
Paolo Gatti (pgi) 8adb65993e [FIX] l10n_it_edi: issue with IDcodice
Copy-paste mistake in the template after refactoring.
IDCodice for the Sender has to be filled with the CodiceFiscale
and not with the VAT number.
(We only use VAT number if we don't find the CodiceFiscale.)

opw-3597050

closes odoo/odoo#143193

X-original-commit: 0c85e24a71442d0c0a717ee6264940047db1bdea
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-11-23 19:34:44 +00:00
omra-odoo 437f0367d5 [FIX] website_hr_recruitment: make the job location field not editable
This issue arises when attempting to edit the job location field for a remote
job or when there is no value in the job location, try to edit and save record.

Steps to produce :
- Install `website_hr_recruitment` module.
- Open a job position that has a remote job location or no value in the job
  location.
- Open editor > Edit that field and save the record.
- Error will be generated.

Error: int() argument must be a string, a bytes-like object or a real number,
       not 'NoneType'

This issue occurs because here
https://github.com/odoo/odoo/blob/5e0f5c98330ca1b5d0696c109c9e3a2050a6210c/addons/web_editor/models/ir_qweb.py#L215
it will get None and then when it will try to convert in int than error occurs.

after this commit user will not be able to edit the job location field.

sentry-4588277341

closes odoo/odoo#143065

X-original-commit: e8f1152daeef3d28a2f9e062e77e11303a26cef2
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-11-23 19:34:43 +00:00
Mathieu Duckerts-Antoine 71ee2c0995 [FIX] web: expression editor: between operator
We make the expression editor support the between operator.

closes odoo/odoo#142483

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-11-23 17:50:40 +00:00
Mathieu Duckerts-Antoine 40e0b4e324 [IMP] web: expression editor: model field selector
The component ExpressionEditorFieldSelector used by the expression editor
to allow the selection of a field has several drawbacks:
- the fields are not alphabetically ordered
- there is no possibility to (fuzzy search) a field
- the field types are not indicated in debug mode.
- the style is different from the classical style to be found in the
  domain selector.

Here we make the expression editor use a version of the ModelFieldSelector
component where the debug input is not shown. Indeed, this would require
some validation of the input value in order to prevent complex path like
user_id.company_id that are forbidden in studio for instance. Anyway,
there is not real need for such an input since it is easy to find/select
a simple path with the fuzzy search.

Task ID: 3599699

Part-of: odoo/odoo#142483
2023-11-23 17:50:40 +00:00
Zelong Lin 5d99de10ec [FIX] mail: do not reload chatter when not needed
This RPC /mail/thread/data is called on every
form view change, even when not saved.
It comes from the chatter onWillUpdateProps
and calling `load` then `fetchData`
We don't want to reload chatter when every time props updates.
Do it when the record `onWillLoadRoot`

closes odoo/odoo#140662

Task: 3569123
Related: odoo/enterprise#50607
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-11-23 17:50:37 +00:00
xO-Tx 56e37a6f55 [FIX] web_editor, website: fix invisible elements translation
Steps to reproduce:

- Go to website (in "Edit" mode) > Drop a new popup snippet > Make it
visible on all pages ("Show On" = "All Pages") > Save.

- Add a new language (e.g. fr) > Try to translate the page > A warning
is displayed: "Action 'get_page_option' was not able to be handled."

- Try to save > The "save" button just keeps loading and the same
warning is displayed again.

Now let's try to do the following actions [1]:

- Go to website (in "Edit" mode) > Drop a countdown snippet in the
footer > Set a conditional visibility on it (e.g. "Visibility" =
"Conditionally" = "Visible for Logged In") > Save.

- Try to translate the page > Save > We get the same error described
above.

Technical details:

Starting from [2], user has the possibility to translate invisible
blocks by allowing `_updateInvisibleDOM()` in "Translate" mode, which
makes them accessible in the edit bar.

In the case of an "All page" popup (The snippet is moved to the
`<footer/>` element to make it available on all pages...), the snippet
editor will be created with the parent's one (`<footer/>` in this
case) leading to the following behaviour when saving the page content
in "Translate" mode:

A- `cleanForSave()` called for all snippets...

B- `toggleTargetVisibility()` is then called for the `<footer/>` (which
doesn't have a `o_snippet_invisible` class).

C- `onTargetShow()` is consequently called allowing `_isShown()` to
check the footer visibility via the `get_page_option` action.

Since the navbar action widget (`ContentMenu` in this case) that handles
the action is not available in "Translate" mode, the action demand will
be aborted and we get the warning above.

Implemented solution:

- In "Edit" mode (for `s_popup` snippets):

The initial goal of this commit was to fix this behaviour by excluding
the parents when creation the `s_popup` editor in "Translate" mode.
But after some discussion, we prevent this behaviour for all `s_popup`
snippets (even in "Edit" mode) since they should not display their
parents options.

- In "Translate" mode (for all invisible snippets):

As described in [1], the issue will always occur if an invisible element
enables a parent option that needs action handers... And since we only
need to hide / display invisible elements to translate them, we also
prevent creating parents editors in "Translate" mode.

[2]: https://github.com/odoo/odoo/commit/04409af0571ed763c5712dbf857ea7dda81b2374

opw-3485565

closes odoo/odoo#143269

X-original-commit: 33e5bc36ecb5a4316ad7a61380461cb1663cb38a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-11-23 16:24:15 +00:00
Levi Siuzdak (sile) ff8d865583 [FIX] website_sale_loyalty: prevent TypeError
The try-except ensures `reward_id` is either an `int` or `None`, calling
`int` on it again doesn't do anything but risk throwing a `TypeError` if
`reward_id` was set to `None`.

closes odoo/odoo#143256

X-original-commit: fed6c4499b1a32aaeb8e7aeb1d89b3a27a8f8c73
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Signed-off-by: Levi Siuzdak <sile@odoo.com>
2023-11-23 16:24:13 +00:00
Levi Siuzdak (sile) 4020581d56 [FIX] website_sale_loyalty: match correct coupon code on checkout
Versions:
---------
- saas-16.3+

Steps to Reproduce:
-------------------
1. go to Sales / Products / Discount & Loyalty;
2. go to 10% Discount Coupons;
3. click on Generate Coupons;
4. generate for Selected Customers (yourself);
5. repeat to get a second coupon;
6. go to webshop and try to buy something;
7. at checkout, try to apply the first coupon.

Issue:
------
Clicking the coupon's "Use" button doesn't seem to do anything.

Cause:
------
The `claim_reward` method iterates over all potential coupons, always
selecting the last, most recent one, only to reject it if the code
doesn't match the coupon selected by the user.

Solution:
---------
Return as soon as a matching coupon is found.

opw-3562615

X-original-commit: 17d3862b27a5d388f37566d77a1790ef1b319589
Part-of: odoo/odoo#143256
2023-11-23 16:24:13 +00:00
roen-odoo 70f7448d45 [FIX] pos_sale: use display_name instead of name when settling orders
Current behavior:
If a product had a sales description, it was displayed in the order
when settling it from a sale order. But only the name should be
displayed in the PoS.

Steps to reproduce:
- Create a product with a sales description
- Create a sale order with this product
- Go to the PoS and settle the order from the sale order
- The name of the product is name + sales description instead of just
  the name.

opw-3547814

closes odoo/odoo#143241

X-original-commit: 2afb8dc80eccb2ba6c9d20982f0e869f5bde2397
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-11-23 16:24:11 +00:00
vifo ad68fb3cef [FIX] iot: Add module websocket client for windows
Before the windows image couldn't run because the module
websocket-client was missing, now it's added in the list of module to
install on windows

closes odoo/odoo#143205

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-11-23 16:24:10 +00:00
Julien Banken 1f594ea744 [FIX] web_editor: avoid conflict dialog when no versioning
When the user creates a new article in Knowledge using a template, the
system shows a dialog indicating that there is a conflict between the
client and the server. This commit will ensure that the conflict dialog
won't show up when the document does not have any versioning yet.

Steps to reproduce the issue:

1. Go on Knowledge
2. Open the editor
3. Click on the "Browse Template" button
4. Choose a template
5. Click on the "Load Template" button

Justification
---

When the editor is started, the system generates a new snapshot with ids
generated randomly (see: constructor of `OdooEditor`, `historyReset`,
`_historyGetSnapshotStep`).

When checking if the document is "stale" (i.e: out of sync), the system
verifies the existence of a history step with the id specified in the
`data-last-history-steps` attribute of the first node of the document
(see: `_isLastDocumentStale`). If such a history step does not exist,
the client document is considered "stale" and will be discarded. The
`data-last-history-steps` attribute is set by the last writer when
saving the document.

When creating an article from a template, the server generates a new
record and copies the template's body in the article's body. The system
does not set any `data-last-history-steps` in the document. As a result,
the document will be considered "stale" when opening the article and a
conflict dialog will warn the user that the current document will be
discarded.

This commit will update the `_isLastDocumentStale` function to ensure
that a document that has not been versioned yet won't be considered as
"stale". The `data-last-history-steps` attribute will then be set when
the user opens the article and save it.

task-3587990

closes odoo/odoo#143194

X-original-commit: 69e7694580ae20bb21de1316de5aa770e7ed8eed
Signed-off-by: Nicolas Bayet (nby) <nby@odoo.com>
Signed-off-by: Julien Banken (jbn) <jbn@odoo.com>
2023-11-23 16:24:09 +00:00
Anita (anko) 54bbfea08a [FIX] (sale_)loyalty: fix gift card without any product
When there was no product in 'Gift Card Products' every
product was generating product equal to it's value.
Now when there is no product specified, no product will generate
gift card.
opw-3415384

closes odoo/odoo#143270

X-original-commit: 3d64ab7cc54a8bb69f98885fd037b2d48b1c2c29
Signed-off-by: anko-odoo <anko@odoo.com>
2023-11-23 08:52:06 +00:00
Deependra Solanki 34550223aa [FIX] web_editor: fix url regex when containing symbols
Commit [1] introduces a stronger regex for url containing symbols. It did so by
using a negative lookbehind, which was not supported on some version of Safari
iOS and edge. Later commit [2] was introduced in attempt to reproduce the same
behaviour without using negative lookbehind but missed some cases such as github
compare link where the url had multiple symbols.

This commit is an attempt to reproduce the same behaviour like [1] while
improving [2].

[1]: a42a19e
[2]: ff99e45

task-3468646

closes odoo/odoo#143250

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-11-23 08:52:04 +00:00
Deependra Solanki de34fed834 [FIX] web_editor: improve url regex
Before this commit:

There were certain issues with the URL regex, wherein it failed to validate
against domain list under certain circumstances involving URLs with two dots.
for eg. this.document.anything

After this commit:

The URL regex is modified to ensure that if a URL regex does not ends with
the domains in tldWhiteList, it must start with http://, https://, www. or
if it does not start with http://, https://, www., it must end with a
domain from the tldWhiteList.

task-3468646

Part-of: odoo/odoo#143250
2023-11-23 08:52:04 +00:00
Tiffany Chang (tic) d9bdcd281b [FIX] mrp: use correct wording pick => consume
In pickings we "pick", in mrp we "consume", so let's make the warning
message consistent even if it is probably still confusing.

closes odoo/odoo#142933

Related: odoo/enterprise#51171
Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-11-23 08:52:01 +00:00
Tiffany Chang (tic) 55d01456fa [FIX] mrp: avoid lot_id req for manual consumption
During previous fix: odoo/odoo#141797, the `not move.picked` check was
moved to earlier in the if statement to avoid unnecessarily looping
through the move lines, but the ( was forgotten to be moved with it.
Since we don't want to force all manual consumption marked moves to have
a lot_id, let's move the (.

Part-of: odoo/odoo#142933
2023-11-23 08:52:01 +00:00
Paweł Fertyk fae2924f77 [IMP] stock: add spacing between return slip barcodes
Original requirement:

On the return slip, the 2 barcodes are too close to each other.
So, it's too easy to scan the wrong barcode. We should add a bit
more space between the 2 barcodes (For the demo, I had to take
another document for managing the scanning)

closes odoo/odoo#142916

Signed-off-by: Steve Van Essche <svs@odoo.com>
2023-11-23 08:52:00 +00:00
Paolo Gatti (pgi) 1b504038ce [FIX] l10n_it_edi: issue with IDcodice in Fattura Semplificata
In Fattura Semplificata, copy-paste mistake in the template
after refactoring.
IDCodice for the Sender has to be filled with the CodiceFiscale
and not with the VAT number.
(We only use VAT number if we don't find the CodiceFiscale.)

related PR: odoo/odoo#143122

opw-3597050

closes odoo/odoo#143240

X-original-commit: 2a9344e08edb935f29489286029a75d3d236adb0
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-11-23 01:20:12 +00:00
Flotchet 63aed562b4 [IMP] hr, hr_contract: correct wording
Correct the wording of "Visa Expire Date" to "Visa Expiration Date"
for the visa_expire field to be more grammatically correct.

task-3595978

closes odoo/odoo#143222

X-original-commit: 1722e62193d0b587e508d30b1d460498c1ea4c86
Signed-off-by: Bertrand Dossogne (bedo) <bedo@odoo.com>
Signed-off-by: Florent Maisse (mafl) <mafl@odoo.com>
2023-11-23 01:20:11 +00:00
Julien Carion (juca) 019e11bb93 [FIX] web: m2o: always display 'No records' if no result found
This commit fixes an issue where if one sets no_create_edit and
no_quick_create to true on a m2o while no_create is unset, no dropdown
is shown to tell the user that no record was found. Since the quick create
and create and edit options are disabled by default when create is false,
we no longer need it in the condition and can only rely on quick create
and create and edit.

task-3599696

closes odoo/odoo#143202

X-original-commit: 9da78c1b2bdd85f06e8682b99c8c481e91546ec7
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-11-23 01:20:11 +00:00
hungbui 4e7787b6f4 [FIX] loyalty: fix unable to open e-wallet program after archived
condition: install sale_loyalty only
"""
before commit:
right after archived e-wallet program, system will show python pop-up
error tuple index out of range
after commit:
able to open archived e-wallet program

closes odoo/odoo#143196

X-original-commit: 58a1c854b63a65e72b99b3466b3ef63a5e691e63
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-11-23 01:20:09 +00:00
Adrien Minne (adrm) d5f8d960c1 [FIX] spreadsheet: fix side panel input arrow
The arrow in the inputs of the side panel was stuck to the side of the input,
without any padding.

closes odoo/odoo#143191

Task: 3376873
X-original-commit: 97c2f7832669ce01f70ee0b5474328382b3f8c2f
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Adrien Minne (adrm) <adrm@odoo.com>
2023-11-23 01:20:08 +00:00
Adrien Guilliams (adgu) 7527e66daa [IMP] point_of_sale, pos_discount: hide discount product in point of sale
This commit prevent the discount product to be shown in the frontend of
the PoS and abling him to download demo data on the flight if he does
not have other products available.

closes odoo/odoo#143154

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-11-22 23:58:16 +00:00
Benjamin Vray 5941411376 [FIX] website: fix configurator pages with only one snippet
This commit fixes a bug in page creation by the configurator. This only
happened with pages containing only one snippet, like the "Pricing" page
or the "Privacy Policy" page (default themes). Because of this bug, the
snippet that should be placed in the page had its parent element
"<section>" replaced with a "<div>", so the section options were no
longer available in edit mode, such as background options,
delete/duplicate/save the snippet, etc.

When there was multiple snippets, it worked by chance:
`<section></section><section></section>` was parsed as
`<div><section></section><section></section></div>` using the etree lib.
The web_editor `save` method then copied each children and put them in
the targeted oe_structure.
However, with only one snippet:
`<section><div class="container"></div></section>`
it was parsed as it is, then same: each children was copied and put in
the targeted oe_structure... but the only child here is the `container`.
Then the classes of the section were transferred on the oe_structure
element.

Steps to reproduce the bug:

- Create a new website using the configurator.
- Check the "Pricing" box in the list of features to create the
"Pricing" page.
- Once the website creation is complete, go to the "/pricing" page.
- In edit mode, click on the "comparisons" snippet.
- Bug: Some options are missing for the snippet, for example, it's not
possible to delete the snippet or change its background.

task-3570903

closes odoo/odoo#143049

X-original-commit: 68ffe065c6fa03874ee8c99b91ca317d1c2755a3
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-11-22 23:58:14 +00:00
Adrien Widart (awt) ef604945d8 [FIX] mrp_subcontracting: decrease done quantity
To reproduce the issue:
1. Create a subcontracted product P
2. Create and confirm a planned transfer with 10 x P
3. Set the done quantity to 8
4. Set the done quantity to 7
5. Open the detailed operation (i.e., the MO)

Error: The producing quantity of the MO is 1, it should be 3

When setting a smaller done quantity than the demand (step 8), we
update the expected quantity of the related MO, we set its producing
quantity, and we create a backorder.

When decreasing the done quantity, we update/cancel the related
productions. But here is the issue: in the above case, we simply
decrease the expected quantity of the backorder, so we just lose the
cancelled quantity, the user "can't" produce this quantity anymore.

In such situation (when decreasing the done quantity), we should
consider the last production (i.e., the last backorder) as the WIP one.
So, we should update/cancel the other productions and increase the
expected quantity of this last backorder, so the user can produce it
again.

OPW-3557632

closes odoo/odoo#142513

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Quentin Wolfs (quwo) <quwo@odoo.com>
2023-11-22 23:58:13 +00:00
Adrien Widart (awt) 803237a9bf [FIX] mrp_subcontracting: set larger done quantity
To reproduce the issue:
1. Create a subcontracted product P
2. Create and confirm a planned transfer with 10 x P
3. Set the done quantity to 15

Error: The demand becomes 15

When setting the done quantity, we sometimes have to update the
demande (see [1]), but it should only happen with immediate transfer.

[1] 005b51fe019dfe3f7df25aefaca04a77bd5250aa

OPW-3557632

Part-of: odoo/odoo#142513
2023-11-22 23:58:13 +00:00
clesgow 7023769d64 [REV] mrp_subcontracting: avoid setting done qty on subcontracted SM
This reverts commit a32778d2b24af2774057f5428c53291653ddc6d3, as it was
a temporary fix in wait of the larger one included in this PR.

Task-3383596

Part-of: odoo/odoo#142513
2023-11-22 23:58:13 +00:00
clesgow 3005e7ac5e [FIX] mrp_subcontracting: avoid full cancel when multiple step record
Steps to reproduce:
- Create a subcontracted BoM for a product
- Create a planned reception for this product, with a demand of 10, mark
it as todo.
- Click on the moves details and in the 'Subcontract' wizard, set the
quantity to 5 and click 'Continue'.
- Now set the quantity to 2 and click 'Record Production'.
- Close the wizard without recording the last quantity.
- Validate the picking (there should be only 7 out of 10 quantity done),
and don't generate backorders.
- When checking the related Subcontracted MO (Inventory Overview ->
Filters -> Archived -> Subcontracting), all 3 MO related to this
reception were cancelled.

Issue:
When checking for the still active_productions, it wasn't taking into
account that there could be multiple still-active productions (like when
a production is recorded in multiple times like here). This messes up
with the 'in' condition, cancelling productions that shouldn't be.

Task-3383596

Part-of: odoo/odoo#142513
2023-11-22 23:58:12 +00:00
clesgow 4ffd1d86e4 [FIX] mrp: change qty_producing when updating product_qty
Currently, when no workorders are defined for a production, updating its
`product_qty` through the wizard won't update its qty_producing, meaning
that if the production gets validated right afterwards, the total
produced will be the same as prior the update.

This is missleading and unconsistent with how things work when
workorders are involved, since in that case the `qty_producing` of the
production will be updated through the inverse of the workorder's
`qty_producing`.

Also removed the verification on `produced_qty` as it will never be set
before the MO is done, and the wizard can't be accessed at this point.

Part-of: odoo/odoo#142513
2023-11-22 23:58:12 +00:00
clesgow ee9480e763 [FIX] mrp_subcontracting: keep consistency between move & production
Steps to reproduce:
- Manufacturing -> Configuration -> Settings -> Enable Subcontracting
- Proudcts -> Bill of Material
- Create a 'subcontracting' BoM for tracked (serial) product A from
supplier S
- Inventory -> Overview -> Receipts -> New planned transfer
- Set S as 'Receive from', A as product with qty 2 and hit save
- Open move details and record both serials.
- Now open the move details again and change one of the two move lines
lot_id to a new one and validate.

Issue:
Updating the subcontracted move's move.line `lot_id` won't change the
subcontracted MO. Which means that the link is lost between the picking
and the productions, breaking the chain in traceability.

When updating to a valid `lot_id`, now checks if there's a related
production that match the old `lot_id` to keep consistency.

Task-3383596

Part-of: odoo/odoo#142513
2023-11-22 23:58:12 +00:00
clesgow 3a644aba75 [FIX] mrp_subcontracting: set done qty in subcontracted pickings
Steps to reproduce:
- Manufacturing -> Configuration -> Settings -> Enable subcontracting
- Products -> Bill of Material
- Create a 'subcontracting' BoM for product A from supplier S
- Inventory -> Overview -> Receipts -> New planned transfer
- Set S as 'Receive from', A as product, 10 for demand and hit save
- Set 5 in the move's `quantity_done`
- Open the move details and try to record the qty, it's still possible
to record all 10 finished quantity
- If set to full quantity and saved, the move quantity will now be 15.

Issue:
In the case of a subcontracted move, only modifying the move's
`quantity_done` doesn't do much, as recording the components will add
the new `qty_producing` to the existing move's `quantity_done`, leading
to incorrect amounts if both are used.

The proposed solution here is to emulate what's done in the form when
updating the `quantity_done` of a subcontracted move. This is true also
for the generation of lot/serial numbers for the finished products, as
it would be done from quickly validating a MO through the form view.

The checks for lot/serial of component and finished products were moved
in the picking `_action_done()` rather than on the wizard itself.
This allows to set consumption of tracked components without giving a
lot, but still requires them to be set at final validation. The lots can
be assigned through the 'Register components for subcontracted product'
button.

By doing this both methods could be used correctly.

Task-3383596

Part-of: odoo/odoo#142513
2023-11-22 23:58:12 +00:00
clesgow d56eaf4a06 [FIX] mrp{,_subcontracting}: avoid late subcontract MO
Steps to reproduce:
- Manufacturing -> Configuration -> Settings -> Enable subcontracting
- Products -> Bill of Material
- Create a 'subcontracting' BoM for product A from supplier S
- Inventory -> Overview -> Receipts -> New immediate transfer
- Set S as 'Receive from' and A as product and hit save.

Issue:
A warning appears next to the scheduled date saying the preceding
operation (the subcontracted MO) is scheduled from one hour later than
this picking. This only happens for immediate transfers.

When picking's `_set_scheduled_date()` is called, this ultimately leads
setting the subcontracted MO's date planned/finished to that same date.
But since the `date_planned_finished` is implicitely readonly, its value
is recomputed right after it was set, as it depends on
`date_planned_start`, which was updated at the same time.

Also, in case of subcontracted MO, the `date_planned_finished`, the
start and finished date are usually the same, so there's no need to add
the default 1 hour between the two dates. It's done at the creation for
subcontracted MO, but any update would recompute the date to start + 1
hour and raise an useless warning on the subcontracted picking.

Task-3383596

Part-of: odoo/odoo#142513
2023-11-22 23:58:12 +00:00
Isaac Gallart Bochons ca217195d7 [FW][FIX] base: postgres subprocess error when dumping database
When Odoo is installed with the latest version of the PostgreSQL client (postgres-client or postgres-client-16) and running in Docker (possibly other environments as well but not reproduced so far), executing `pg_dump` via `exec_pg_command` fails with

    Database backup error: Postgres subprocess ('/usr/bin/pg_dump', '--no-owner', '--file=/tmp/tmpmnqiktog/dump.sql', '15TEST') error 1

This seems to be because `os.devnull` is being opened in *read* mode which is incorrect (as it's written to). It's not entirely clear if older `pg_dump` simply ignored the non-writable stdout or if docker adds some restrictions which cause the failure.

Either way this can be solved by either opening `os.devnull` in write mode or switching to the `DEVNULL` constant. While the function is deprecated in 16.0 (7f14631fe8) and removed in master (ae3056f3f4fca82c6aee69bf201532e14829c45e) the latter is not a huge change and it a touch cleaner.

fixes #139687

closes odoo/odoo#143198

Forward-port-of: odoo/odoo#142987
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-11-22 21:45:11 +00:00