Commit Graph
166695 Commits
Author SHA1 Message Date
Arnaud Joset 61eaaae4a6 [FIX] calendar: prevent userError when base_event is not defined
Before this commit, the follwing traceback was sometimes raised.

Error message
ERROR: TestCalendar.test_event_creation_mail
Traceback (most recent call last):
  File "/data/build/odoo/addons/calendar/tests/test_calendar.py", line 339, in test_event_creation_mail
    m.write({
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 574, in write
    self._rewrite_recurrence(values, time_values, recurrence_values)
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 1084, in _rewrite_recurrence
    update_dict = self._get_time_update_dict(base_event, time_values)
  File "/data/build/odoo/addons/calendar/models/calendar_event.py", line 993, in _get_time_update_dict
    raise UserError(_("You can't update a recurrence without base event."))
odoo.exceptions.UserError: You can't update a recurrence without base event.

closes odoo/odoo#139486

X-original-commit: bd1c46a79ea3d41a374fac47dd16af802d18045d
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-10-24 15:23:14 +00:00
Thomas Josse (thjo) 560e6ed4fd [IMP] mail: adds new props and buttons to handle comment Threads
This commit adds new optional props to the Message and Thread Components:
closeThread, openThread, avatarPlaceholder and showDates.
* `closeThread` is a function that enables the user to close an active comment
  thread.
* `openThread` is a function that reopens a previously closed thread.
* `avatarPlaceholder` is a boolean that will add an avatar placeholder
  (fa-user icon) when needed. For example when using Knowledge via the portal.
* `showDates` enables us to hide the dates showed inside the Thread component,
  it may not be useful for certain comment threads.

We also added a button inside the actionBox in the Message Component and it is
only rendered if we are on the first message of the thread.
The button can trigger either of the new function props depending on what is
provided to the component.

task-3317056

closes odoo/odoo#127380

Related: odoo/enterprise#41951
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-24 15:23:08 +00:00
Adrien Dieudonne a2016359d0 [REF] web, *: avoid extend on h5 for kanban card title
´extends´ generates a lot of css rules.

So in this commit, we remove it by replacing it by the ´h5´ html tag.

closes odoo/odoo#139484

Related: odoo/enterprise#49408
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
2023-10-24 13:55:30 +00:00
Christophe Monniez f194271823 [FIX] http: comply with rfc6265
Werkzeug changed the behavior of url_quote in
pallets/werkzeug@babfc93b38

Which appeared in Werkzeug 2.2.2 used in Debian Bookworm.

This change broke at least the export feature in Odoo. In summary,
the character set specified by [RFC5987] is more restricted than
that of [RFC3986]. So url_quote now allows invalid characters.

For example, a filename like `Journal Entry (account.move).xlsx`
leads to a crash of the client with Werkzeug 2.2.2.

url_quote is not really made to conform to [RFC6266] but we did not
find any [RFC6266] escaping tool in the standard library. This
commit explicitly specify as unsafe this list of chars.

[RFC6266]: https://datatracker.ietf.org/doc/html/rfc6266/ [RFC5987]:
https://datatracker.ietf.org/doc/html/rfc5987#section-3.2 [RFC3986]:
https://datatracker.ietf.org/doc/html/rfc3986/ [RFC2616]:
https://datatracker.ietf.org/doc/html/rfc2616#section-2

closes odoo/odoo#139483

X-original-commit: d145cb57eaf39fbe7612d4a79f209fc191828a8b
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:28 +00:00
Christophe Monniez 308854e4fc [FIX] packaging: build and test tgz from latest debian
The source packaging was a bit left behind, it was still using Debian
buster to build and test.

With this commit the Debian bookworm is used. As the installation of pip
packages as root is now forbidden, the build and tests are now using a
python virtual environment aka venv.

closes odoo/odoo#139482

Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-10-24 13:55:27 +00:00
Christophe Monniez 2cea8b1450 [FIX] packaging: fix rpm tests
As [postgresql 15] changed the permissions of the public schema,
when testing the rpm package with Fedora 38, the test fails with
`InsufficientPrivilege: permission denied for schema public`.

With this commit, we properly create the database with the odoo user.
While at it, let's do the same with the poor left behind tgz package.

[postgresql 15]: https://www.postgresql.org/docs/release/15.0/

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Christophe Monniez a05683fdd2 [FIX] packaging: force ofxparse install in rpm
When building the rpm package with Fedora 38, for an unknown reason, the
`python3-ofxparse` package refuse to be installed in the Docker image.

When specifying the `.noarch` specification the magic happens.

The reason remains obscure, nor I can't tell if it's linked to the
container itself.

Part-of: odoo/odoo#139482
2023-10-24 13:55:27 +00:00
Aaron Bohy da257e9d57 [IMP] web: save a has_group rpc at webclient startup
...when voip addon is installed.

We want to avoid predictable rpcs that are systematically done at
webclient startup. In particular, the voip service needs to know if
the user has group "base.group_user", which produces a rpc when
the service is started.

To avoid this, this commit adds the information in the page
directly. As this information is also useful at other places
(even though it's not at startup), we directly add it to the
groupCache of the user service (and we do the same for the
"base.group_system" group, which we also receive in the page).

closes odoo/odoo#139477

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-24 13:55:26 +00:00
Aaron Bohy e5161c86fe [IMP] hr_attendance: do not slow down webclient for attendance item
The attendance systray item needs data to determine whether or not
it should be displayed, and what to display. Before this commit, it
fetched it in the standard way, in onWillStart, and returned the
fetch promise.

However, for a systray item, it's better not to wait for the
promise, such that the webclient doesn't wait for it to be mounted.
In the case of this item, it is simply not displayed until data is
fetched, and when it is displayed, it's the right most item so it
doesn't produce any flickering.

This allows to save several ms on specific screens (e.g. home menu).

Part-of: odoo/odoo#139477
2023-10-24 13:55:26 +00:00
Victor Feyens 24c8ff9b28 [FIX] website_sale: address updates
Improved header (billing/shipping address instead of 'my details')
Keep the use_same input value on invalid form refresh

closes odoo/odoo#139474

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-24 13:55:25 +00:00
Victor Feyens 7a1f505e31 [FIX] website_sale: do not request shipping address when already given
* if customer said to use the same address as shipping
* if customer already chose/has/gave shipping address

Part-of: odoo/odoo#139474
2023-10-24 13:55:25 +00:00
Victor Feyens e18f6b8f5a [FIX] website_sale: clear empty ecommerce description
Part-of: odoo/odoo#139474
2023-10-24 13:55:25 +00:00
Brice bib Bartoletti d97a52cd1b [FIX] {l10n_}account_edi_ubl_cii/dk_oioubl/ro_edi{_tests}: remove DocumentTypeCode from standard
The aim of this commit to fix our bis3 e-invoice by setting the
DocumentTypeCode node only for the EDIs that fills its values otherwise
not setting that nodes.

Currently, we only set it for Denmark as it is mandatory, for Romania
because it was developped with it on the standard and we don't
set it for the others to be defensive. (Because it's not mandatory)

Before this commit:
All e-invoice based on BIS3 gets rejected.

After this commit:
BIS3 e-invoice pass the validation again.

Additional information:
Bis3 DocumentTypeCode node: https://docs.peppol.eu/poacc/billing/3.0/syntax/ubl-invoice/cac-AdditionalDocumentReference/cbc-DocumentTypeCode/
UBL 2.0 DocumentTypeCode node: http://www.datypic.com/sc/ubl20/e-cbc_DocumentTypeCode.html
UBL 2.2 DocumentTypeCode node: http://www.datypic.com/sc/ubl22/e-cbc_DocumentTypeCode.html

closes odoo/odoo#139468

Task-id: 3563754
X-original-commit: 1da22571c43fceedb4ab8c13aa9d0d6a78372595
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-10-24 13:55:23 +00:00
Jorge Pinna Puissant 54ae8f96cc [FIX] web: clickbot test modal menus
Before this commit, the clickbot avoid testing modal menus.

Now, the clickbot open and closed the modal menus.

task-id 3535596

closes odoo/odoo#139389

X-original-commit: 60e16f1e32a0e1448c91826ec06c1e0e8a7bb1fc
Related: odoo/enterprise#49352
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-10-24 13:55:20 +00:00
Loukas Wets (lowe) 01d59c7d39 [IMP] pos_restaurant: display ticket screen filter in the search bar
Prior to this commit when the ticket screen was opened from a table, the
orders were filtered by context. This commit displays the filter in the
search bar so it can be removed. This allows the user to simply remove
the search to display all orders. This commit also removes the display
order count when null from the POS burger menu.

closes odoo/odoo#139357

Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-10-24 13:55:18 +00:00
Sylvain Francis a17a271618 [FIX] Automatically open attachment box after attachments are loaded
Before this commit:
If attachments are not loaded by the time useEffect is triggered,
the attachment box is not opened

After this commit:
The attachment box opens after the attachments are loaded, if there are any
and the "open_attachments" option is set

The bug can be reproduced by adding a time.sleep here:
https://github.com/odoo/odoo/blob/saas-16.3/addons/mail/controllers/thread.py#L13
And is caused by:
https://github.com/odoo/odoo/pull/134527

opw-3532736

closes odoo/odoo#139336

X-original-commit: e6c232a2554af79b5003aaad7c3ce55126104b66
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Sylvain Francis (syf) <syf+odoo@odoo.com>
2023-10-24 13:55:17 +00:00
Rémi Rahir (rar) b2167e0a23 [IMP] spreadsheet: Add class props to SpreadsheetShareButton
Make the share button style parametric as we use it in different
contexts.

closes odoo/odoo#139302

Task: 3329419
Related: odoo/enterprise#49302
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-24 13:55:13 +00:00
Sébastien Theys d3b5ff1290 [FIX] mail: tests: fix "open the chatWindow of a channel from [...]"
Back-port test with `contains` from `master` and specify text present
on command before clicking it.

runbot-24981

closes odoo/odoo#138087

X-original-commit: ddc9da828ad338678bfa6e3b44461f87683b828f
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-24 13:55:11 +00:00
vlst 5a72165b95 [IMP] point_of_sale: simplify kanban view
In this commit we simplify the POS kanban view by replacing some
of the text shown to the user with more relevant versions.

Task 3562493

closes odoo/odoo#139246

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-10-24 12:38:32 +00:00
Benjamin Vray 6ac95d8e71 [FIX] website_blog: fix latest blog tag color
Since commit [1], the color combination system has been introduced,
affecting the colors of elements in the snippets. For the "blog" page
cover, it wasn't adjusted to work with this color combination system.
This resulted in inconsistencies, like the "Latest blog" tag having
nearly the same background and text color. This is because some elements
are affected by the chosen color combinations, while others have a
hardcoded color in the XML template (for example, the "text-white" class
on the blog title link).

In this stable version, we address this by ensuring that the text color
of the "latest blog" tag matches our original intention before the
introduction of the color combinations.

[1]: https://github.com/odoo/odoo/commit/69190959ce8e08481be7ebdfefd314edf0c5dce1

opw-3524351

closes odoo/odoo#139155

X-original-commit: 733ac082fbaf47ce02bd82a66e342a99f1780ff4
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-24 12:38:30 +00:00
Aaron Bohy a4069e25b6 [FIX] web: CodeEditor: do not notify value props updates
Before this commit, the CodeEditor component called the `onChange`
props function each time the ace library fired the `change` event.
This in particular happens the value of the editor is set
programmatically by a update of the `value` props. Worse, in that
case, the event is fired twice: once with the empty string, and
one with the new real value. This isn't what we want for the
CodeEditor API. We only want to notify the parent of updates done
by the user in the UI. This commit thus filters out the noisy
`change` events fired by ace.

This fixed an issue with the ResourceEditor of the website: select
a scss or js custom resource, click on Reset: the resource is
marked as dirty, because `onChange` is called when the CodeEditor
is updated with the new value.

closes odoo/odoo#139154

Related: odoo/enterprise#49286
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-10-24 12:38:30 +00:00
Aaron Bohy 87c6dde49d [REF] web,*: SearchDropdownItem becomes CheckboxItem
Before this commit, there was a special kind of dropdown item
defined in the search/ folder, named SearchDropdownItem, which was
basically a DropdownItem but with role "menuitemcheckbox" instead
of "menuitem". It allowed to displayed a check icon in front of
values to indicate that they are selected. It is used especially
in the search menu, to indicated which filters/groupbys/favorites
are active.

This specific item is used in other context that search (e.g. pivot).
A similar usecase has also been introduced in website, in the
ResourceEditor (the wowl version of the AceEditor).

This commit thus moves the component to web/core/dropdown and
renames it into CheckboxItem.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 85372ffa94 [REF] web,*: remove last legacy stuff from several bundles
This commit removes the last low level legacy stuff (e.g. Widget,
mixins...) from the backend bundle, and from the webclient bundles
of mrp_subcontracting and project. They are no longer used in the
backend. There're still necessary for the frontend and for the
web_editor though, so we had to manually add them in the lazy
loaded bundle of the editor. Hopefully, the last widgets and
dialogs will be converted soon, and we'll finally get rid of all
those legacy files.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 5b511e27b8 [REF] web: remove select2 from backend assets
The select2 library is only used in the frontend, now that the last
backend usecase (AceEditor) has been removed. This commit thus
removes the select2 library from the backend assets.

Part-of: odoo/odoo#139154
2023-10-24 12:38:30 +00:00
Aaron Bohy 28d85defa5 [REF] web: remove useWidget compatibility helper
Now that the last Component using that helper have been fully
converted to Owl (AceEditorWrapper -> ResourceEditor), we can
remove it.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy 3f3175d4ca [REF] website,web,web_editor: convert AceEditor to owl
This commit refactors the website AceEditor to owl. The wrapper
around the lib was defined in web_editor, and extended in website,
where it was used (single usecase). This commit thus introduces an
owl Component to replace it, directly in website, and specialized
to the website usecase.

This thus allows to remove the legacy implementation.

This also removes the last usecase of Widget and select2 library
in the backend bundle, which will allow to trim it down.

Part of task~3439226

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy fddb78a2af [IMP] web: SelectMenu: add autoSort props
By default, the SelectMenu component alphabetically sorts the
choices. Before this commit, this wasn't avoidable. As there's now
a usecase of SelectMenu where we want to enforce a specific order
on the choices (the website AceEditor), this commit introduces a
props `autoSort`, which is `true` by default, but which allows to
disable the sort.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy fff1fa0392 [IMP] web: add initialWidth props to ResizablePanel
This props allows to specify the initial width of the panel, whereas
before the initial width was the minimal width, i.e. the user could
only expand the panel, not shrink it.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy 4b79bbff82 [MOV] web: move ResizablePanel component to web
This component has been introduced in web_studio. We have now a
similar usecase in website, for the AceEditor component. We thus
move the component definition to web.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Aaron Bohy b545e68ccb [FIX] website: WysiwygAdapter: fix props definition
The `beforeEditorActive` props is a function, not a boolean. So
before this commit, there was a crash in debug mode when the
WysiwygAdapter was instantiated.

Part-of: odoo/odoo#139154
2023-10-24 12:38:29 +00:00
Lucas Lefèvre (lul) 99d93872a3 [FIX] spreadsheet[_dashboard]: avoid flicker
In the dashboard action, when switching from dashboard to dashboard, the
size of the control panel flickers. That's because the Share button is not
displays while the dashboard is loading and it takes some place, making
the control panel taller when it's displayed.

With this commit, the Share button is always displayed (disabled when the model
isn't loaded). In addition to fix the size flickering issue, it's also less
things appearing/disappearing from the UI (less sapin de Noël)

closes odoo/odoo#138816

Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2023-10-24 12:38:27 +00:00
Soukéina Bojabza 3be69751e7 [FIX] web_editor: hide grid gap preview when toggling the mobile preview
When changing the grid gaps (see commit [1]) a grid preview is displayed
in order to visualize the changes. As it cannot be displayed in mobile
view (otherwise, the layout looks broken), some code prevents it to be
added in this case. However, a case has not been taken into account:
- In desktop view, change the gaps of a grid with the "Spacing (Y, X)"
option.
- Before the preview disappears, quickly activate the mobile preview.
=> The preview is displayed (before disappearing).

This commit prevents the grid preview to be displayed in mobile view. To
do so, its height is forced to 0. Note that `display` could be set to
`none` instead but since it prevents the animation to be played, the
preview would not be removed by its listener.

[1]: https://github.com/odoo/odoo/commit/4345df3aeeb83463d81bc24749856fef3a58fb3a

task-3555898

closes odoo/odoo#138795

Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-10-24 12:38:26 +00:00
Alexis Lacroix c0bc8d9ea9 [IMP] spreadsheet: add date from_to global filter
Adds in date type global filters a new category
"From / To" allowing to define a domain between
two dates.

closes odoo/odoo#138507

Task: 3516362
Related: odoo/enterprise#48855
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-10-24 12:38:25 +00:00
Sébastien Theys 005b76462a [IMP] mail, im_livechat, *: simplify channel ACL
* = bus, crm_livechat, hr, mail_bot, test_discuss_full, test_mail,
    website_livechat

Now that livechat uses guest, we can write proper ACL for channel and
channel member to check if the current user/guest is a member.

This allows removing most sudo in code and to simplify search domains.
Remaining sudo in discuss folder have been reviewed and commented.

task-3394829

closes odoo/odoo#138330

Related: odoo/upgrade#5295
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-10-24 12:38:21 +00:00
Vivek Pathak 1dd012608a [FIX] website_forum: resolve traceback issue for 'View all' tags
Before the commit:
A traceback was generated when clicking on 'View all' tags.

Reason:
Issue from PR:- https://github.com/odoo/odoo/pull/129123. In the search box
template, the action value for 'View all' tags was incorrectly formatted,
't-valuef' was used with python expression instead of 't-value' resulting in an
erroneous URI path and causing errors.

After the commit:
The traceback has been resolved by using correct string formatting ensuring the
correct generation of the string.

Task-3525236

closes odoo/odoo#137984

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-24 12:38:19 +00:00
Adrien Widart (awt) dab82509fa [FIX] {sale_,}purchase_stock: handle extra qty on MTO SM
To reproduce the issue:
1. In Settings, enable "Multi Routes"
2. In Routes, unarchive MTO
3. Create a product P:
   - Storable
   - With a vendor
   - Routes: MTO + Buy
4. Create and confirm a SO for 10 x P
5. On the delivery, set the done quantity to 12
6. Validate the delivery

Error: The state of the delivery is set to _done_ but the SM has
changed, its demand is 2 and the done quantity is 0. Moreover, a
backorder has been created

Since [1], extra moves are supposed to be merged with the initial
one. However, there is an issue with the above case. The initial SM
has generated a POL (the product is an MTO-buy one). However, since
the extra move is an MTS one, it does not generate any POL. As a
result, the SMs don't have the same value for the field
`created_purchase_line_ids`. This is an issue because for two SM to
be merged, this field must be the same on both SM:
https://github.com/odoo/odoo/blob/ef3c21255c6f2b1172be3b1f8f0dc83bc276d806/addons/purchase_stock/models/stock_move.py#L20-L24
As a result, the SMs are not merged, the method `_create_extra_move`
only returns the extra move, the initial one is lost and it leads to
an unexpected behaviour.

We should also copy the values of `created_purchase_line_ids` to
ensure the merged of both initial and extra moves.

[1] f9867a5fa5

OPW-3504138

closes odoo/odoo#137869

Related: odoo/enterprise#48547
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-10-24 12:38:18 +00:00
aliya 6bec356e56 [IMP] l10n_lu: use sections in the tax report
LU tax report comprises of several sections and now we can restructure report,
so that the sections are split into different tabs, using the new sections
functionality.
This also allows for reusing one of the sections of the simplified tax report
in the full annual VAT declaration, thus avoiding a lot of duplication in the
xml files.

task-3074547

closes odoo/odoo#135783

Related: odoo/upgrade#5198
Related: odoo/enterprise#47525
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-24 12:38:15 +00:00
aliya 44ec363f82 [IMP] account: add external formula shortcut
account.report.line can have shortcuts for adding basic expressions
for various engines. This commit adds such a shortcut for external engine
so that reports with lots of external expressions (manual fields) can
be added easier and can be shorter.

Part-of: odoo/odoo#135783
2023-10-24 12:38:15 +00:00
Odoo's Mergebot 26b1f4d93d [IMP] mail, sms: process SMS delivery reports
Impacted = base, mail, mass_mailing(_sms), test_mail_sms,
test_mass_mailing

This PR adds support to receive sms delivery reports.

Before this PR, an SMS was considered 'sent' when successfully
handled by the third party. The user couldn't know if/when an
SMS was actually sent for delivery or delivered to the
recipient's device.
This was similar to the behavior for emails as delivery reports
are not commonly used (and not supported in Odoo).

With this work, the SMS `pending` state is introduced in mail,
mass_mailing, sms and mass_mailing_sms contexts although only fully
used in the latter two modules (+tests of course).

Because of the huge cost related to upgrading very large existing
databases, the following compromises were made:

1. An email and sms notification/trace SENT means DELIVERED.
  Those that are sent but NOT DELIVERED are PENDING.
  The difference between email and sms traces reinforced with this PR
  is that an email sent will be counted as "sent" ~ "delivered"
  unless an error is returned for emails while for SMS it can only be
  reached if a delivery report is received.
2. The Link between an SMS uuid (shared with trusted parties) and
  the tracking records (notifications or traces) is done via an
  explicit relationship table (sms_tracker) instead of via a new field.
  This however allowed to nicely concentrate the state update logic.

A `process` state is added to represent an intermediate
step in the sending process, such as held at IAP for SMS.

Additionally, we propose the removal of sms foreign keys 
with `mail.notifications` and `mailing.trace` records as they 
are not useful in the flows and prevented us from deferring 
the deletion of potentially many records with a cron job.

In the last commit, we refactor the SMS to not be a model (in env) but a
"regular" python class.

Task-2560666

closes odoo/odoo#133392

Related: odoo/enterprise#46996
Related: odoo/upgrade#5164
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-24 12:38:13 +00:00
Florian Charlier 103988c0a2 [REF] {mass_mailing_},sms: move sms api out of env
This will allow to make the environment lighter.

Task-3488393

Part-of: odoo/odoo#133392
2023-10-24 12:38:13 +00:00
Florian Charlier e8878a8b4c [IMP] {mass_mailing_,}sms: delay sms deletion
Also impacts test_mail_sms.

Purpose: let a cron do delete records to end the
sending transaction sooner.

Removing the foreign key between sms_sms and mailing_trace
is necessary as traces may have to be updated due to
delivery reports.
This is why we do it here and not with notifications
because only traces will trigger updates of a possibly
massive number of records and repeated concurrent updates.

We also replace the now obsolete "sms_sms_X" prefix as there
are not many "sms_id" to distinguish from.

Task-2560666

Part-of: odoo/odoo#133392
2023-10-24 12:38:13 +00:00
Florian Charlier bd5a68a1a7 [IMP] mail, mass_mailing, sms: process delivery reports
Also impacts mass_mailing_sms, test_mail_sms,
test_mass_mailing

This PR adds support to receive sms delivery reports.

Before this PR, an SMS was considered 'sent' when successfully
handled by the third party. The user couldn't know if/when an
SMS was actually sent for delivery or delivered to the
recipient's device.
This was similar to the behavior for emails as delivery reports
are not commonly used (and not supported in Odoo).

With this work, the SMS `pending` state is introduced in mail,
mass_mailing, sms and mass_mailing_sms contexts although only fully
used in the latter two modules (+tests of course).

Because of the huge cost related to upgrading very large existing
databases, the following compromises were made:

1. An email and sms notification/trace SENT means DELIVERED.
  Those that are sent but NOT DELIVERED are PENDING.
  The difference between email and sms traces reinforced with this PR
  is that an email sent will be counted as "sent" ~ "delivered"
  unless an error is returned for emails while for SMS it can only be
  reached if a delivery report is received.
2. The Link between an SMS uuid (shared with trusted parties) and
  the tracking records (notifications or traces) is done via an
  explicit relationship table (sms_tracker) instead of via a new field.
  This however allowed to nicely concentrate the state update logic.

A `process` state is added to represent an intermediate
step in the sending process, such as held at IAP for SMS.

A few adjustments are also included to update for IAP api v3.
Also, adapts and includes new tests.

Task-2560666

Part-of: odoo/odoo#133392
2023-10-24 12:38:13 +00:00
Rob Coekaerts c6c746299e [IMP] hr_holidays: compute multi-day leave duration with half days
Before this commit, if you had a working schedule with half days and
you took multi-day leaves, those half days would be counted as full days
so you would not use your allocated days to their full potential. The
work-around was to take these half days separately, so they would be
correctly counted as half days.

With this commit, the duration of these periods with half days included
is computed correctly. Additionally, if the leave type request unit is
'day' and the employee can therefore not take leaves with half day
precision, a warning will be displayed on the leave form view that
explains the employee is potentially losing out on their full allocated
potential.

task-3131517

closes odoo/odoo#133145

Related: odoo/upgrade#5238
Related: odoo/enterprise#46280
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-24 12:38:09 +00:00
Rob Coekaerts a9b804b1ad [IMP] resource: add duration to resource_calendar_attendance
Before this commit, conversion between worked hours and days in
resource_calendar_attendance was calculated but in reality there is no
unambigous way to do this. Eg in Belgium the morning working period is
4 hours, the one in the afternoon is 3 hours 36 minutes, while both of
them are still counted as half days.

To mediate this, the duration in days is explicitely added to
resource.calendar.attendance, with sensible default being provided
(half a day for morning and afternoon periods, 0 for lunch).

task-3131517

Part-of: odoo/odoo#133145
2023-10-24 12:38:09 +00:00
Tiffany Chang (tic) a33df072d8 [IMP] mrp: auto-print MO reception report
Add in feature to auto-print reception (allocation) report when the
MO is done. Note that only MOs with an allocation will be printed
otherwise the form will only have the MO name/barcode and nothing
else in it (i.e. not very useful).

Part of task: 3046178 - general auto-print goal

closes odoo/odoo#126791

Related: odoo/enterprise#43362
Related: odoo/upgrade#5298
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-10-24 12:38:06 +00:00
Tiffany Chang (tic) ab56ebe8e6 [IMP] stock: auto-print reception report
Add in feature to auto-print reception report at validation of picking.
Note that only pickings that have an allocation will be printed
otherwise the form will only have the picking name/barcode and nothing
else in it (i.e. not very useful).

Part of task: 3046178 - general auto-print goal

Part-of: odoo/odoo#126791
2023-10-24 12:38:06 +00:00
Tiffany Chang (tic) d43416c65d [IMP] stock: auto-print packages
Add in feature to allow auto-printing of packages at picking
validation

Part of task: 3046178 - general auto-print goal

Part-of: odoo/odoo#126791
2023-10-24 12:38:06 +00:00
Tiffany Chang (tic) f00f02d1ae [IMP] stock: auto-print return slips
Add in feature to allow auto-printing of return slip at picking
validation

Part of task: 3046178 - general auto-print goal

Part-of: odoo/odoo#126791
2023-10-24 12:38:06 +00:00
Tiffany Chang (tic) 9aa1836b5e [IMP] mrp: auto-print MO generated SN/Lot
Add in feature to allow auto-printing of lot/sn labels when the
`action_generate_serial` button is pushed.

Part of task: 3046178 - MRP behavior auto-printing
ENT PR: odoo/enterprise#43362

Part-of: odoo/odoo#126791
2023-10-24 12:38:06 +00:00
Tiffany Chang (tic) a560800411 [IMP] mrp: auto-print done MO lot labels
Add in feature to allow auto-printing of lot/sn labels when MO is done.
Note that this includes byproducts and does not consider the qtys done
since that is already printed as part of the product labels (which
auto-fills in their lot/SNs as their barcodes)

Part of task: 3046178 - MRP behavior auto-printing

Part-of: odoo/odoo#126791
2023-10-24 12:38:06 +00:00