Commit Graph
164961 Commits
Author SHA1 Message Date
Julien Castiaux 34ecb45e5c [REV] web: return updated list of fields in export template
This reverts commit 46016e33ea from
pull-request #129567, see #134791

closes odoo/odoo#134957

Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-09-10 11:33:02 +00:00
David Monjoie 524dc07d8e [FIX] web_editor: fix url regex on Safari iOS
Commit [1] introduced a stronger regex to detect urls. Unfortunately,
it did so using a negative lookbehind, which is is only supported on
very recent version of Safari iOS.

This commit is an attempt at reproducing the same behavior, albeit
with a more complicated regex, unfortunately.

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

closes odoo/odoo#134943

X-original-commit: ff99e454e2a38ae54aa57cb0df80df139e921ccb
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-09-08 21:39:39 +00:00
Adrien Widart (awt)andSimon Schmid 8673382784 [FIX] stock: get product qty based on location and warehouse
When getting the available quantity of a product, it is possible to
specify the warehouse and/or the location in the context. However,
it does not correctly work. For instance, if we provide the stock
location ID (8) and the warehouse ID (1): we first use the view
location of the warehouse, and we then get the intersection between
this view location and the provided locations: nothing. In such case,
we should keep the stock location. Few other examples are given in
the test.

OPW-3450169

closes odoo/odoo#134910

X-original-commit: 8b53464dc51fb14cb37801a1d978185729c8e339
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Co-authored-by: Simon Schmid <simon.schmid@braintec.com>
2023-09-08 17:53:35 +00:00
Walid 56a4f4beb2 [FIX] purchase_mrp: split cost in bom line
Steps to reproduce:
- Create Storable Product "Super Test" with Cost of $1.
- Create Storable Product "Pack of Super Test" with Cost of $10.
- Create a Kit BoM that produces 1 "Pack of Super Test" from 10 "Super Test".
- Ensure product category on both products is set to Automated FIFO Inventory Valuation.
- Create a PO for 20 "Pack of Super Test" and confirm.
- Process the Delivery and look at inventory valuation.
- See that "Super Test" has moved quantity at 200 with Unit Value of 10 each (taken from kit product!).

Bug:
cost isn't split on the qty of the bom line

Fix:
take product quantities of the bom into consideration

opw-3453703

closes odoo/odoo#134909

X-original-commit: 8e516dccac4ced7e48adfabe756a899784bac9ca
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-09-08 16:48:07 +00:00
Robin Lejeune (role) 8080009fe4 [FIX] website: separate website menu cache for logged in/out users
The website menu is cached for each page, but there is no difference
between the cache of a logged user or of a public user. If you have a
page restricted to logged in users in the menu, this can sometimes lead
to:
(1) the link appearing in the menu even though the visitor is logged out
(because the cache was done when logged in), and
(2) the link not appearing even though the visitor is connected (because
the cache was done when logged out).

While (1) only leads to a 403 error if one clicks on the menu link, (2)
is more annoying as it hides a page that should be shown.

This commit therefore also caches the website menu depending on the
visitor being logged in or not.

Note that the same bug occurs for pages restricted to a specific group.
In these cases however, there is no technical solution as of now. It
should be considered as a limitation.
In such cases, workarounds are possible:
- Going on the "My account" page (by clicking on the username) will
always show the page.
- One could add a snippet on the homepage with a link to the restricted
page, and conditionally display the snippet only for users of that group

Steps to reproduce the bug:
1) Connect as admin, create a new page, open its properties and set its
visibility to 'Signed in', then publish it.
2) Logout, connect as portal
3) Logout, connect as admin
4) Unpublish and republish the page
5) Logout, reconnect as portal
6) Go to the homepage: the new page doesn't appear in the menu
7) Go to 'Contact us': the page reappears in the menu

opw-3445032

closes odoo/odoo#134908

X-original-commit: cfd19012f3a44b4961fe953cf077c55cc986d45c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-08 16:48:06 +00:00
Adrien Widart (awt) 02347e4620 [FIX] stock: check SN uniqueness by location
To reproduce the issue:
1. In Settings, enable:
   - Storage Locations
   - Package
2. Create a product P
   - Type: Storable
   - Tracked by SN
3. Process a receipt with 1 x P, serial S
4. Return P in a package
5. Process a new receipt with 1 x P, still S as SN

Error: An error is displayed "The serial number has already been
assigned [...]". This is incorrect, the user should be able to
receive that SN.

After step 3, there exists a quant Q1: -1 x P at Supplier Location
with S. Then, after step 4, a new quant Q2 is created: 1 x P at
Supplier Location with S and the package. Because the field
`package_id` is not the same on Q1 and Q2, both quants are not merged.

As a result, step 5, we will update Q1 and have -2 x P at Supplier
Location with S. This will trigger the constraint, hence the error
message.

OPW-3390615

closes odoo/odoo#134902

X-original-commit: 0459e42ac452996831b0443bce088b84735975f0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-09-08 16:48:05 +00:00
xO-Tx a907a220fc [FIX] website: fix mega menu option classes
Steps to reproduce:

- Go to website > Create a mega menu.
- Go to edit mode > Switch to narrow width for the mega menu.
- After save, the update is lost.

After the refactoring in [1], non-returned class values (in the code
that replaces `_.without()` by native JS) will prevent setting the
option class on the mega menu, leading to the behaviour described above.

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

opw-3465004

closes odoo/odoo#134901

X-original-commit: 293fce5cc5407705a4314c85fd780cff435202bc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-09-08 16:48:04 +00:00
Richard deMeester 0cae6b06be [FIX] stock: change UOM on product block - multi company
There is code to block the UOM changing if there are done moves.

Because it searches in non-sudo mode, it does NOT currently
stop you changing the UOM if the product has moves in a different
company.

closes odoo/odoo#134900

X-original-commit: 426744646c25e8c2b17e3a50de186bd91b5e645f
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-09-08 16:48:03 +00:00
clesgow f8c1927b5b [FIX] mrp: compute the right producible qty with same components
Steps to reproduce:
- In Manufacturing, create a the following BoM
  - Product: P1
  - Components:
    - 2 x P2
    - 2 x P2
- Set the quantity in stock for P2 to 2
- Open the Overview from the BoM

Issue:
The 'Ready to Produce' column will indicate 1, as it checks line by line
how much product there is in stock compared to what is required for this
line.
To avoid this, we just need to sum the quantities required by products.

closes odoo/odoo#134890

X-original-commit: b8fda0bdb2238cba21a4541f4292da04003704cf
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-09-08 16:48:02 +00:00
Benjamin Hanquin (beha) 9b42ab531d [PERF] spreadsheet_account: optimize fetch_debit_credit SQL query
Issue:
Displaying the data on the dashboard accounting can take up to 1 minute

Analysis:
The spreadsheet_fetch_debit_credit function needs a domain in order to compute the formulas. The domain being set in `_build_spreadsheet_formula_domain` use a like search for account_account.code on account_move_line which is a big table. Thus it does not scale well. There is also a unnecessary complexity on adding an "OR expression" on each one of the account_id code searched for.

Solution:
It can be optimized by searching for the full exhaustive (like in SQL) codes in account.accoun since it has way less records and thus more scalable. And then use an exact condition (=) which is faster than a like search. Also adding more readable while adding the balance_domain and pnl domain only once in the whole query.

Benchmark:

| Before PR | After PR |
|:----------:|:---------:|
| 8s 51 ms | 42 ms code search + 42 ms full query |

Related ticket:
opw-3328144

Version affected:
16.0 and above

closes odoo/odoo#134889

X-original-commit: a707f8345cec8f404077b184f4b0339932c10892
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-09-08 16:48:01 +00:00
Géry Debongnie e0fdb6a0b4 [IMP] *: rewrite module loader
This commit rewrite the module loader to simplify it and to improve error handling.
before this commit, you could have silent errors or "lucky" imports (import a module based on the fact that his asset will surely be load and if not, the error would be silent anyway).
e.g.: The tours cannot import modules extern to tours' bundle anymore. Or load module before your libs in assets.

TASK ID: 3266021

closes odoo/odoo#128502

Related: odoo/enterprise#44100
Signed-off-by: Bastien Pierre (ipb) <ipb@odoo.com>
2023-09-08 16:47:56 +00:00
Walid 1d33b7a9b8 [FIX] stock: SN sequence
Steps to reproduce:
- Create a serial tracked product
- Update quantity add random SN
- Edit "ir.sequence" for serial numbers
(search sequence with dev mode enabled)
- Add a prefix for exemple "xx%(doy)sxx"
- Manufacture the product and generate new serial

Bug:
if a serial already exist next number in the sequence will be generated
instead of using the sequence

Fix:
apply same logic than for lots i.e. first generate from sequence then
take next number if it already exists

opw-3291532

closes odoo/odoo#134879

X-original-commit: df96d9ca10c576981f6af79e330b5b46cdeea377
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-09-08 15:26:11 +00:00
Pedram (PEBR) 5e81b3e3d2 [FIX] pos_loyalty: handle many2one field in reward product domain
Before this commit, if you added a domain to a loyalty reward with
one of many2one fields like [("categ_id", "ilike", "test")], it wasn't
possible to open the PoS.

This commit addresses this limitation by replacing the many2one fields
with their corresponding value. To do this the product's field type is
loaded to ensure that this improvement applies exclusively to many2one
fields.

However, it's important to note that this improvement currently handles
only "one-level" of related many2one fields. Any domain that appears
like ("categ_id.foo", "ilike", "foo-val") won't function as expected.

opw-3473103

closes odoo/odoo#134811

X-original-commit: d0a6ab8d1f89f0dd2aa6641c63b6973ae7c753ad
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-09-08 15:26:10 +00:00
tong-odooandYannick Tivisse ac8b080234 [FIX] hr_work_entry_contract: work entry timezone issue for attendance
Steps to reproduce:

- Install Attendances app and Employee app
- Setup an employee with a contract which work entry source is from
attendance
- Change the working schedule to different timezone, for example
Asia/Hong_Kong
- By default the working schedule should be start to work from 0800 to 1700
- Now create an attendance in the first day of the contract, i.e.
1st May 2023, check in time 0700, check out time 2000
- The total work hours should be 13
- However, in the work entry, the genearted work entry is 0800-2000, only
12 work hours.

Current behaviour:
The generated work entry mismatches the value of the attendance

Expected behaviour:
The work entry should match the attendance

Explanation:
This issue is casued by the timezone issue. When the system generate
the work entry, it will calculate the date_from datetime and date_to datetime.
Then it will compare between the attendance and the date_from datetime to choose
the larger datetime to put inside the work entry as start time.

However, the date_from datetime didn't consider the timezone of the working schedule.
In the above example, Asia/Hong Kong time is UTC+8 time. Therefore if we convert
the attendance time back to UTC time. It is check in time 30 April 2023, 2300 to
check out time 1 May 2023, 1200. In the mean time, if we compare between the date_from
datetime (1 May 2023, 0000) and the attendance check in time (30 April 2023, 2300).
The system will take the date_from time and therefore the generated work entry time
is incorrect.

task-3468012

closes odoo/odoo#134533

X-original-commit: 2baf4e3ebcd9ce3beb47ee2881aa3e8bd8a74cbf
Related: odoo/enterprise#47007
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Yannick Tivisse <yti@odoo.com>
2023-09-08 15:26:08 +00:00
niyasraphyandNiyas Raphy <https://github.com/niyasraphy> 37cc5266f9 [FIX] web: missing required attribute for html field
To reproduce
============

* referrals -> configuration -> rewards
* try creating a new reward keeping description empty
* here description is required html field
* traceback on clicking save

Problem
=======
in case of html field, `this.data[fieldName]` is an object `Markup{''}`,
so `!this.data[fieldName]` is always `false` as objects are considered
as true value in JS.

Solution
========
in case of html, check the length of the Markup object

opw-3469539

closes odoo/odoo#134365

X-original-commit: dce8e1a8b6137c035488240f8004b870b73c8d51
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Abdelouahab Laaroussi (abla) <abla@odoo.com>
Co-authored-by: Niyas Raphy <https://github.com/niyasraphy>
2023-09-08 15:26:05 +00:00
Nasreddin Boulif (bon) 707f6cb92e [FIX] website_slides: adjust member completion percentage
Steps to reproduce:

  - Install eLearning module
  - Create a course with 2 slides and publish them
  - Add a user as a member of the course
  - Complete the first slide
  - Add a new slide to the course and publish it
  - Go to course and click on `Attendees` stat button

Issue:

  The member completion percentage is not updated.

Cause:

  When (un)publishing a slide, only the current user that publish the
  course have his completion percentage updated.

Solution:

  When (un)publishing, (un)archiving, unlinking or creating slide(s)
  (slide must be published for the creation case), or when user mark
  slide as (un)completed manually, update the completion percentage of
  all members of the course except the members that already have
  completed the course.

  From version saas-16.3 we do not need the custom context key we
  introduced in 94e2dd2 because we will not update the completion
  percentage of members that have completed the course even if they
  manually mark a slide as uncompleted.

opw-3225707

closes odoo/odoo#134845

X-original-commit: 2796b3163c02306f1309e2dde764fff2f1b287cc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2023-09-08 13:45:43 +00:00
Pierre Paridans 915454bfaa [FIX] web: DateTimePicker focus when programmatically changing month
When passing a date out of the current as a props to the DateTimePicker
component, the chosen date is actually set but the calendar doesn't
rerender to display the corresponding month.

This commit fixes this behavior to properly focus the date's month.

closes odoo/odoo#134844

X-original-commit: 9dbb35479615f5aef7b22f21bf9f58f176874886
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-09-08 13:45:42 +00:00
Alexandre Kühn 640a11a56e [FIX] mail: jump to pinned message from notification
Before this commit, when pinning an old message from thread,
then page reload then click on pinned message link in
notification message in thread at time of pinning message,
it fails to jump to the pinned message.

This happens because the message is not in the store, therefore
it attempts to jump to message `undefined`, which doesn't exist.

This commit fixes the issue by inserting the message before
attempting the highlighting that will jump to the message.

closes odoo/odoo#134818

X-original-commit: 70769963d240add98ed2ee231412201434a825ba
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 13:45:41 +00:00
althaf shaik 29097e10d8 [FIX] account: restrict to create payment without payment date
This traceback raises when user tries to create payment without payment date.

To reproduce this issue:

1) Install 'account'
2) Open any existing invoice (not a DRAFT one)
3) Click 'REGISTER PAYMENT' button.
4) Now remove 'Payment Date'

Error: 'Expected singleton: account.payment.term()'

Note:- 'TypeError: unsupported operand type(s) for +=: 'float' and 'NoneType''
is also produced for some invoices.

When user removes 'payment_date' '_compute_amount' method will be called, In which
'_get_total_amount_in_wizard_currency_to_full_reconcile' method is used.

In '_get_total_amount_in_wizard_currency_to_full_reconcile' method,
'_get_total_amount_using_same_currency' is used to get total amount.

On '_get_total_amount_using_same_currency' method payment_date is passed as an
argument for '_is_eligible_for_early_payment_discount' method.

See: https://github.com/odoo/odoo/blob/ed2e26633458f1284437286f71eba43c8d1818a7/addons/account/wizard/account_payment_register.py#L490-L498

On '_is_eligible_for_early_payment_discount' method if no reference date,
its returning True. which leads to above traceback
See:
https://github.com/odoo/odoo/blob/ed2e26633458f1284437286f71eba43c8d1818a7/addons/account/models/account_move.py#L1902-L1905

sentry-4337953422

closes odoo/odoo#134721

X-original-commit: a05be50b9cf75fb0226f7b464b3a8f580465d462
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-09-08 13:45:34 +00:00
tsm-odoo 278f9081f2 [IMP] im_livechat: add message features for livechat
This commit adds the discuss message features to the livechat
threads:
- Edition/deletion of messages
- Reactions
- Replies

It also improves the history view present in the channel form view
by showing replies.

task-2742676

closes odoo/odoo#133456

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 13:45:33 +00:00
moerradi 6dba17d461 [FIX] account: Client Traceback on Payment Terms
Removed the `ListRenderer` overload in `payment_term_line_ids.js` to fix
an issue where trying to set `this.props.list.editedRecord` to null was
causing a stack trace error when navigating away from a Payment Term
lines.

The original intention was to prevent the discard of new records when
clicking outside of the list, especially when the user is not required
to edit something on the newly created record.

It has been replaced by an overload `X2ManyField` component making the
`AddInLine` method mark all the new records as `dirty` by calling the
`update` mehod on them with an empty object to prevent them from being
discarded.

closes odoo/odoo#132257

Task-id: 3460696
Signed-off-by: Habib Ayob (ayh) <ayh@odoo.com>
2023-09-08 13:45:32 +00:00
Bruno Boi 75194ab19b [FIX] test_base_automation: fix a failing tour
This commit fixes an undeterministically failing tour.
`test_form_view_resequence_actions`

*Reason*
This test tour prepares some data before running the test.
The data preparation missed to specify the sequence of the actions.

*Fix*
The sequence is now set in the data preparation.
This reflects the way the form view would create the
actions if they were created through user input.

See the `canResequence` part in `_createNewRecordDatapoint`
inside `@web/model/relational_model/static_list`

Fixes runbot error 24578

closes odoo/odoo#134802

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-09-08 12:24:56 +00:00
niyasraphy 5fd345ea83 [IMP] payment_{}: remove create from payment provider form
before this commit, the create/new button is shown in
the payment provider form, where us it is removed in
the kanban and tree

after this commit, the create/new button will be removed
from the form and users can use duplicate option to create
new provider

closes odoo/odoo#134779

Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
2023-09-08 12:24:51 +00:00
tsm-odoo 0a9f46d992 [FIX] mail, im_livechat: fix website livechat chatbot flow tour
This commit fixes the "website_livechat_chatbot_flow_tour" which was
nondeterministic. This was due to the message service update which was
assigning data blindly based on the payload instead of handling it
properly. This is solved by enriching the chatbot step instead of
overwriting it.

runbot-24625

closes odoo/odoo#134778

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 12:24:50 +00:00
Bruno Boi d401f368c2 [FIX] test_base_automation: fix failing tour
This commit fixes a tour that is failing undeterministically.

- Before
  The tour was saving a form dialog just before saving the main form.
  Sometimes, these two steps were too fast, leading for the second one
  not performing the main form save action.

- After
  The second step now awaits that the modal is closed before running.
  This element is the kanban record saved by the form dialog.

Fixes runbot error 24576

closes odoo/odoo#134776

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-09-08 12:24:49 +00:00
Prakash Prajapati 4a3bf1f847 [FIX] sale_product_configurator: fix alignment value and radio button
Issue:
   Currently there is no alignment between radio button and value,
   we fix this commit.

Fix:
   We move the input box inside the label.
step:
    - Install sale app
    - Create product(test) and add Attributes & Variants
    - Select Brand  (Display Type: radio) Attributes and add value
    - Create sale order and add product(test)
    - Check Configure

closes odoo/odoo#134734

X-original-commit: 9e32999d3eea96da6d0ab39642e3f2d612a8690a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-08 12:24:48 +00:00
Zelong Lin adc5448adf [IMP] mail: single unified Picker (Gif & Emoji)
Before this commit, emoji and gif pickers were handled as 2 different
pickers. They had dedicated buttons. This made composer quite
bloated, especially in chat windows were size is narrow.
Also the pickers were always displayed as popover, which is not the
best way to show content in mobile.

This commit improves those pickers in discuss so that only a single
button is present (emoji button). Clicking on this button shows a
picker that groups the emoji and gif picker, both of which can be
selected in the header of the grouped picker.

In mobile, instead of showing a popover, it now shows the grouped
picker below the composer. This makes it show where the soft keyboard
is present in mobile, making it easier to input emojis or gifs on
those devices.

This commit also added slight style changes to both pickers. Notably,
the search bar has an improved style that makes it look good when
next to the composer text input, especially in mobile layout.

task-3015707

closes odoo/odoo#123671

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 12:24:45 +00:00
lejeune quentin 6765084b42 [FIX] point_of_sale: Remove timesyncd service from iot
With the new version of raspios the timesyncd service is not
correctly stopped during a shutdown or a reboot.
Here 'timedatectl set-ntp true' enables and starts
the first existing network synchronization service

closes odoo/odoo#134797

X-original-commit: b0669ec60095ae4d28276fbef0ae9e1e0197626f
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2023-09-08 11:12:42 +00:00
Antoine Boonen 5e2e842d7e [IMP] product: Keep expense and income accounts empty at product creation.
Problem
---------
Before 16.2, the fields were empty, which meant that the expense and
income accounts of the chosen category could be used.
Since 16.2, when a product is created, the expense and income accounts
are automatically pre-filled.

Objective
---------
This task aims at retrieving the old behavior to allow using category 
accounts.

Solution
---------
Remove the `property_account_expense_id` &
`property_account_income_id keys` in `_get_xx_template_data` in all
localization packages that define them.

task-3438931

closes odoo/odoo#134796

X-original-commit: dae46c926d5e63683968107f06bf2bfb8e07d267
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Antoine Boonen (aboo) <aboo@odoo.com>
2023-09-08 11:12:41 +00:00
Michael (mcm) 36061a4ab0 [IMP] web: simplify owl_compatibility
This commit tried to remove owl_compatibility completely but its last
uses are either in refactoring or a bit complex to migrate. Instead of
removing the helpers completely, this commit simplifies them a lot and
makes them more readable and safe.

closes odoo/odoo#134295

Task: 3439226
Related: odoo/enterprise#46899
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-09-08 11:12:39 +00:00
Michael (mcm) 290a9b9055 [IMP] web_editor,*: use dialog service
*: mass_mailing,website,website_sale

Before this commit, the ComponentWrapper was used to mount some
components which then render a dialog. This commit replaces these cases
by using the dialog service.

Task: 3439226
Part-of: odoo/odoo#134295
2023-09-08 11:12:39 +00:00
Michael (mcm) 2da24f6f58 [IMP] web: remove useListener hook
This hook was deprecated for a while and it is time to remove it.

Task: 3439226
Part-of: odoo/odoo#134295
2023-09-08 11:12:39 +00:00
Louis Wicket (wil) 99af68bd2d [I18N] payment_stripe: reexport translations
Some strings are missing in the pot file and are therefore not
translated. This commit updates the pot file to the latest changes.

closes odoo/odoo#134039

X-original-commit: 22045d368a7beb72dc5330054dfa201c3c047e6f
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
2023-09-08 11:12:38 +00:00
Damien Bouvy 4eb3b4ba87 [IMP] base: mass_editable users list view
Rationale:
- allow mass changing languages (in case you want to remove one lang)
- allow quick company re-assign

Other fields are marked as readonly to avoid messes.

Task-3494874

closes odoo/odoo#134786

Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-09-08 09:47:10 +00:00
Alexandre Kühn 27919caad7 [FIX] mail: auto-close attachment box when no attachments
Before this commit, when opening a record with some attachments
and attachment box is open, switching to a record without any
attachment shows the attachment box open.

This is a problem because the attachment box is designed to only
be open when there are some attachments. The toggler for showing
attachment box is instead an "upload file" button when the record
has no attachment. This means that the open attachment box in those
records without any attachment cannot be toggled off.

This commit fixes the issue by automatically closing attachment box
when the record has no attachments.

Task-3493374

closes odoo/odoo#134771

X-original-commit: ab678ea7618ca1aee5a6ab31b2de59c87fcce32c
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 09:47:09 +00:00
Arthur Detroux (ard) d8d71c5ce6 [FIX] website: fix traceback when refreshing with f5 or ctrl+r
[1] removed the `router.redirect` method but [2] which was forward
ported after from 16.0 used the redirect method where it still existed.

This causes a traceback when using f5 or ctrl+r.

This commit fixes that by using the proper method in 16.2+

[1]: https://github.com/odoo/odoo/commit/365fe390fdc814bc079419f0bd940b8edd652618
[2]: https://github.com/odoo/odoo/commit/45affc3a94f33478063d2e82be5e0c51df92fb5f

task-3458691

closes odoo/odoo#134764

X-original-commit: dec96bca556b8df23fb692587cb64b47a6a3206b
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-09-08 09:47:08 +00:00
Richard deMeester 49f6fc10e9 [MOV] l10n_au: move BSB bank support
BSB definition is now moved from enterprise (l10n_au_aba) to l10n_au.

BSB is not limited to ABA bank interactions.

As such, it is useful to define this and allow validation in
l10n, making it available to users who are not using ABA files.

closes odoo/odoo#134321

Related: odoo/upgrade#5111
Related: odoo/enterprise#46914
Signed-off-by: William André (wan) <wan@odoo.com>
2023-09-08 09:47:07 +00:00
oco-odoo 250ef32785 [FIX] account: allow the creation of a new account.report from the UI again
Hitting the "new" button in the tree view (in enterprise) was crashing because of the changes introduced on the display name computation. It is now also computed on 'new' records, when no field is set at all: this caused this function to try concatenating None with an empty string.

closes odoo/odoo#134172

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-09-08 09:47:04 +00:00
Louis (loco) 0d608e80b9 [FIX] web_editor: optimize the width and format of shaped image
Steps to reproduce the bug:
- Drop a "Text-Image" on the website.
- Add a shape on the image.
- Replace the image.

Problem: The image version selected by default is the original one
instead of webp.

Because the mimetype of an image with a shape is `image/svg+xml`, a
condition has to be added in order to convert its format and its width
at the `_autoOptimizeImage()` call.

task-3449866

closes odoo/odoo#133517

Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-09-08 09:47:03 +00:00
tsm-odoo 6dd2496f8d [IMP] im_livechat: do not rely on chat history anymore
Before this commit, the livechat was still using a dedicated
route to fetch messages on page load. Since [1], visitors are
actually mail guest so they can access the classic mail route
in order to do so. This commit adapt the livechat code to use
this route instead of the custom one.

At the same time, this commit simplify the livechat service.

part of task-3332628

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

closes odoo/odoo#133430

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-09-08 09:47:02 +00:00
Manushi Shah (mash) cd2e6ea534 [FIX] sale_product_matrix: remove unnecessary matrix rows
Prior to this commit:
When generating a sale order/purchase order report, all rows, including those
with entirely null values included in the report i.e. the entire matrix is
displayed.

Post this commit:
The sale order/purchase order report is generated with only the rows with at
least one quantity is added, rather than including the entire matrix.

closes odoo/odoo#132045

Task: 2860388
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-09-08 09:47:01 +00:00
tong-odoo 39401c7928 [IMP] base: add hong kong region
See odoo/enterprise#45741

closes odoo/odoo#131851

Related: odoo/upgrade#5043
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-09-08 09:47:00 +00:00
Odoo's Mergebot a9f7e17f5d [IMP] base, web: allow to group by properties
Purpose
=======
Allow to group records by their property values,
like we can do with normal fields.

Technical
=========
Because there's no foreign key, when we group by a relational property
we need to check the existence of the ids in the query (and same for
selection and tags, because we might have value of a deleted
option / tag in database).

Task-3032464

closes odoo/odoo#103510

Related: odoo/enterprise#38778
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-09-08 09:46:56 +00:00
std-odoo faf5fa1022 [IMP] web: add tests related to the "group by y properties" feature
Purpose
=======
Add tests about the group by properties feature, the drag and drop
and the behavior in the pivot view.

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
std-odoo 2943106d87 [IMP] project, crm: group by properties
Purpose
=======
Allow to group records per properties.

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
std-odoo 15353f06d7 [IMP] base, web: allow to group by properties
Purpose
=======
Allow to group records by their property values,
like we can do with normal fields.

Technical
=========
Because there's no foreign key, when we group by a relational property
we need to check the existence of the ids in the query (and same for
selection and tags, because we might have value of a deleted
option / tag in database).

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
std-odoo 88f4c4dd36 [IMP] base: properties, do not allow to select transient models
Purpose
=======
Do not allow to select transient models in relational properties.

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
std-odoo 6c566c2814 [IMP] base: properties, better name verification
Purpose
=======
Currently, it is possible to use some bad characters in a property name
by writing directly on the parent (not via the child).

It's possible only with RPC call and it wasn't an issue because we
recheck the name anyway before using it in SQL query (but it should be
cleaned).

We also restrict the maximum length (there's nor reason to use
huge property names).

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
std-odoo 6412575f4b [IMP] base: allow to use default_ context key for properties
Purpose
=======
Allow to use `default_properties.xxxxx` as a context key, to set the
default value on a property. We need that because when we group by
a property in a Kanban view, we can create new record in a given
column, and this process will set this context key.

Task-3032464

Part-of: odoo/odoo#103510
2023-09-08 09:46:56 +00:00
Nshimiyimana Séna 17039d8f4f [FIX] account: include 'quantity' in '_compute_all_tax' dependencies
Summary
-------
This commit addresses an issue where fixed taxes were not calculated
correctly when applied to a line with a price of 0.

Steps to reproduce
------------------
1. Create a fixed tax with an amount of 5.
2. Create an invoice with a line having zero price and apply the fixed
   tax.
3. Save the invoice. You should have a total of 5.
4. Change the quantity of the invoice line, to something like 2.
5. Save the invoice.

We expect the total to be 10, but we get 5.

opw-3212536

closes odoo/odoo#134762

X-original-commit: 2aafff6a36bd40719de9447a7ab9bf05274ff5d2
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-09-08 08:30:04 +00:00