Commit Graph
169210 Commits
Author SHA1 Message Date
Eteil Djoumatchoua(etdj) etdj@odoo.com a3befcc5a9 [FIX] mail: set body on mail.message on event registration confirmation
Steps:
- Go to any event with tickets and using the ticket confirmation
template, sending 'after new confirmation'.
- Confirm a new attendee.
- An email is sent but the chatter only shows the attachment and the
subject, with no body.

Issue:
Chatter should show full content of the email.

Reason:
Above 16.2+ the 'body' is not implicitely set when genrating the
template in ``mail_template.send_mail()``. As discussed with RETH, when
requesting the 'body_html' for a template, setting the 'body' solves the
problem.

opw-3562438

closes odoo/odoo#151930

X-original-commit: 0a3d4b10a7c81d05d9bf6864b0b9a2f48f09b2a0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-31 17:13:57 +00:00
Demesmaeker 844b512077 [FIX] website_sale: hide header from user that shouldn't see an alert
closes odoo/odoo#151912

X-original-commit: 1999beb5cc364927fd8ae6a5c15509a62c5af257
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2024-01-31 17:13:56 +00:00
Deependra Solanki b4a7e5333f [FIX] web_editor: fix rollback on pasting using ctrl+shift+v
Before this commit:

When pasting using CTRL+SHIFT+V, if the textFragment includes linebreak(\n),
each textFragment is divided, and each seperated fragment is inserted using
`insert` command, followed by `oEnter` command. However, when `oEnter` is
UNBREAKABLE, the inserted text is ROLLBACKED.

After this commit:

We now check whether the anchorNode's closestBlock is UNBREAKABLE. If so use
`oShiftEnter` command; otherwise, use `oEnter` command which avoids ROLLBACK.

task-3563785

closes odoo/odoo#151911

X-original-commit: f1e35ca82cf72ffb21c586d9bf1714bb388fe257
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-31 17:13:55 +00:00
Leonardo Pavan Rocha 8ae764a97b [FIX] calendar: fixes traceback when end is not set
In calendar if you delete the end_date, switch to all_day event and set both
start_date and stop_date and try to create the event, it will raise an error
because `end` is not set. This is due to 'end' being a required field and the
end_date not setting the end value. This commit adds an onchange to properly
set the start and stop values from the start_date and stop_date.

task-3682608

closes odoo/odoo#151910

X-original-commit: ff431fc02df59b731ea2a8a7051c1e1d42581637
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2024-01-31 17:13:54 +00:00
Bruno Zanotti ba2012826f [IMP] stock: allow to filter orderpoint locations
This commit allow to inherit the method _get_orderpoint_locations to
filter in which location compute orderpoints imrpoving performance and
usability

closes odoo/odoo#151909

X-original-commit: 2f245b40e8cecf87cb3334a80b24a54cd6e99d12
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 17:13:53 +00:00
FrancoisGe 9891156c3b [FIX] web: CP keep the correct searchValue
Before this commit, in the command palette, during a search, it is possible
that the value entered is modified. The problem only occurs if the namespace
has a debounceDelay bigger than 0 and at least one of its command providers is async.

How to reproduce:
=================
- Go to the command palette with the @ namespace.
- Type a few characters
- Re-enter a few characters
If you repeat this operation several times, some characters may disappear.

Why:
====
The value of the input is modified at each "input" event, but the searchValue
in the state is only modified when the debounce trigger "search".
Since the command palette template is contained in a slot, each state
change causes a complete rendering of the command palette. When the search is executed,
the commands are added to the state after each provider has generated them,
so a rendering takes place and it is the value contained in state.searchValue
that is used for the input and not the value contained in it before the rendering.

Solution:
=========
No longer modify state.searchValue during the search, but at each input event.

closes odoo/odoo#151906

X-original-commit: f4e1350e3a03c8a3a2b6bab8f4f74e278b1d2905
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-31 17:13:52 +00:00
Raja Prasad b7c68826d9 [FIX] project: fix alignment of heading in profitability section in mobile view
Steps to reproduce:

- first install bridge module 'project_account_budget'
- open any project and go to project updates
- in right side panel you see 'Profitability' button
- click the profitability and switch to mobile view

Issues:

- heading of table are not vertically centered

Solution:

- Add style to vertically align center of heading

closes odoo/odoo#151839

Task: 3633405
X-original-commit: 249f8700b9c982c765d712cd27e93bbd7bedfe3e
Related: odoo/enterprise#55460
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-31 13:47:17 +00:00
Jeremy Kersten 433589d744 [FIX] website_[membership,partner,customer]: redirect to real slug
+ website_crm_partner_assign that overrides website_partner

Implement partner slug validation for accurate URL redirection

Prior to this commit, partner slugs weren't verified, leading to Google
indexing outdated partner URLs even after renaming. With this change,
when the virtual slug (fake slug sinc no read access on res.partner)
differs from the actual one, redirection to the correct URL is enforced.

closes odoo/odoo#151824

X-original-commit: a28a9c3a5e635f45e0bfee402b7f0775735adeb7
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2024-01-31 13:47:17 +00:00
Robin Lejeune (role) b5fd2820bb [FIX] web_editor: fix CTA button class
When a button is updated, its `btn` classes are stripped by the editor.
However, in so doing the regex replaces `btn_cta` by `_cta`. This commit
fixes it.

Related to opw-3644220

closes odoo/odoo#151803

X-original-commit: 61735c84445606b97fdf95f35b6e3dd1384b7ea5
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Robin Lejeune (role) <role@odoo.com>
2024-01-31 13:47:15 +00:00
Andrea Grazioso (agr-odoo) 521ffebe5a [FIX] mrp: Manufacturing Forecast access from template
Have a product template with bom
Ensure the product variant has not the same id of the template
(Add and remove a template variant)
In the product page > Hit "forecasted" smart button > "Manufacturing Forecast"

Error will raise:
Missing record
Record does not exist or has been deleted.

This occurs because when opening the Manufacturing Forecast from the
template product we are searching the variant using the id of the
template product

opw-3636661

closes odoo/odoo#151776

X-original-commit: df7b80f24bc6ef20d3aea25e9597807f5a6a0195
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Andrea Grazioso (agr) <agr@odoo.com>
2024-01-31 13:47:14 +00:00
Julien Alardot (jual) 556ab11594 [FIX] hr_expense: Fix product cost digits
Fixes an error where a product cost rounding change
(e.g. from default 2 to 3) would not be reflected
expense product and expense price_unit

task-3679204

closes odoo/odoo#151775

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2024-01-31 13:47:13 +00:00
Xavier ALT 88783d3c12 [FIX] website_event_meet: fix crash when creating event meeting room
To reproduce:

- Log-in as admin
- Switch to debug mode

- Go to Events / Configuration / Event Templates
- Create a new template:
  * Name: Online Conference
- Check 'Website menu', 'Community' and 'Allow Room Creation' option,
- Save it

- Go to Events / Events
- Create a new event:
  * Name: New Online Conference
  * Template: Online Conference
- Save it and click on 'Go to Website' smartbutton
- Then click on 'Community' submenu
- In the right panel, click on "Create a Room"

It crashes with:
```
TypeError: ctx.widget is undefined
    template@.../web/assets/1/debug/web.assets_frontend_lazy.js line 13622 > Function:26:29 (/web/static/lib/owl/owl.js:5532)
    render@.../web/assets/1/debug/web.assets_frontend_lazy.js:66320:28 (/web/static/src/core/utils/render.js:56)
    renderToElement@.../web/assets/1/debug/web.assets_frontend_lazy.js:66272:22 (/web/static/src/core/utils/render.js:8)
    _onClickCreate@.../web/assets/1/debug/web.assets_frontend_lazy.js:132115:35 (/website_event_meet/static/src/js/website_event_create_meeting_room_button.js:25)
```

This revert odoo/odoo@065a2f451a change for `website_event_meet`, as
in that case the `csrf_token` value is provided directly as context
value to `renderToElement` (see `websiteEventCreateMeetingRoom`
publicwidget `_onClickCreate` handler)

closes odoo/odoo#151761

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2024-01-31 13:47:12 +00:00
Benjamin Vray ab0e0f4bef [FIX] web, website_sale: fix text color of modals if dark body background
Before this commit, if the text color of the body was light (e.g., due
to a dark body background), the text in certain modals (for example, in
the "Alternative products" modal displayed when adding a product to a
cart on a product page) was also light, making it not visible on the
white modal background.

Steps to reproduce the bug:
- Install the e-commerce on your website.
- Go to the "Customizable Desk" product page.
- Click on "Edit" to go in edit mode.
- Click on the "Theme" tab.
- Click on the 4th color of the theme colors and choose "black".
- Save the page to leave edit mode.
- Click on the "Add to cart" button.
- Bug: The text in the the modal is not visible because both text and
background are white and the input elements have their background the
same color as the body.

After this commit, we now verify that there is sufficient contrast
between the text color of the body and the background color of the
modals. If this condition is not met, we apply an alternative color
("$color-contrast-dark" or "$color-contrast-light") to the text of the
modal to ensure visibility.

opw-3570774

closes odoo/odoo#151346

X-original-commit: ffd2f2363f20b88ec05c153c57057b538c3885d2
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2024-01-31 13:47:11 +00:00
William Henrotin 49e55546c2 [FIX] stock, mrp_subcontracting: split origin moves
This commit corrects commit 7a78839ca6cf45ddec7adb59051da132e0ebceb4
that split the move_orig_ids for new stock moves created in backorder.
The issue is this should only happens in case of subcontracting, not for
every backorders

closes odoo/odoo#151179

X-original-commit: 79f85cba46df610372c740f971182cac8c0498c0
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2024-01-31 13:47:10 +00:00
Chrysanthe (chgo) b5db4c2661 [FIX] web_editor: fix colorpicker buttons design
This commit fixes an issue related to the colorpicker component, present
in both back-end and front-end. They use the same XML template but they
have two different selectors within our SCSS files.

Some months ago, commit[1] removed some `@extend` rules related
to button design within the `web_editor`, and replaced them
with a `.btn` BS class. This affected both colorpicker and causes layout
issues on the "front-end web editor", which was not the expected output.

The issue was fixed directly with commit[2], but by removing the `.btn`
class from the template, it removed the whole styling on the back-end
color picker, making it use the user agent button styling.

== After ==
Since the colorpicker already has some CSS variables to handle its design
depending on the context, we make use of the CSS variables to customize
the design of the component when it is inside the backend, and make it
look as it was before it lost its `.btn` class.

[1]: ee38c69503
[2]: 711fc86368

task-3693078

closes odoo/odoo#150157

Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2024-01-31 13:47:09 +00:00
Antoine (ande) ed76c3700c [FIX] point_of_sale: cannot scroll in categories
Current behaviour:
When there is too many product categories,
you cannot see the last items, because
the scrollbar is hidden.
This was made to hide the scrollbar on mobile.

Steps to reproduce:
1. Go to Point of Sale
2. Configuration > PoS Product Categories
3. Duplicate one category 12 times
4. Uncheck Restrict Categories
5. Dashboard > New Session
6. The list of categories is too long
7. Cannot see the last items

Cause of the issue:
Introduced by https://github.com/odoo/odoo/commit/60f41b1f831248c58f554dbe40114ef0d4ce42c0#diff-f23069b3927b8544dd51433e277cf8b650b10a67e5b8648155e427aaa31c19a3R838

Fix:
Make the scrollbar disappear on mobile,
and appear otherwise.

opw-3653429

closes odoo/odoo#150154

X-original-commit: 0f7fbede653dcb7c91536ea9c87df7d831a0c8cf
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-31 13:47:08 +00:00
Abdelouahab (abla) af66512ea8 [FIX] web: open record from list with a x2m field on virtual record
To reproduce
============
- On a project, on a task
- create a subtask give it a name and from the list view click on the
  "view" button
- you get redirected to form view to create a new task that is not related
to the parent task or the project

Problem
=======
When you click on the "view" button, the task is not saved yet, so the
subtask doesn't exist yet to be viewed in Form view

Solution
========
We prevent the redirection to the form view if the record is not saved yet
same logic as : https://github.com/odoo/odoo/commit/9b136383c2599301413e6770cc0ff204273b589d

opw-3681471

closes odoo/odoo#149753

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-31 13:47:07 +00:00
Claire Bretton (clbr) 54a1f89bda [IMP] account: Send & Print - use the bus to notify cron status
- Add a notification when closing the wizard that states that invoices
will be processed asynchronously.
- Add notifications when the cron is done processing some invoices.
This notification can either be a successful message or a warning when some
invoices are in error state. The notification can redirect to concerned moves.

closes odoo/odoo#149717

Task-id: 3568549
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2024-01-31 13:47:06 +00:00
Claire Bretton (clbr) d67968b5a2 [IMP] account: Send & Print - make .zip filename translatable
When downloading multiple invoices the zip file was not translatable
thus all languages had 'invoices.zip' file.

Task-id: 3568549
Part-of: odoo/odoo#149717
2024-01-31 13:47:06 +00:00
Claire Bretton (clbr) 856eaaa6ff [IMP] account: Send & Print - more tests
Add some tests for multi-company setup.

Task-id: 3568549
Part-of: odoo/odoo#149717
2024-01-31 13:47:06 +00:00
Claire Bretton (clbr) d57cc3c0f0 [FIX] account_edi_ubl_cii: move Send & Print files into /wizard folder
Send & Print files should be in the `wizard/` folder.

Task-id: 3568549
Part-of: odoo/odoo#149717
2024-01-31 13:47:06 +00:00
Leonardo Pavan Rocha aaee5dab51 [FIX] calendar{_sms}: alarm manager not creating cron trigger in recurrences
After https://github.com/odoo/odoo/pull/118738, we start generating a single
cron trigger per recurrence, however it fails to create the cron trigger for
daily recurrences. The main issue happens when the cron is run after the first
trigger of the recurrence. Imagine we have an alarm of 5 minutes before the
event, the call for_setup_alarm from _send_reminder will try to get the next
event in the recurrency to notify. However, the SQL query uses
`WHERE start > now` and if the cron trigger runs before the event is started
(most cases) this query will return the event that we're notifying. This commit
fixes this by checking event by event which is the next alarm tha should be
triggered and passing that date in the context of the `_setup_alarms` call.

How to reproduce?

Install calendar
- Create a recurring event with daily recurrence repeating for 3 days. Invite
Demo, set an email alarm for 5 min before the event and create the event
- A cron trigger will be created for 5 min before the event
- Change your computer's time so that it is 5min before the event
- The cron trigger will be called and it should create a new cron trigger for
the other day, however no cron trigger is created

Issue: SQL query in _setup_alarms in calendar.recurrence is getting the first
event with start > now, however it returns the event that was already notified

Solution: process event by event and check if its last alarm was already set.
If it was, we'll generate an alarm for the next event. If not, we'll use the
same event for the _setup_alarms call

For SMS alarms, we would not even create triggers for recurring events, so this
commit also fixes that.

task-3663455

closes odoo/odoo#151623

X-original-commit: 2da5bf6e9184db23836ea458a1fc53e27be49a1e
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Leonardo Pavan Rocha <lpr@odoo.com>
2024-01-31 10:43:24 +00:00
roen-odoo 07a16e1b3f [FIX] pos_loyalty: fix test
This commit fix unconsistent test.
https://runbot.odoo.com/web/#id=54900&view_type=form&model=runbot.build.error&menu_id=405&cids=1

opw-3583174

closes odoo/odoo#151670

X-original-commit: 311c59f75e8af0e377178835b093851f133d1f1a
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Robin Engels (roen) <roen@odoo.com>
2024-01-31 08:43:44 +00:00
Yannick Tivisse 13549b56f5 [FIX] project_timesheet_holidays: Fix company right issues
Before this commit, when the company of the employees updated is not
in the allowed_company_ids of the current user (could happen in the
execution of a cron), an error is triggered saying we are not allowed
to create a timesheet for an employee inactive. The reason is because the
employee is not fetched in the check made in the timesheet creation because
of the company of that employee is not in the companies contained in the
environment.

This commit makes sure the companies in the environment are the ones
set on the employees created/updated, to be sure those employees are fetched
in the check made in timesheet creation.

closes odoo/odoo#151656

X-original-commit: ed6b02b6323691f79aa4ff466541eeb9768de1c9
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-31 08:43:43 +00:00
Claire Bretton (clbr) 061052c0e1 [FIX] account: Send & Print link invoice if after service fails
Currently, if the Send & Print fails in a web-service that happens *after* the PDF generation
(such as UBL) we don't link the PDF and fallback on Proforma if possible.

After this task, if we are in this situation we will link the invoice and not generate the proforma.
Behavior is left unchanged for web-services that fail *before* PDF generation.

closes odoo/odoo#151624

Task-id: 3690897
X-original-commit: b4f051dbdebd71688e13defc993404e9ec8d839a
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2024-01-31 08:43:41 +00:00
roen-odoo dd84bc70a7 [FIX] point_of_sale: fix report total paid amount
Current behavior:
When we print the sales details report, we get an error popup

Steps to reproduce:
- Setup an ePos printer
- Open PoS
- Make an order with some products and finalize it
- Click on the close session button, and print the sales details report

Total paid is set here in currency:
https://github.com/odoo/odoo/blob/f8f4e899b51a73b48882b2b6e33441f0e8eed477/addons/pos_daily_sales_reports/models/pos_daily_sales_reports.py#L204

opw-3702011

closes odoo/odoo#151753

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-31 06:59:15 +00:00
william-andre 133356da4c [FIX] analytic: populate analytic lines
The `sum` function needs to be given a compatible for the `start`
argument.
Instead of using that function for a simple sum of two elements (not
`int`), lets just sum them explicitly instead.

Traceback:
```
TypeError: unsupported operand type(s) for +: 'int' and 'account.analytic.plan'
```

closes odoo/odoo#151738

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-31 06:59:14 +00:00
Odoo's Mergebot 253f56c8d9 [FW][FIX] website_slides: fix channel progress bar / completed tag width
Purpose
=======
This reverts commit https://github.com/odoo-dev/odoo/commit/27a1ccc829d290c8589a535f10b31caaacd6400f which fixed the container height when course name was too long. It added a 'visibility: hidden' style which caused an issue on the course left bar where the progress bar and completed tag are located next to each other.

Instead of adjusting the size of the container we prefer to limit the size of the course name to fit a single line. To do that we use the text-truncate class.

Task-3607404

closes odoo/odoo#151736

Forward-port-of: odoo/odoo#150162
Forward-port-of: odoo/odoo#143136
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
2024-01-31 06:59:13 +00:00
Patrick Hoste 13abb46dc8 [FIX] website_slides: add truncate class on course title
Instead of adjusting the size of the container we prefer
to limit the size of the course name to fit a single line
To do that we use the text-truncate class.

Task-3607404

X-original-commit: b94e900b38feac490969d1bb4cb4c0da1a5455a9
Part-of: odoo/odoo#151736
2024-01-31 06:59:13 +00:00
Patrick Hoste 8c993deca6 [REV] website_slides : Adjust container to contain the full course name
This reverts commit 27a1ccc8 which fixed the container height
when course name was too long. It added a 'visibility: hidden'
style which caused an issue on the course left bar where the
progress bar and completed tag are located next to each other.

Task-3607404

X-original-commit: cac68b35777210c3f96a5bd187b479589716145d
Part-of: odoo/odoo#151736
2024-01-31 06:59:13 +00:00
tsm-odoo 98c0068033 [FIX] website_livechat: fix message reaction tour
The `test_complete_chatbot_flow_ui` ensures it is possible to add
reactions to the chat bot messages once the thread is saved on the
server.

This test was sometimes failing because the condition that is used to
wait for the thread to be persisted is incorrect: it checks that a
message with the user response exists but the chat bot question also
contains the response text.

This PR fixes the issue by using the `contains` helper instead: it
will wait until the expected state is reached.

fixes runbot-55291

closes odoo/odoo#151720

Signed-off-by: Didier Debondt (did) <did@odoo.com>
2024-01-31 06:59:12 +00:00
Romain Derie 50e27b3c84 [FIX] website, *: make custom search model work when no website_id
*: test_website

Commit [1] modified the custom page search model so it is adding the
current website in the search domain.

But it was not considering the case of models not having a website_id
field.
The only case was the appoitment.type model.

Steps to reproduce:
- Install website_appointment (enterprise)
- Click on Website > Site > Appointments
- Crash

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

closes odoo/odoo#151686

X-original-commit: 247a5e157f14ce2cd8fbbe8d191abcb3c2e4ec0d
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2024-01-31 06:59:10 +00:00
Aurelien van Delft (avd) 7eabfd06fe [FIX] point_of_sale: add missing indexes for create_from_ui
Add two missing indexes on pos.order and one on pos.payment. These
speed up queries executed when calling create_from_ui from the
pos interface.

opw-3619270

closes odoo/odoo#151441

X-original-commit: 6f1b5bd530dbb211bb0dbc41b523233dfb57d002
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Aurélien van Delft (avd) <avd@odoo.com>
2024-01-31 04:37:43 +00:00
Joseph Caburnay 3f1318a247 [FIX] point_of_sale: predictable sync notification
A fix introduced in
https://github.com/odoo/odoo/pull/146836/commits/5fd63c81b092d07c4c92381a0391dad52d9b76aa
resulted to unpredictable server-syncing behavior when deleting an order from
the ticket screen. The value of sync notification message can be different
between the runs of the `pos_restaurant_sync` tour test. To make the behaviour
predictable, we make sure to await the syncing when sending order for
preparation.

Runbot Error: 56341

closes odoo/odoo#151424

X-original-commit: ce1d631fda4cfb3c60598ed06b4e0b695ab1f8bc
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2024-01-31 04:37:42 +00:00
Raja Prasad a4e17052b4 [FIX] hr_timesheet: fix space between avatar and employee name
Steps to reproduce:

- open any task from project in form view
- add timesheet to that task
- switch to mobile view
- under the timesheet section in notebook

Issue:

- there is no space between avatar and employee name

Solution:

- add space between avatar and employee to make user friendly view

closes odoo/odoo#151091

Task: 3633405
X-original-commit: 41d4a93100b809d404e8145e3cf14d1dc3b7c208
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2024-01-31 03:16:37 +00:00
Aaron Bohy 332268c724 [FIX] web,test_assetsbundle: correctly display scss error
Before this commit, when there was an error while compiling scss,
information was added in the compiled css bundle s.t. the client
is aware there was an issue and can indicate it to the end user.

In particular, a dialog was shown with a static message, and
with what should have been the python stack trace. However, the
stack trace was missing.

In addition, a banner should have been displayed in the bottom left
corner the screen, telling that a former version of the bundle was
used as the new one is in error. This banner wasn't displayed
either.

Finaly, forwarporting odoo/odoo#149230 automatically closed the
dialog, as we close all dialogs when executing an action (in this
case the first action when the webclient starts). As a consequence,
the dialog was no longer displayed either.

To sum things up, before this commit, 1) there's no longer a dialog,
even if there were, 2) the dialog doesn't contain the stack trace,
and 3) there's no banner.

To fix 1), we simply display a notification instead. Opening a
dialog for this simply doesn't fit with odoo/odoo#149230, and a
sticky, danger, notification is totally fine for this.
A notification being smaller than a dialog, it says to open the
console to see the stack trace instead of inlining it.

2) has been inadvertendly introduced by [1]: quotes in the error
were doubly escaped (\\"), meaning that they weren't escaped at
all, so the js couldn't properly read the value

And the source of error for 3) was that the last line of the css
bundle (the sourcemap comment line) wasn't valid. It started with
`//*`. As a consequence, the remaining of the file wasn't processed,
and that's exactly where the assets bundle error handling code
inserted the error information.

[1] 64bbef5bc1

closes odoo/odoo#149543

Related: odoo/enterprise#55257
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2024-01-31 01:31:53 +00:00
FrancoisGeandAaron Bohy 8665bf83dd [FIX] web: close dialogs when executing action
Have a form view in a dialog with an action button (e.g. a stat
button). Click on it. Before this commit, the action was executed
in the background, but the dialog remained open, which could
confuse the user and was definitely weird UX-wise.

With this commit, we automatically close all dialogs when we
execute an action which will update the main action container.

Note that this was working in previous versions thanks to legacy
compatibility code [1], but this code has no impact on the new
(wowl) dialogs, so as of 16.0, it has very limited impact.

Here's a specific scenario to reproduce the issue:
- go to the project task gantt view
- click on a pill
- in the task for view (in dialog), click on the external button of
  the project many2one
- in the project form view (in dialog), click on a stat button (e.g.
  "At risk")
-> before this commit, the 2 dialogs remained open.

opw 3644904

[1] https://github.com/odoo/odoo/blob/15.0/addons/web/static/src/legacy/action_adapters.js#L42

X-original-commit: 03fa39738c4f81ae30caaaa032c099797ecba9e7
Part-of: odoo/odoo#149543
Co-authored-by: Aaron Bohy (aab) <aab@odoo.com>
2024-01-31 01:31:53 +00:00
Ethan Vincent 4b2286bd5b [FIX] sale{,_expense}: bad conversion distr. keys
**Current behavior:**
Trying to post journal entries for an expense report sheet
contianing an expense that has:
  A) an associated analytic distribution with
     both a Project and Department, and
  B) a customer to be re-invoiced (requires the expense
     to be for a product which permits this operation),
attempting to post the journal entries for the approved expense
sheet will raise a ValueError.

---

**Expected behavior:**
The entries get posted to their respective accounting journals.

---

Steps to reproduce:
0. Install the Project, Accounting, Sales, Expense apps
   and enable analytic accounting in the db settings

1. Create a new expense with:
   A) an analytic distribution which has
      both available fields filled out, and
   B) a category that permits a customer to be re-invoiced
      (then enter a customer)

2. Create the report, submit it to the manager, approve it,
   then attempt to post the journal entries

3. This should cause the traceback, if the process was blocked
   try again after deleting any tax rules in the expense

---

Cause of the issue:
The analytic_distribution field in the hr.expense module is
stored as a dictionary. During the process of recording the
journal entries, the keys are converted from a string to
integers. However, when multiple keys are in the dict, the
conversion is set up improperly and fails.

---

Fix:
Modify the conversion sequence so that multiple dict keys are
accounted for.

---

opw-3663082

closes odoo/odoo#147985

Signed-off-by: John Laterre (jol) <jol@odoo.com>
2024-01-31 01:31:53 +00:00
Yosua Nicolaus b0f0fd2ee3 [FIX] account,pos,purchase,sale: AccessError for branch user
There are a lot of places in the codebase where insuficcient access to a
company blocks a normal flow and raises AccessError. While this should
normally never happen with the protections from company domain check,
the new multi company branch/parent relationships suffers the most of
this behavior; because a children company sometimes requires an
information from their parent's field (e.g. currency_id)

The correct behavior to do here is to let the children get the required
data just for processing the flow in the compute (behind the scenes).
Even though the children should normally have no access to read/write it
on screen, the backend process should be able to run smoothly without
blocking any flow.

Granting a few temporary sudo() is necessary to ensure the flow runs as
expected on some places.

closes odoo/odoo#151562

Task-id: 3551305
Related: odoo/enterprise#55345
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Yosua Nicolaus (yoni) <yoni@odoo.com>
2024-01-30 23:51:28 +00:00
Yosua Nicolaus ea1578902a [IMP] account: dashboard journal data visibility & privacy
Branch company should be able to access both their parent and children's
journal and make transactions in it. However at the same time, a child
branch should not be able to see how much balance is in the parent's
journal because of privacy reasons.

This commit aims to implement this balance visibility behavior by
checking on the company and its relation to the journal's company

Additionally, this commit also adds an improvement where whenever there
are journals from other company (parent/child) in their dashboard, the
journal's company name will be displayed to avoid any confusion.

Task-id: 3551305
Part-of: odoo/odoo#151562
2024-01-30 23:51:28 +00:00
Yosua Nicolaus ef188f7c9d [FIX] account,purchase,sale: unaccessible branch parent/child fields
When a user only has access to a branch of a company, they should be able
to access their parent's products, taxes, accounts, and journals

The current behavior however prevents that because of how the domain was
set on those field's view domain by checking the company_id in the view

This commit aims to fix that by removing the company domain limitation.
The fields have already considered the parent company by default via
check_company in python so no further changes are needed.

Additionally, for bank/cash journals, a company should be able to access
both their parent's and their children's journal and make transaction
in it.

Task-id: 3551305
Part-of: odoo/odoo#151562
2024-01-30 23:51:28 +00:00
Thomas Lefebvre (thle) 3b470122f9 [FIX] hr_holidays: take into account public holidays
Steps to reproduce:
-------------------
On the Time Off dashboard, click on a public holiday.

Issue:
------
The duration is 1 Day instead of zero day.

Cause:
------
To ignore the current holiday, the domain for finding holidays adds the condition:
```py
('holiday_id', '!=', self.id)
```

Unfortunately, if we have a `NewId`, in postgresql,
`NULL != NULL` condition always returns NULL.

As a result, public holidays (which do not have a `holiday_id`)
will not be taken into account.

Note:
This does not happen when you save because the id exists.

Solution:
---------
Accept `holiday_id` equal to `False` in the domain.

opw-3635949

closes odoo/odoo#151534

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-30 23:51:27 +00:00
Moens Alexandre 313b797e33 [FIX] payment_xendit: neutralize
This commit adds the missing neutralisation necessary for the `payment_xendit`
module introduced in [1]

The purpose of the standard neutralisation framework is to allow us to
create database copies that will not interract with external systems in
ways that could impact the production database (or if it is not possible
to prevent the interractions, make sure that they are benign or wont
result in actual changes), or impact the customers of the operator of
the production database.

This is mainly useful to allow safe support investigation on database
duplicates.

[1] odoo#141661

closes odoo/odoo#151511

Signed-off-by: Alexandre Moens (mao) <mao@odoo.com>
2024-01-30 23:51:26 +00:00
Abdelouahab (abla) 003218a679 [FIX] hr_holidays: Fix accrual plan read access
to reproduce
============
 As admin:
- in my Belgian company: create an accrual plan (use default values)
- create an allocation for laurie poiret, use the created accrual + add 2 days of allocation
- as lauriepoiret go to time off
- create a time off for today or in the past
- try to open time off type drop-down -> error

Problem
=======
The problem is that the accrual plan is not readable by the employee, but used in compute method.

Solution
========
use sudo to read the accrual plan

opw-3687866

closes odoo/odoo#150993

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-30 21:08:06 +00:00
Pablo Montenegro 08e49fe88e [IMP] l10n_ar: fiscal position auto-detection
Prior to this commit, fiscal positions auto-detecion was completely override for Argentinian countries.
With this improvements the afip responsibility field can be combined as a filter to choose the proper fiscal position.

Example of a new use case could be:
* Name: Gross Income Perceptions Buenos Aires
* Detect Automatically = True
* Afip Resp. Type = Responsable Inscripto
* Country = Argentina
* Federal states = Buenos Aires

So, this fiscal position will be automatically choosen only for responsables inscriptos of Buenos Aires.

Previous use cases still work.

closes odoo/odoo#150652

X-original-commit: 4c5987eb1ac7687eb0c6467d99fb3052e4843a07
Signed-off-by: Josse Colpaert <jco@odoo.com>
2024-01-30 21:08:05 +00:00
Pablo Montenegro 9c4fd4fe8b [IMP] account: make inheritable region base domain used to get fiscal position
Task Adhoc: 35708
Task latam: 668

X-original-commit: bfb39b342c4e971e533161a56865ee0e2342bd5d
Part-of: odoo/odoo#150652
2024-01-30 21:08:05 +00:00
Alvaro Fuentes ce3aac8672 [FIX] core: propagate update of modifiers attributes from base terms
When we update an inline translated element (like `<span>`) for the base
language `en_US` we should update the modifiers attributes for all
languages.

For example when updating from (16.0)
https://github.com/odoo/odoo/blob/7ecd9413/odoo/addons/base/views/ir_ui_view_views.xml#L127-L129
https://github.com/odoo/odoo/blob/7ecd9413/odoo/addons/base/i18n/fr.po#L7233-L7235
to (17.0)
https://github.com/odoo/odoo/blob/b1461d28/odoo/addons/base/views/ir_ui_view_views.xml#L126-L128
https://github.com/odoo/odoo/blob/b1461d28/odoo/addons/base/i18n/fr.po#L12087-L12089

The base term, `en_US`, is updated since the text matches but the
attributes of the translated terms, `fr_FR` for example, are not
updated. Later when the PO file is loaded in non-overwrite mode the
translated terms for `fr_FR` is not updated. This causes all sort of
issues during an upgrade for inline-translated terms -- like `<span>`.
More so since the recent change that converts domain-based attributes
into inline Python expressions.

In this patch we propagate modifiers attributes from inline-translated
items in the new base term into all translated terms when the base term
is updated. In that way we ensure the attributes are correct in all
languages even if later the loading of their corresponding PO file
doesn't update the term.

For a detailed example, let's see what happens when loading the view
above during an upgrade 16->17, right at the first load of the XML file
at https://github.com/odoo/odoo/blob/b1461d28/odoo/fields.py#L1864
```
(Pdb) p old_term
'<span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'soft\')]}">This view has no previous version.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'hard\')]}">This view is not coming from a file.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'other_view\')]}">You need two views to compare.</span>'
(Pdb) p closest_term
'<span invisible="reset_mode != \'soft\'">This view has no previous version.</span>\n                        <span invisible="reset_mode != \'hard\'">This view is not coming from a file.</span>\n                        <span invisible="reset_mode != \'other_view\'">You need two views to compare.</span>'
(Pdb) p translation_dictionary[old_term]
defaultdict(<class 'dict'>, {'fr_FR': '<span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'soft\')]}">Cette vue n\'a pas de version antérieure.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'hard\')]}">Cette vue ne provient pas d\'un fichier.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'other_view\')]}">Vous avez besoin de deux vues pour comparer.</span>'})
```
As we can see the new term will get an updated value for its `invisible`
attribute, while also removing `attrs`. The translated terms will be
still keep the old modifier though.
Now later when the fr_FR.po file is loaded we reach this point
https://github.com/odoo/odoo/blob/b1461d28/odoo/tools/translate.py#L1442
```
(Pdb) p term_en
'<span invisible="reset_mode != \'soft\'">This view has no previous version.</span>\n                        <span invisible="reset_mode != \'hard\'">This view is not coming from a file.</span>\n                        <span invisible="reset_mode != \'other_view\'">You need two views to compare.</span>'
(Pdb) p translation_dictionary[term_en]
defaultdict(<function DeepDefaultDict at 0x7fc9640cdfc0>, {'fr_FR': '<span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'soft\')]}">Cette vue n\'a pas de version antérieure.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'hard\')]}">Cette vue ne provient pas d\'un fichier.</span>\n                        <span attrs="{\'invisible\': [(\'reset_mode\', \'!=\', \'other_view\')]}">Vous avez besoin de deux vues pour comparer.</span>'})
```
Thus the translated values are NOT updated, keeping the _wrong_
modifiers. This is later fixed during the upgrade in a clumsy way.
C.f. the warnings like this one in runbot:
```
Incomplete conversion for view(id=77, lang=fr_FR) at
<span attrs="{'invisible': [('reset_mode', '!=', 'soft')]}">Cette vue n'a pas de version ant&#233;rieure.</span>
```
Note that such warnings are gone in current PR CI.
The root issue here is that when the fr_FR translation is loaded the
terms are not updated due to a combination of factors:
1. The text content of the term didn't change
2. There is no override flag set for translations

Option 2 is not a valid option during upgrades because we want to keep
custom translations. We could instead of the current patch tweak how
option 1 works and perhaps make the closest term more restricted. This
would lead to the update of the whole translation though while the
actual issue here is _just_ the modifiers. Moreover if the translations
are out of sync the translated terms will still keep the wrong values
that could still be essential for the correct functioning of the record
they belong too (view archs -- for example).

Finally this is a more extreme case (16.0):
https://github.com/odoo/enterprise/blob/1e63b4a8/sale_subscription/views/sale_order_views.xml#L142
In this case during the upgrade we fix the modifier value (refer to
runbot warning above -- it's the same script that fixes it) and set
```
invisible="(subscription_management == 'upsell') or (recurrence_id == False)"
```
for translations, which is wrong. The correct value is (17.0):
```
invisible="not plan_id or subscription_state == '7_upsell'"
```
https://github.com/odoo/enterprise/blob/530ba3ad/sale_subscription/views/sale_order_views.xml#L136

closes odoo/odoo#150152

Signed-off-by: Raphael Collet <rco@odoo.com>
2024-01-30 21:08:04 +00:00
Alvaro Fuentes 86e3c3c72b [FIX] core: fix check for text-only translated terms
`get_text_content` will transform contiguous space chars into single
spaces, plus translate special HTML elements
```
>>> " ".join(html.fromstring(f"a\n    b &amp; c").text_content().split())
'a b & c'
```

In order the correctly verify if a term is text-only we need to use the
HTML parser. Note that to be resilient against bad XML, but valid HTML,
we cannot use the default XML parser.

Part-of: odoo/odoo#150152
2024-01-30 21:08:04 +00:00
Ethan Vincent d001a3a860 [FIX] hr_attendance: change logo route in kiosk
**Current behavior:**
Creating an additional company then creating an attendance
kiosk link for it will not display this company's logo.

---

**Expected behavior:**
The kiosk page displays the logo for whichever company is
actively selected when the link is generated

---

**Steps to reproduce:**
1. Create a second company, set the logo to anything besides
     the default/fallback image

2. In the HR Attendance application settings, generate a kiosk
     link then paste & go in an incognito window

3. Observe the logo image displayed above the bar code is the
     default/fallback image

---

**Cause of the issue:**
The route being used to get the company's logo does not work
for companies which are not the first/default one generated
with the database. An accessibility check fails due to some
information about the user's access rights not being available
with the request.

---

**Fix:**
Use an alternative route which can properly access the logo
image file of the company that is active when the kiosk link is
generated.

---

opw-3672577

closes odoo/odoo#150628

Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2024-01-30 18:05:57 +00:00
Sven Fuehr e7afb81885 [FIX] account: dashboard separate invoices / bills to validate links
Currently the "Invoices to validate" link is broken in case the module
account_3way_match (from enterprise) is installed.

The same link / context is used for "Invoices to validate"
and "Bills to validate". (The text inside the link is just changed
depending on the journal type.)
The module account_3way_match changes the context of that link to
change the behaviour for the "Bills to validate" (bill specific filter).
This breaks the link for "Invoices to validate".

This commit makes invoices and bills have dedicated / separate links.
Thus after this commit account_3way_match only changes the behaviour of the "Bills to
validate" link.

task-3680398

closes odoo/odoo#149352

Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2024-01-30 18:05:56 +00:00