Commit Graph
166202 Commits
Author SHA1 Message Date
Benjamin Vray e9cc96ddf2 [FIX] fix dropping the facebook snippet onto the page
Since commit [1], the 'jquery.ba-bbq' library has been removed. Now,
when you drop the Facebook snippet into a page, there is a traceback.

This is because we were still using the 'querystring()' function from
'jquery.ba-bbq' to combine the parameters of the Facebook iframe's URL
with its URL.

[1]: https://github.com/odoo/odoo/commit/507c36883675a45a15485ce5c73aa4557ba23639

task-3543529

closes odoo/odoo#138592

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-14 01:24:54 +00:00
Pierre Masereel 55e3b8f30c [IMP] base_import_module: use only one wizard
The wizard is overriden by studio, but we don't really need it so, we
modify it and we'll remove the override for studio.

closes odoo/odoo#138520

Related: odoo/enterprise#48860
Related: odoo/upgrade#5274
Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
2023-10-14 01:24:51 +00:00
Joseph Caburnay e227e7c3a2 [IMP] point_of_sale: consistent price on the combo lines
**ISSUE**

- Given a combo product with 2 combo_ids (pos.combo).
  - Combo A
    - A1, A2
  - Combo B
    - B1, B2
- When adding this combo product, it's possible that the user selects the
  combination A1 & B1.
- And in another order, A2 & B1.
- ISSUE: Between those two orders, prices of first line (component A) will be
  different. What we want is that the price of line corresponding to a component
  (pos.combo.line) is consistent between orders.

**SOLUTION**

This can be achieved by establishing a constant in each pos.combo.line. We
choose the minimum lst_price of the components as this constant which we call as
`base_price` field.

The calculation will be practically the same as before, except unit price is now
based on the `base_price` field:

- Compute the original price - which will be based on the `base_price`.
  - Recall: `base_price` is the minimum price among the `combo_line_ids` of a
    pos.combo.
- We then divide the original price to the target price (which is the price of
  the combo product) which we'll call the "prorateFactor".
- The price of the components are computed by multiplying the "prorateFactor" to
  the `base_price`.

**Rounding error:** Both the original procedure and the new strategy introduced
in this PR suffers from rounding error. To prevent the rounding error, we
compute the error and distribute it to the last line of the combo.

**Combo (Extra) Price:** The `pos.combo.line.combo_price` is added on top of the
prorated price.

closes odoo/odoo#138352

Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2023-10-13 23:20:15 +00:00
Joseph Caburnay 5fc63dea81 [FIX] point_of_sale: make sure no trailing space in product name
**Steps to reproduce:**

- Install pos and pos_restaurant.
- Make sure preparation display tracks a pos.category, e.g. 'Food'.
- Open restaurant with the 'Food' category in mobile mode.
- ISSUE: The product reminder just above the 2 switch pane buttons is not shown.

**FIX:** The product reminder is not shown because the "change" name used in the
calculation for comparison has a trailing space. We just have to make sure that
the trailing space is not there.

Part-of: odoo/odoo#138352
2023-10-13 23:20:15 +00:00
Joseph Caburnay 874c7fc6b5 [FIX] pos_self_order: show correct total in order widget
Part-of: odoo/odoo#138352
2023-10-13 23:20:15 +00:00
Joseph Caburnay c3e412aafd [FIX] point_of_sale: products w/ unloaded category belong to root
It's possible that a product is loaded but its pos.category is not, e.g. when
loading a menu product (product with detailed_type='combo'), the components will
also be loaded.

In this case, the product's pos.category will be null and the product won't be
visible even when in the root category. This commit makes sure that if a
product's pos.category is not loaded, the product will be visible in the root
category.

Part-of: odoo/odoo#138352
2023-10-13 23:20:15 +00:00
Josse Colpaert 14886eb662 [IMP] l10n_ec: add active field on payment method
Because some payment methods get deprecated or are
used very little, an active field comes in handy.

closes odoo/odoo#137914

Related: odoo/upgrade#5253
Signed-off-by: William André (wan) <wan@odoo.com>
2023-10-13 23:20:14 +00:00
Josse Colpaert 331eaf2122 [IMP] l10n_ec: remove unused field l10n_ec_emission_type
The field was foreseen in advance in the community module,
but the final implementation of the electronic invoicing
did not need it.

Part-of: odoo/odoo#137914
2023-10-13 23:20:14 +00:00
niyasraphy 168b56e069 [IMP] product: pricelist option in label printing
before this commit, on printing product labels there
is no option to select the price list, always the
printed price is the default product price

after this commit, in the label printing wizard
the price list field is introduced and user can
select the price list before printing the labels

closes odoo/odoo#137190

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-13 21:11:55 +00:00
Benoit Socias 3c72683aac [REV] website: avoid crash in search snippet when page has no url
This reverts commit f75ec6131eff9165b06d42d27a49dd756387f4a0.

task-3443119

closes odoo/odoo#136764

Related: odoo/upgrade#5195
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-10-13 21:11:53 +00:00
Benoit Socias b082a1a546 [IMP] website: make website page URL required
Commit [1] was made to avoid that the search snippet fails when there
are pages without URLS.

In master this can be reverted and the URL field can be made mandatory.

[1]: https://github.com/odoo/odoo/commit/f75ec6131eff9165b06d42d27a49dd756387f4a0

task-3443119

Part-of: odoo/odoo#136764
2023-10-13 21:11:53 +00:00
Valeriya(vchu) 997aa444cb [IMP] payment: payment methods improvements
closes odoo/odoo#136525

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-10-13 21:11:53 +00:00
Bruno Boi 25423820ed [REF] web,mail: add popover props: arrow,animation
Better API as the arrow was not displayed when the fixedPosition
prop was true, which is as we were mixing apples and pears.

And as for the animation prop, it permits to remove the hacky
"o-fast-popover" class usages.

closes odoo/odoo#135188

Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
2023-10-13 21:11:52 +00:00
Bruno Boi 31c52824be [REF] web_tour: replace a deprecated function
**Before this commit**
The TourPointer component make use of a deprecated
function (reposition) in order to position itself.

**After this commit**
The TourPointer now make use of the usePosition hook,
which is the recommended way to compute this kind of positioning.

Part-of: odoo/odoo#135188
2023-10-13 21:11:52 +00:00
Bruno Boi b449ae6036 [IMP] web: improve usePosition API
**Before this commit**
The usePosition hook takes two arguments:
- the target element (could be a function returning an element)
- the positioning options, which are optional.

This API is a bit weird for these reasons:
- the target argument's type is variable
- the "popper" option is not very meaningful and has a
  default value of "popper", which is not clearly stated

**After this commit**
The usePosition hook now takes three different arguments:
- first is "refName", which is the reference to the element to position
  in the template
- then is "getTarget", a callback that must return the target element,
- finally the "options"

Part-of: odoo/odoo#135188
2023-10-13 21:11:52 +00:00
padh-odoo f610fb1d31 [IMP] hr_timesheet: improve add pivot and graph view for my timesheet
Improve added pivot and graph view for my timesheet in the timesheet app.
- Before this commit there was no pivot and graph view for my timseet in
  timesheet app.
- In this commit pivot and graph view is added or my timseet in
  timesheet app.

Task-3479322

closes odoo/odoo#134495

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-13 21:11:50 +00:00
Guillaume (gdi) 614dc4a517 [FIX] website: prevent default image drag and drop
By default, images on websites can be dragged and dropped in browsers.
As we have a custom drag & drop system, this commit removes the default
drag & drop behavior during the edition of a website page. In addition,
this commit prevents `OdooEditor` from managing drag and drop on images
that should not be dragged and dropped by the user.

task-3369600

closes odoo/odoo#125151

Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-10-13 21:11:50 +00:00
Guillaume (gdi) 514d3dbad4 [IMP] web_editor: permit drag images and start from anywhere on it
Before this commit when the user was dragging an image in the editor,
the image was always dragged from the top middle of the image. Now the
user can drag the image from anywhere on it.

task-3369600

Part-of: odoo/odoo#125151
2023-10-13 21:11:49 +00:00
Guillaume (gdi) cff6f79b5f [IMP] web_editor: permit to drag images
This commit permits to drag and drop images directly (without using the
`o_move_handle`) with the website drag & drop tools. The user can
directly drag the image in edit mode by grabbing the image itself. It
was already possible to drag the image itself but this commit permits to
activate the website tools (grid mode, see dropable areas, etc.) while
dragging the image.

task-3369600

Part-of: odoo/odoo#125151
2023-10-13 21:11:49 +00:00
moerradi b79565785d [REF] l10n_es: Refactor mod 111, 115, 303 to use tax_tags engine
This commit replaces the outdated expressions and unsigned tags in mod 111, 115, and 303 with tax_tags expressions. This update follows the removal of the old technical decision after Reportalypse. A migration script is included to ensure proper conversion of accounting history. As a result, Spanish reports are more standardized and performance is significantly enhanced due to batching in the tax_tags engine.

closes odoo/odoo#120675

Task-id: 3126178
Related: odoo/enterprise#40777
Related: odoo/upgrade#4800
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-13 21:11:46 +00:00
Himanshu Rohit 157c8b6493 [IMP] project: improve ux for project
The purpose of this commit is to do generic improvements to the project.

In Commit, made the following changes:

   - replace the rating % by the value out of 5 in the project kanban card.
   - replace the rating % by the value out of 5 and satisfaction by average rating in the
     project update right-side panel.
   - add the placeholder in project stages and project task type.

task-2962386

closes odoo/odoo#99474

Co-author-by: Manisha Tulsiyani <matu@odoo.com>
Related: odoo/enterprise#31013
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-13 21:11:45 +00:00
dane@odoo.com 6644cb7e3a [IMP] link_tracker: allow multiple clicks
This PR removes filter on ip so that each click should count as one.
previously multiple clicks from the same device only counted as one,
but now because of the ip removal, they are being counted as many
times as you go to the link.

task-3328661

closes odoo/odoo#132812

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-10-13 19:14:53 +00:00
Maximilien (malb) dc7328ff0f [IMP] account_reports: hide line at 0
In the enterprise PR, we allow to have a new options on reports that can hide
line that are equals to zero under certain condition.

A line should be visible depending on its value and the ones of its children.
For parent lines, it's visible if there is at least one child with a value different from zero
or if a child is visible, indicating it's a parent line.
For leaf nodes, it's visible if the value is different from zero.

This commit add the filter in the account_reports model.

closes odoo/odoo#130897

Task: 3359936
Related: odoo/enterprise#45291
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-13 17:00:44 +00:00
roen-odoo 8554e6f88c [FIX] pos_restaurant: fix blank receipt print
Current behavior:
When trying to print the bill in PoS restaurant from a mobile device,
the bill appears completely blank.

Steps to reproduce:
- Open Odoo on mobile device
- Go to PoS restaurant
- Create an order
- Click on the "Bill" button
- Click on the "Print" button
- The bill is completely blank

This is happening because on mobile after clicking on the "Print" button
the pos directly return to the order screen. What happens when you do
`window.print()` is you basically do a screenshot of the screen with
some specific CSS rules. But on mobile, we go back too fast on the order
screen and the screenshot is empty.

opw-3507918

closes odoo/odoo#138282

X-original-commit: ebf214944097b9731a2a5dcf53d367715ceb8a35
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2023-10-13 15:54:27 +00:00
luve-odoo 7cf8b9f4ae [FIX] project : traceback with multi-company
How to reproduce:
    - Link 2 distinct projects to at least 2 different companies
    - Modify and save any setting in project settings (this action
    should trigger the write function of the project)
    --> Traceback: expected singleton

Why?
    - If projects associated with differing companies are updated
    collectively, the condition self.company_id.id anticipates a
    singular value, but it’s possible for there to be multiple.

Solution:
    - When we want to write a company_id on some projects, take back the
    ones already with the right companyc(as we don't have to change their
    stage) and then write the first stage found on the other records (
    by putting self.company_id.ids in order to avoid the singleton
    exception).

taskid:3520107

closes odoo/odoo#136614

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-10-13 15:54:25 +00:00
Saurabh Choraria 85b5ddfc0d [FIX] base_import: accept single character in text delimiter
When a user tries to import the CSV file with an empty text delimiter
or more than one character in text delimiter at that time the traceback
will be generated.

Steps to reproduce:
- Install Accounting module.
- Click on import in the bank statement.
- Select any CSV file for the bank statement line or can download and import
this file - https://drive.google.com/file/d/1lnScw4RN6T01pOkyNON8vvb3FQOPiy1O/view?usp=drive_link
- Enter empty text delimiter or more than one character in text delimiter.
- Click on the test or Import button.
- Error will occur.

Error: ValueError: Unsupported file format "text/csv", import only supports
CSV, ODS, XLS and XLSX

The issue is occurring because text delimiter (options['quoting']) is used
as quotechar while reading csv file and quotechar is always a single
character string. Check here -
https://github.com/odoo/odoo/blob/0fde590bee71618f78e5f954349530bd007c62cf/addons/base_import/models/base_import.py#L494-L497

To solve this issue the length of text delimiter has been checked and if it
is not equal to one then a warning is given to the user.

sentry-4390461991

closes odoo/odoo#138638

X-original-commit: 1f4aa620779ebe6a0cb7f7ca1910080a258d6fac
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Saurabh Choraria (sauc) <sauc@odoo.com>
2023-10-13 14:14:05 +00:00
tsm-odoo 8bf49da5a7 [FIX] website_livechat: fix tour failing nondeterministically
This commit fixes the `website_livechat_chatbot_flow_tour` that was
failing in a nondeterministc way. This is due to the tour sometimes
taking more than `60` seconds which is the default timeout for python
tours.

Most of the time is consumed waiting for the user to finish its
multiline input. This issue is solved by shortening the delay to
consider the multiline input as done: from `10`s to `500`ms.

fixes runbot-24557

closes odoo/odoo#138629

X-original-commit: cdca70941dab1b20dca9bdf9d44d354327176b59
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-13 14:14:04 +00:00
Sina Chaichi Maleki (cmsi) 6357e6dd3a [IMP] hr_recruitment: refine user access to job positions view
Previously, a user could be a recruiter but not an interviewer. With the
new changes, the recruiter role is also an interviewer. On the job
positions kanban view, the functionality of the "X to Recruit" link
depended on whether a user was an interviewer or not. Now, since an
admin is also an interviewer, they only have interviewer access and can
only see the application list, which is not desired. In this commit,
we've changed the condition from being an interviewer to being a
recruiter. Consequently, the admin can navigate to the job position
edit form while interviewers only see the application list. Users with
neither role won't see the kanban view at all, so there's no concern
regarding that.

closes odoo/odoo#138628

Task: #3471557
X-original-commit: 06712c3a2c34ece2dc1b93180a270da46e7e5966
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 14:14:00 +00:00
Ken Luzuriaga 4c0a5ed445 [CLA] add new member to CLA Trescloud
closes odoo/odoo#138627

X-original-commit: 04d199187e2d698f6adfcca34121454ed0a188b6
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-10-13 14:13:58 +00:00
Brieuc-brd 1d512330a5 [IMP] pos_restaurant: add app icon
task-3542892

closes odoo/odoo#138561

X-original-commit: 837b121a67ffd8c3e7d7d64d4e2c20e5a0f46951
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-10-13 14:13:56 +00:00
Pierre Paridans 35122d5c7c [REF] *: use raw CSS rules instead of extend utility classes
*:mail,portal,project,web

task-3546717

closes odoo/odoo#138615

Related: odoo/enterprise#48920
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-10-13 11:46:30 +00:00
Pierre Paridans daf05c241e [IMP] calendar,web: extract static CSS rules out of loops
This commit seperates the static and color dependent rules for the
Calendar view and app to avoid duplicating the static ones.

task-3546717

Part-of: odoo/odoo#138615
2023-10-13 11:46:30 +00:00
Ricardo Gomes Rodrigues 8b4719a0d0 [FIX] account: allow import of receipts
Steps to reproduce:
- Activate the receipts in the Accounting Settings
- Go to Vendors -> Receipts
- Upload a file
-> Error "The journal in which to upload the invoice is not specified."

opw-3544292

closes odoo/odoo#138612

X-original-commit: 00bad1954cd0bda21a7ec58f8ea8000a78e551ad
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-10-13 11:46:29 +00:00
Aaron Bohy c5f92537fc [FIX] web: search view: evaluate invisible attrs
Since [1], invisible attributes on views are no longer evaluated
server-side. In search views, field and filter nodes can have an
invisible attribute which can be static ("1" or "True") or dynamic,
depending on the context (e.g. "context.get('something')"). Before
[1], in the arch received by the client, the value of the invisible
attribute was always static as "context.get(...)" expressions were
evaluated server-side. This is no longer the case, and we thus have
to evaluate the expression client side.

Before this commit, the invisible attributes in search archs were
simply ignored if they weren't static. This could be observed for
instance in Project > open a project: the "Private tasks" filter
was available even though it is dynamically invisible, and shouldn't
be there.

This commit ensures the invisible attributes are always taken into
account and evaluated.

[1] odoo/odoo@ba1a5509fa

closes odoo/odoo#138590

Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 11:46:28 +00:00
tsm-odoo 2a69035e38 [FIX] im_livechat: do not overwrite author of message format
Before this commit, the `_message_format` override of the live chat
module would overwrite the author. Since [1], values provided by the
live chat override are incomplete which result in incorrect message
display in the discuss app. This commit modify the live chat override
to enrich the author instead of totally overwriting it.

Steps to reproduce:
- Log in with mitchell admin
- Change its live chat user name in its profile
- Open a chat with a visitor
- Send a message with mitchell
- The message is incorrectly marked as sent by the visitor

[1]: https://github.com/odoo/odoo/pull/137276

closes odoo/odoo#138533

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-13 11:46:24 +00:00
maad-odoo 038b0e4fd2 [FIX] mail: Left border of the 'send' button is missing after clicking on it
Before this commit:
When we click on 'send' and 'log,' the left border disappears for
a short while.

After this commit:
The left border on the 'send' and 'log' buttons is visible even after
clicking on them.

task-3549138

closes odoo/odoo#138513

X-original-commit: ec42f19ad2996f1c471ea520ce0211f4d9e2ab0a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-10-13 11:46:23 +00:00
Pierre Rousseau cb5d5fe15a [REF] spreadsheet, spreadsheet_dashboard: use MultiRecordSelector
This commit replaces the RecordsSelector component by the MultiRecordSelector
component in the global filters of the spreadsheet and the spreadsheet
dashboard. Thus, the RecordsSelector component is not used anymore and
can be removed.

Part of task-id 3433922

closes odoo/odoo#138464

Related: odoo/enterprise#48857
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-10-13 11:46:21 +00:00
Pierre Rousseau 29e301fe32 [IMP] web: multi record selector: add keyboard navigation
This commit adds keyboard navigation to the multi record selector.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau d949e001c9 [IMP] web: introduce useTagNavigationHook
Currently, the newly created component `MultiRecordSelector` (https://github.com/odoo/odoo/commit/bd0f2c6d799961b0a41222652eae7214c01dc5fe)
does not support the keyboard navigation between its tags (selecting or
deleting a tag). This behavior is currently implemented in the
`Many2ManyTagsField` component. This commit extract this behavior from
the `Many2ManyTagsField` component into a new hook that will be used by
the `MultiRecordSelector` component.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Pierre Rousseau 78a859e0a1 [IMP] web: support placeholder for record selectors
This commit introduces the support for placeholder in record selectors.

Part of task-id 3433922

Part-of: odoo/odoo#138464
2023-10-13 11:46:21 +00:00
Roy Le bb323e3989 [FIX] account, sale: avoid error when internal user (no accounting
permissions) edit information at /my/account

Issue:
Internal user cannot edit their information (email, street,...) at
portal without permissions in the accounting

Analyze:
Because the method `can_edit_vat` has a search from the account.move
model, it causes an error

Fix:
Use sudo to avoid error when searching

closes odoo/odoo#138291

X-original-commit: eb9505375483d18cf21fbaf8e5a60398d5c041c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-10-13 11:46:18 +00:00
Alexandre Kühn 631ae1c4d8 [REF] mail: simplify JS discuss models further
- Remove "channel" field in thread formatter.
- Pass `type` for all persona formatters.
- Remove some snake_case to camelCase conversions.
- Add support for inverse fields in discuss JS models.

Details:

1. [REF] mail: remove field 'channel' in thread formatter

This field was used for channel-specific fields, which made
sense when there was a dedicated Channel model that was modeled
with composition with Thread.

To simplify formatter of threads, it's best to flatten props
so that channel-specific fields are immediately available on
thread model. This will improve insertion of data with Threads.

This commit also makes the following other changes:

- remove `discuss.channel/legacy_insert` to use
   `mail.record/insert` instead.

- Introduce `toData()` on record, which is helpful to have record
  in data format e.g. to pass as a JSON.stringifiable object.

2. [REF] mail: slightly simplify Message.insert from notif

The handling of `mail.record/insert` for Message was handling
transition from starred non-empty message to starred empty message.

To simplify all record insert from server formatted data, the notif
data is just inserted in Message. The adjustment of starred counter
is managed at model level.

This is a prerequisite to significantly simplify all
`mail.record/insert` handling.

3. [REF] mail: rename 'res.users.settings' notifications

Before this commit, notifications related to changes of user
settings were using named notification `mail.record/insert`.

This named notification should be only used for Discuss data that
should be inserted in models. `res.users.settings` is not integrated
in Discuss model, thus it has no reason to use this named
notification.

This commit rename the notification name to `res.users.settings` for
these specific notifications. This prepares simplification on
handling any `mail.record/insert` notifications that should simply
call `Record.insert()`

4. [REF] mail: make dedicate notif for Thread/fold_state

This was using named notif "mail.record/insert", which should
be used to immediately insert data in models. This is however
a dedicated notification to imperatively manager chat window
state based on timing of receiving thread data.

This may eventually become a `mail.record/insert` in the future,
but right now it's much simpler to define it as its own named
notification, in preparation to simplify `mail.record/insert`
notifications handling.

5. [REF] mail: remove Channel in mail.record/insert

This is replaced by `Thread`, so that these data can be
immediately inserted in Thread model.

6. [REF] mail: simplify slightly Attachment.update()

Now that data containing commands is supported, we could
just assign with the command rather than destructure and pick
the dict data part.

7. [REF] mail: introduce assignIn() utils

This function helps reduce LOCs from using the "in" conditional
in sequence:
```js
if (a in data) {
	this[a] = data[a];
}
if (b in data) {
	this[b] = data[b];
}
if (c in data) {
	this[c] = data[c];
}
```

To simply:
```js
assignIn(this, data, [a, b, c]);
```

8. [REF] mail: remove snake_case to camelCase conversion in models

They exist for the sake of keeping Python code snake_case and
JS camelCase. While it's good that each language have a community
that prefer syntax convention, when a codebase uses both languages
and they should work with the same data, it's not great to convert
snake_case to camelCase and vice-versa all the time.

Since server has authority over the data, the server chooses the
format for the keys. Most of them are snake_cased, therefore this
is usually the one we pick.

9. [REF] mail: rename Message.messageReactionGroups to Message.reactions

Easier to read, and matches relation name in JS model

10. [REF] mail: remove explicit assign of some many relations in Message

This reduce amount of custom code in insert(), in preparation to make
all models behave the same in response to inserting data.

11. [REF] mail: rename Thread.customName to Thread.channel_custom_name

To match server data field name, and avoid useless conversion in JS.

12. [REF] mail: simplify Message.insert for recipients

Have formatted data contain `type: "partner"` so it can be assigned
in relational field without adding `type: "partner"` manually in JS.

13. [REF] mail: introduce inverse field in discuss models

With this commit, fields in different models can be linked
together, so that one is mirror of the other field.

This simplifies some `onAdd`/`onDelete` that were added to
sync such fields, and this also simplifies insertion in
relational fields for discuss models that are identified
by records, such as the `MessageReactions` that is identified
by the message and the emoji.

14. [REF] mail: rename CannedResponse.name to 'source'

To make JS model and server data more alike.

15. [REF] mail: remove assignDefined in Persona model

So that eventually all model inserts use `Object.assign()`.

16. [REF] mail: remove 'last_message_id' from channel_info

At some point it was used to display last message in messaging menu.
This is already covered by `channel_fetch_preview` when opening the
messaging menu for the 1st time, so passing `last_message_id` in
channel_info is obsolete.

closes odoo/odoo#137750

Related: odoo/enterprise#48484
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-10-13 11:46:13 +00:00
Andrea Geraldo 200b77b216 [IMP] website_sale: _onChangeCountry improvements
Changed _onChangeCountry and _changeCountry from
website_sale.js to make them inheritable by
returning the value of the promise instead of
returning nothing.

closes odoo/odoo#137480

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-10-13 11:46:12 +00:00
pash-odoo 13de773edd [FIX] hr_holidays: hide employee information in My Time menu
Before this commit, In time off if we got to dashboard and open list view then
information related to employee is missing.

In this commit,
  we have added invisible employee, department, time-off type
in my time menu of the list view

task-3482508

closes odoo/odoo#134453

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 11:46:11 +00:00
Julien Van Roy 6334b04fb2 [FIX] account_edi_ubl_cii: fix peppol fields test fail when DK installed
When l10n_dk is installed, the tests on the peppol fields (EAS/Endpoint)
fail. This is due to the `_compute_company_registry` being overriden,
which will assign the VAT number as the company_registry.

To fix this, we simply use another country that currently hasn't any
loca module in Odoo (so we ensure the VAT/company_registry will not be
affected in any unexpected way).

Linked to runbot error 25700.

closes odoo/odoo#138588

X-original-commit: 64559fe8df9f32bd41b7e79ca501b9d1363378c5
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Julien Van Roy (juvr) <juvr@odoo.com>
2023-10-13 10:36:08 +00:00
pash-odoo af51d1ab19 [FIX] hr_holidays: fixed Uom display issue
Before this commit, there was a huge gap between Uom and duration in time off
wizard.
In this commit, moved the Uom closer to duration.

task-3482508

closes odoo/odoo#138571

X-original-commit: 56b9243bc583b5f9b681b7c34355b505d892e313
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-10-13 10:36:07 +00:00
oco-odoo cdca92ded6 [FIX] l10n_ch: allow generating SEPA QR-code for Swiss customers
This commit https://github.com/odoo/odoo/commit/a9980477048e4adffda4a71a72ff1cc8490637f9 wrongly impeached to generate a SEPA QR-code on the invoice when l10n_ch was installed and the company and customer were in Switzerland. This was too restrictive, and broke the previous behavior, which allowed manually enabling the SEPA QR invoice by invoice if necessary. We restore the old behavior with this commit.

OPW 3516380

closes odoo/odoo#138395

X-original-commit: d5fe06d75369716925ff65cf3f34928e890fc932
Signed-off-by: Cedric Snauwaert <csn@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-10-13 09:17:48 +00:00
Michael (mcm) e062e6f483 [IMP] web,*: remove legacy env
This commit removes all the legacy envs (common_env, env, public_env)
as well as the files used to set up them.

task 3439226

closes odoo/odoo#138348

Related: odoo/enterprise#48781
Signed-off-by: Mathieu Duckerts-Antoine (dam) <dam@odoo.com>
2023-10-13 09:17:45 +00:00
Michael (mcm) 94824d8767 [IMP] *: remove legacy notification service mapper
This commit removes the mapper to the notification service and adapts
widgets that display notifications.

task 3439226

Part-of: odoo/odoo#138348
2023-10-13 09:17:45 +00:00
guva-odoo bf6673c375 [FIX] base: address_format for Thailand
State code is shown instead of state name
in company details for Thailand companies.

opw-3493307

closes odoo/odoo#138576

X-original-commit: 6a47980364e4ceeb5a77b4f7e2f2a9475872275e
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
2023-10-13 07:33:57 +00:00