Commit Graph
163215 Commits
Author SHA1 Message Date
Julien Mougenot fd64757d82 [FIX] web: fix focus issues with datetime hook
Before this commit, the way focus was handled by the DateTime feature
hook was inconsistent. This caused the date/datetime/daterange fields to
not be able to open the picker when clicking on the "Add start/end date"
button, and effectively lose the value set on the field on save.

This commit introduces a more consistent focus handling as well as a
helper returned by the hook to open the picker on command.

Part-of: odoo/odoo#127734
2023-07-12 16:53:10 +02:00
Julien Mougenot f962d071ad [FIX] web: fix datetime picker buttons overflowing
Before this commit, the "Apply" button in date pickers (not datetime)
would overflow from its popover in desktop view since its position is
set to absolute, and since there are no time pickers to extend the
height of the picker it simply overflows.

This commit ensures that the buttons are correctly displayed when there
are no time pickers.

Part-of: odoo/odoo#127734
2023-07-12 16:53:09 +02:00
Julien Mougenot 44df785656 [FIX] web: use allowed CSS selectors in datepicker
Before this commit, there were some uses of illegal CSS selectors such
as `:not(.classA, .classB)`. The proper way to use multiple `:not`
statements is to chain them. This commit takes care of that.

Part-of: odoo/odoo#127734
2023-07-12 16:53:09 +02:00
Habib (ayh) a638442a3d [IMP] base: force dialog size of layout configurator
action_base_document_layout_configurator should always have a dialog_size = 'large'
this ensures that the context from a calling function is not applied

closes odoo/odoo#127630

Related: odoo/enterprise#43770
Related: odoo/upgrade#4918
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-07-12 16:52:59 +02:00
Habib (ayh) 9299f81f19 [IMP] account: statement management 2.1
In the process of making bank statements optional, the usability of bank statement was reduced.
This PR aims improve that, by providing the ability to view and manage bank statements on the bank reconciliation widget.
See the Enterprise PR.

Task-3270046

Part-of: odoo/odoo#127630
2023-07-12 16:52:58 +02:00
FrancoisGe 42e5e247bf [FIX] web: m2o must only use the context of the field
From commit 2ecfed335d, clicking on the arrow of a m2o opens the
record in form view and passes it the context of the current view.
After this commit, only the context defined on the <field> is passed.

Problem:
An example of a problem, is the use of an incorrect active_id in the
second view that is passed through the first form view to the second.
Previously, the active_id of a form view was always the id of the record
and not that of the previous view. This behaviour is debatable, but it
leads to major changes. We therefore prefer to revert to the old behaviour
and no longer pass the entire context in order to avoid this problem.

How to reproduce:
- Go to a form view with a m2o
- Click on the arrow of the m2o

Before this commit:
    The view context contains all the context from the first form
    view and the second.

After this commit:
    The view context contains the context of the m2o field and the second view.

closes odoo/odoo#127538

Taskid: 3394945
X-original-commit: a9bec1fec3ff08461732ef2717457524339eb716
Signed-off-by: Géry Debongnie <ged@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 16:52:54 +02:00
Rob Coekaerts 2de114a37f [FIX] hr_holidays: make holiday tests (demo) data independent
Before this commit, the hr_holiday tests used base_company to setup the
tests. This resulted in the tests interacting with the demo data that
were linked to this company, eg stress days.

With this commit, the tests are now independent of this data, and will
therefore not be affected by any changes it.

closes odoo/odoo#127415

Related: odoo/enterprise#43717
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-07-12 16:52:49 +02:00
Hugo Carlier (Huca) 0afd96e669 [IMP] project_todo: keep the breadcrumb after to-do conversion
When a to-do is converted to task, the breadcrumb was reseted
preventing the user to go back to the to-do app in one click after
conversion. This commit reintroduces the full breadcrumb after
conversion.

task-3369510

closes odoo/odoo#126966

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 16:52:44 +02:00
Maruan Aguerdouh (magm) 2adcb5a989 [FIX] website_slides: quiz success modal displayed properly
After refactoring the modal options to stop using the `Underscore.js`
library, the modal was not displayed properly anymore. You can check the
behavior by completing a quiz in the website_slides module.

If we set the `option` as the target of the `Object.assign()` we then
got the optiond properly applied and we got the same behavior as before.

Refactoring commit:
https://github.com/odoo/odoo/commit/f4f0f783183507df8227b37fe1234c256325df6d

opw-3389193

closes odoo/odoo#128132

X-original-commit: 46ed163e39238f7f4d7115711fe9dee93abd4cde
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2023-07-12 13:58:09 +02:00
Julien (jula) cf187ab43e [FIX] website_form: prevent crashing while parsing python dict in JS
__Description of the issue:__
- The `replace` method in JS only replace the first occurrence of a
string (unless `g` flag is used in the regex)
- There could be an apostrophe (`‘`) in a string value which would be
replaced by a quote (`“`)
- There could be “None”, “False” in a string value which would be
replaced too
- “True” is not taken into account

__Description of the fix:__
Those regex are meant to deal with more edge cases when transforming a
python dict to a JSON in JS. However there are still ways it could go
wrong. For the forward port in master, it could be a good idea to
consider converting dictionnaries directly in the backend using the
`json` python library.

__Steps to reproduce the issue:__
1. Edit the view `website.contactus`
(If `website_crm` is installed, either uninstall it or disable the
`website_crm.contactus_form` view)
2. At line 5, change the attribute `t-att-data-values` to a more
complicated dict like:
```
"{'email_to': res_company.email, 'name': 'Alice True', 'age': None, 'active': True, 'attr1': None , 'attr2': False , 'attr3': 'let\'s go'}"
```
3. Go to `/contactus` on the website
↳ Traceback

opw-3328690
task-3340946

closes odoo/odoo#128127

X-original-commit: 5360e10dcd89bdbae6d01a0f6597571c8592301f
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-12 13:58:06 +02:00
Thibault Delavallée e2711f46ff [IMP] event: format mobile / phone number of attendees when possible
ISSUE

SMS reminders are not always correctly sent, as people fill form using local
numbers. When scheduler run the number is not always recognized to be
formatted using E164 format. We should try to normalize numbers when possible.

SPECIFICATIONS

Try a sanitize: format number based on event country (or partner if set).
If formatting it works, use the given number, otherwise use the original
number.

Do it at registration creation, as classic flow is the frontend where customers
give numbers used to create registrations. When the number is coming from the
partner through the compute, do not do anything and keep current behavior
which copies partner number if not given directly on the registration.

Add an onchange to try to format the number in the form view, like what is
done on leads. Do not automatically do it at write as it is not really
required currently from business point of view, it is more an helper for
frontend registration.

Task-3342820

closes odoo/odoo#128118

X-original-commit: 94fa8d962535a754c9fb26997a38cc8b51b8974e
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-12 12:38:48 +02:00
Thibault Delavallée 0f26b490e1 [FIX] crm, phone_validation: format numbers using E164 standard
Most number formatting is done using E164 standard, see notably
'phone_get_sanitized_number' method in mail.thread.phone.

Some calls are still done using INTERNATIONAL format. Notably on 'partner'
and 'lead' model, an onchange is implemented that formats numbers according
to INTL format. However this leads to inconsistent computation where sanitize
is done using E164, and format using INTL. This makes some computation and
comparisons harders without much real added value.

In this commit we choose to make the onchange on those models use the same
E164 format as the sanitized one. This eases comparisons and usage of phone
numbers through Odoo.

Task-3342820

X-original-commit: 51d571fab4871fd62ce154b6fc1ed573407c7f86
Part-of: odoo/odoo#128118
2023-07-12 12:38:47 +02:00
paso-odoo aa9642215a [FIX] hr: launch plan for archived employees
Issue 1
=======
When an employee is archived and the user clicks on the 'Launch Plan' button
from that employee, it will throw an IndexError saying the tuple index is out
of range.

Steps to produce:
- Open any Employee > Action > Archive > Apply.
- Open archived employee(s) from the Filters > Archived.
- From list view or form view, Click on the 'Launch Plan' button.
- Error: IndexError: tuple index out of range.

Fixed this issue using the current company if the employee and their company
are not found.

Issue 2
=======
When a user clicks on the 'Launch Plan' button from that employee, It will
throw an IndexError saying the tuple index is out of range.

Steps to produce:
- Open any Employee.
- Make the 'name' field unrequired (Studio or Edit form view).
- Now create a new employee - before clicking on the Save button click on the
'Launch Plan' button.
- Discard Changes > Error will produce.

Fixed this issue using the check before using the employee record.

sentry-4259555464

closes odoo/odoo#128138

X-original-commit: 7ebe9dcdbe80f8309a82521986437b512ce656c4
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Parth Solanki (paso) <paso@odoo.com>
2023-07-12 11:20:02 +02:00
Tommy Ng 88b2e4f669 [FIX] hr_contract: fix new contracts searching with correct state
Current behaviour:
Next contracts searching will search incorrect state.

Expected behaviour:
Next contracts should not contain draft state contract.

Explanation:
Contracts state field new state should use the value draft.

closes odoo/odoo#128136

X-original-commit: aaf36439fa11acf4335dd803c6269e6e4596012b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-07-12 11:19:59 +02:00
Tommy Ng 05385ee8f3 [CLA] signature for SlaveWilson
X-original-commit: f158abd53c7001fad02d1f03c64f50d16209db40
Part-of: odoo/odoo#128136
2023-07-12 11:19:58 +02:00
Benjamin Vray 529fdea32c [FIX] website: fix image gallery arrows hidden after click
Steps to reproduce the bug:

- Drag and drop an Image Gallery Snippet onto the page.
- Add an image in the Gallery.
- Click on the "right" arrows.
- The arrow is gone.

A bug similar to this one had already been fixed by the commit [1] that
added the "o_not_editable" class to the "carousel-control" elements of
the "s_image_gallery" snippet. However, it was also necessary to make
this change in the QWeb template used when the slideshow is regenerated
upon adding an image.

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

task-3414584

closes odoo/odoo#128133

X-original-commit: 0983553f4df2b027290082c03142db4bfb5f288c
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
Signed-off-by: Benjamin Vray (bvr) <bvr@odoo.com>
2023-07-12 11:19:55 +02:00
Claire Bretton (clbr) 3d895b9f87 [FIX] payment: fix constraint on account.payment.method.line
Change a constraint that was meant to prevent deletion of an
account.payment.method.line when related provider is in 'enabled'
or 'test' state. The constraint is now handled only on the payment method
lines that are actually modified, and not on everything like previously.
This constraint was failing during upgrades because it was too broad,
its initial purpose was to raise error to user at the moment he tries
to remove payment method lines from its journals.

closes odoo/odoo#128214

X-original-commit: fca76bcc6c8be6e38827641555d62ab2973ab1fe
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Claire Bretton (clbr) <clbr@odoo.com>
2023-07-12 09:15:09 +02:00
Gurupreet Singh 9fdc834207 [FIX] project: fix search view issue in website for milestone in tasks
Before this commit if we go to website and choose tasks and if we search
anything it shows no tasks available and if we select milestone it shows table.

Steps:
- Go to website and select tasks and search anything in search bar.
- Showing  no tasks available
- choose milestone from drop-down and search anything it will show table labels.

Fix:
- Added condition for checking if milestone is passing empty record set  and
 added another condition to handle it

task-3183771

closes odoo/odoo#128204

X-original-commit: bcbfa314fb54039536b07446aa9c925378e68ab0
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-07-12 09:15:03 +02:00
Alexandre Kühn 5e917281b2 [FIX] project: no big chatter in project portal task
Before this commit, the portal chatter of a project task
on an XXL screen was huge, making form view to shrink
extremely.

This happens because chatter is in `flex-grow: 1`, and assumes
form view also has a specific width to adapt chatter accordingly.
However, in portal chatter, the form view defines a width of 1px
... Therefore giving the room of chatter to take the whole width.

Apparently this rule was defined as a workaround for list view,
which has no chatter. Somehow this rule is affecting form view
in portal, but not in backend.

This commit fixes the issue by removing the `flex-grow: 1` rule
on chatter, so that it always has a fixed size of `530px`.
This is not necessarily the best fix, but at least the most
important content, the form view, is more visible.

closes odoo/odoo#128191

X-original-commit: 15a8200a83ad00760fed0e5c46140c8539ccd8f3
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 09:15:00 +02:00
Brieuc-brd 89227a62db [FIX] mail: mobileTopbar buttons spacing
Prior to this commit, there was a spacing issue between `mobileTopbar`
buttons.

This PR fixes this issue.

task-3415575
Part of task-3326263

closes odoo/odoo#128190

X-original-commit: c599df12fe99bbf6ca5eaef2abc4ac94d27a59ae
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 09:14:57 +02:00
Adrien Schoffeniels a52e2fdb80 [FIX] web: use right color class for calendar popovers
Purpose:
--------
Currently, the calendar common popover has an incorrect color class if
the value of the field used to color the records in the calendar is not
a number. Therefore the popover header remains grey although the event
is colored, and the header content is misaligned.

This commit fixes this behavior by using the `getColor` method to obtain
the class name to use in the popover, which is the method currently used
to obtain the class name to use in the event. If this method does not
return a number, the default color class (o_calendar_color_0) is used.

Task-3239985

closes odoo/odoo#128169

X-original-commit: b159a98e0f0c89fab91b706895bbc1884a8cbd4e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-12 09:14:54 +02:00
oco-odoo f36ad3523b [IMP] account_reports: reset country_id when switching the availability condition of a report manually to something else than 'country'
Otherwise, when displaying the field in the view, the field might remain set, causing confusion.

closes odoo/odoo#128143

X-original-commit: 003edebd7e90d3e24a2f932c5ff90b1b13758b35
Signed-off-by: John Laterre (jol) <jol@odoo.com>
2023-07-12 09:14:51 +02:00
divy-odoo f88e827126 [IMP] web_editor: open internal link in edit mode
Before this commit, when the user was clicking on a link to another page
of the website, it was opening in another tab but in frontend mode.
However, in most cases the user actually wanted it to open in backend
mode.

Here is an example of users who started an eCommerce trial. They are
editing their homepage and want to create a product. They open the
"/shop" page using popover but because they are in the frontend, they
don't see the "+NEW" button. This behaviour seems a little odd.

Therefore, this commit aims to open internal links in the edit(backend)
mode instead of the frontend mode.

task-3177126

closes odoo/odoo#128114

X-original-commit: f7dacce18bf44914972da292ff041505289d1e16
Signed-off-by: Divyesh Vyas (divy) <divy@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-12 07:40:29 +02:00
momegahed c378868f16 [FIX] pos_discount: remove rounding from discount
Summary
-------
Currently, in POS, global discounts percentages are rounded to the
nearest *whole* number.

Steps to reproduce
------------------
- install the Point Of Sale
- activate Global Discounts on a POS
- start a session and add a product
- add a 5.5% global discount

Look at the added 'Discount' line, you should see that its amount
doesn't match the discount. (6% is applied instead of 5.5%)

opw-3347127

closes odoo/odoo#128111

X-original-commit: cbe314e35911f8c71987f2ae21a0fe446d97c360
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-12 07:40:24 +02:00
niyasraphy e588e25a5d [FIX] pos_daily_sales_reports: traceback on printing daily sales
before this commit, on printing the daily sales report
without selecting the pos session in the wizard, it
raises traceback.

traceback:

ValueError: Not naive datetime (tzinfo is already set)
Template: point_of_sale.report_saledetails
Path: /t/t[2]/t/div/div[1]/t[3]/strong/t[1]
Node: <t t-esc="date_start" t-options="{\'widget\': \'datetime\'}"/>

after this commit, the session field will be required
in the wizard and report will get correctly printed

closes odoo/odoo#128096

X-original-commit: a77e2936790fdb179f88c3cd2de08aec801bb24c
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-07-12 07:40:15 +02:00
tsm-odoo f5da99c0ad [FIX] mail: fix crash when unknown member leaves channel
Before this commit, a crash occurred when an unknown member
left a channel.

Steps to reproduce:
- Open two browsers, one for admin, one for demo
- Ensures both users are on the general channel
- Execute the `/leave` command with demo
- A traceback appears on the admin browser

This issue occurs because the `action_unfollow` only sends
the channel member id through the bus but the client relies
on other keys without checking for their presence. This
commit fixes this issue.

closes odoo/odoo#128090

X-original-commit: f8452b2eb8f9243402984d78184ed494384a187c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Signed-off-by: Matthieu Stockbauer (tsm) <tsm@odoo.com>
2023-07-12 07:40:11 +02:00
hupo-odoo f85ddd5964 [IMP] account : tax_tags switch on accounting reports
Improves the update of accounting report expression when switching the engine to 'tax_tags'.

To reproduce:
1) Create a new report line in a report with an expression using the 'external' engine, giving it "dudu" as formula.
2) Save your changes.
3) Modify your expression to use 'tax_tags' instead of 'external'. Save your changes.
=> +dudu and -dudu tax tags are now created (with this commit), as expected

task : 3270506

closes odoo/odoo#128053

X-original-commit: a7dfd79ec13bae3d43cda7be06ebd07ba3ce135c
Related: odoo/enterprise#43918
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Signed-off-by: Hugo Poncelet (hupo) <hupo@odoo.com>
2023-07-12 07:40:08 +02:00
Maruan Aguerdouh (magm) 71233fa2cb [FIX] website_slides: do not crash when deleting a slide
Steps to reproduce:

- Install the elearning module and go to a course not created by you.
- Try to delete or add any slide.
Note: the bug is not consistent it might happen for some courses and not
for others.

Issue: We get a traceback error when trying to modify anything about the
slides in this course.

Solution:
Adding the `'channel_id.slide_ids.slide_ids'` dependece to the
`_compute_category_id` will make the computation to take into account
the changes on the slides.

opw-3316697

closes odoo/odoo#128022

X-original-commit: 1d6f8f4c606ddb7f57acd7ef2a9f983d7de84a34
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-07-12 07:40:03 +02:00
tsm-odoo 1fd39b35b2 [FIX] mail: fix suggestion hook char deletion
Before this commit, the suggestion list would not work when
a string with no match was entered then modified.

Steps to reproduce:
- Open a channel
- Type `/hee` (this string matches no suggestion)
- Delete one of the `e` in order to get `/he`
- This string should match the `/help` suggestion but nothing
is shown.

There is several issues here:
- The suggestion hook is based on the composer selection but
the `selectionChange` event is not triggered when deleting text
from the textarea which leads to incorrect selection.
- The search is cleared in the `suggestionHook` when nothing is
found which leads to incorrect delimiter position after a deletion.

This commit fixes both issues.

closes odoo/odoo#127997

X-original-commit: b8bf65478cad558e02a5902886b3e4272483944e
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-12 07:40:00 +02:00
Benoit Socias bbd1a48083 [FIX] web_editor, website: use theme colors on shapes in options panel
Since the edited website pages are inside an iframe, the options panel
cannot base its display on the CSS rules of the page. When changing the
theme colors, only the edited page's CSS is reloaded, not the option
one. Because of this, the background shapes are displayed using an
obsolete color palette inside the options panel.
This causes colors to be forced on background shapes within the iframe
because their default colors do not match the ones inside the options
panel when different theme colors are set. Once forced, the colors of
the background shapes within the content do not follow the theme
palette changes anymore.

This commit forces the background shapes displayed in the options panel
to use the current palette.
This is done by recovering the current edited page's shape background
images from the CSS rules. This approach was chosen as opposed to
adding a `d-none` version of the shape `div` to the edited page and
getting the background image from its computed style.
This fixes the color comparison between the background shapes of the
content and the ones of the options panel, thus not forcing colors if
the theme colors are used.

Steps to reproduce:
- Edit a website page.
- Drop a "Banner" block.
- Enable background shapes.
- Go to the theme tab.
- Select a different theme color palette.
- Select the "Banner" block.
- Open the "Shape" option's menu.

=> The shapes were displayed with the old color palette and if selected
were applied with the old color palette.

Additionally, to avoid a race condition when leaving a theme color
picker by either clicking on the BLOCKS tab or re-selecting the
snippet with a shape, a re-rendering of the existing snippet editors
is requested and the shape cache is invalidated if the palette has
changed in the meantime.

task-3370939

closes odoo/odoo#127951

X-original-commit: c511e100cad2febc0ebb9ce61b5eb52232e60f7d
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-07-12 07:39:51 +02:00
Guillaume (gdi) 39b4d16f10 [FIX] website: format price according to client locale
Since [this commit], we have a range input to select a price filter for
products. This input displays a min and max price that the visitor can
select. The problem is that the price is not formatted according to the
visitor locale. This commit fixes this issue.

Steps to reproduce the bug:
- With English as language, go to the shop page
- Go to Customize and activate filter by price
- Install French on the website
- Visit /shop in French

=> The price is not formatted according to the French locale. For
example, we can see a price of a thousand euros displayed as 1,000.00
but in French, it should be displayed as 1 000,00.

[this commit]: https://github.com/odoo/odoo/commit/41f7c7bc6428050d4c7956edca26b7c1bd2d8e04

task-3414455

closes odoo/odoo#127881

X-original-commit: 683b7edf0ce1f098757aa1e38ee6dc5d4e255272
Signed-off-by: Louis Wicket (wil) <wil@odoo.com>
Signed-off-by: Guillaume Dieleman (gdi) <gdi@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-07-12 07:39:48 +02:00
Lucas Perais 450f79c896 [FIX] web: actionService reports: pass action's context to download
Before this commit, the report action's context was not passed to the download route.
This was problematic as some crucial keys may be forgotten when downloading the pdf.

After this commit, we do pass the full context to the download route, ensuring consistency of the context
across calls.

closes odoo/odoo#126963

Related: odoo/enterprise#43441
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-07-12 03:48:50 +02:00
Lucas Perais 26ea33bc64 [FIX] account: report invoice Rounding should be in a table row
Commit ee6e560415 probably forgot to wrap the
rounding data of the document_tax_totals_template in a table row `<tr />`

This commit corrects it

Part-of: odoo/odoo#126963
2023-07-12 03:48:49 +02:00
Lucas Perais 4d61085348 [FIX] web_editor: wysiwyg coherent API
Before this commit the function getContentEditableAreas passed in options
was not correctly called.

The OdooEditor which receives it too passes itself to it.

This commit corrects the call in Wysiwyg to that function and passes the odooEditor instance

Part-of: odoo/odoo#126963
2023-07-12 03:48:49 +02:00
Lucas Perais a38fd5eb2c [FIX] web_editor: html_field QWeb styling with specific class
Before this commit, whenever some nodes had some attributes similar
to QWeb (t-if, t-else, t-out etc....) the QWebPlugin's style applied.

This was unpractical when that style needed to be customized.

After this commit, the HtmlField add a class signaling that it should apply that style.

Part-of: odoo/odoo#126963
2023-07-12 03:48:49 +02:00
Lucas Perais 04b844550b [FIX] web_editor: wysiwyg color error resilient
When popping the color selector of the wysiwyg, sometimes the OdooEditor
returns an error code instead of a list of elements.
In that case, the code crashed as it expected a list (implicitly, by calling Array methods)

This commit accounts for that and tests whether the return is an Array.

Part-of: odoo/odoo#126963
2023-07-12 03:48:49 +02:00
Lucas Perais 958209f7c7 [REF] web: SelectMenu: a subtemplate for items
Before this commit, it was not possible to customize the way an item
in the selectMenu was displayed.

After this commit, with the help of a subtemplate, it is now possible
to subclass the SelectMenu and customize how an item is displayed

Part-of: odoo/odoo#126963
2023-07-12 03:48:48 +02:00
Lucas Perais 1e5c256294 [FIX] web: CodeEditor: resource-specific session
The new CodeEditor dismissed the notion of ace EditSession.
This serves to split the ace internals (history, values etc...) according
to the logical unit of a session.

After this commit, from the CodeEditor point of view for each edited resource (a view mostly)
corresponds one session.

Part-of: odoo/odoo#126963
2023-07-12 03:48:48 +02:00
Lucas Perais 49ae7f4d47 [IMP] web: ConfirmationDialog can take a confirmClass props
Before this commit, the confirm button of the confirmation dialog
was always btn-primary.

After this commit, it can take a props to modify that.

Part-of: odoo/odoo#126963
2023-07-12 03:48:48 +02:00
Martin Trigaux 884a56c239 [FIX] test_access_rights: adapt tests
Make the user be in at least one of the group employee, public or
portal to be more coherent with Odoo

closes odoo/odoo#125216

Related: odoo/enterprise#42628
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-07-11 22:33:47 +02:00
Xavier Morel ce1a4a2ee0 [IMP] base: deprecate global rules
ir.model.access rules without group will now log a warning

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Martin Trigaux c68fa610d4 [FIX] *: correctly search record without user
If a user is not present in the request, he is in no group at all and
can not access any model, including the one available for public
users.
Avoid ambiguity by using sudo or add a user specifically.

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Martin Trigaux cd2f330bec [IMP] *: remove glocal ACL
Specify explicit route for each ,, line
This is part of task 3230280 where global ir.model.access will be
forbidden.
The goal is to make access to public/portal explicit. Too often,
global access was granted with only employees in mind.

Remove ,,0,0,0,0 lines

mail:
employee already had read access to mail.group
still needed to subtypes as in ir.rule domain

mail_group: employee already had read access
pos_mercury: only needed for employees

membership:
move public access for website_membership as needed in the controllers

website_customer: employee already had read access

website_event_booth: no need for category
website_event_exhibitor: retrieved in sudo
website_event_track: not needed for location

Part-of: odoo/odoo#125216
2023-07-11 22:33:47 +02:00
Benjamin Vray b043f0671a [IMP] website: target popup as a link
This commit introduces a new feature to the popup snippet.
Up until now, the popup could be displayed after a delay or on exit.
This commit enables the popup to be displayed on click.

To make use of this feature, the user will need to:

- Set the "Display" option of the popup to "On Click (via link)".
- Paste the anchor that has been copied to the clipboard into the
URL input of any link.

This commit also adds a test for this new feature.

task-2172312

closes odoo/odoo#76442

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-07-11 22:33:36 +02:00
Ivàn Todorovich 858943c47d [IMP] *: remove deprecated use of mail widgets
They have been removed in 3fea5b213, these must be left overs.
They don't really do any harm besides providing a bad example for devs.

closes odoo/odoo#127767

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-07-11 21:21:04 +02:00
Mahamadasif Ansari a1a243f984 [FIX] mrp: make receipts avaliable in mo overview when missing qty less than 1
"ValueError max() arg is an empty sequence" occurs when user try to
open the manufacturing overview. This is because the component
product on hand quantity is negative so it generate empty replenishments.

Step to produce:
1. install manufacturing
2. Go to Inventory > Configuration > setting
3. Enable storage locations in the warehouse > save
4. Create a product, e.g., "x"
5. Click on the Hands unit to update the product quantity.
6. Click New on Update Quantity.
7. Enter any negative value in the counted quantity (e.g., -50) > click apply
8. Go to Manufacturing > Click New
9. Select any product (e.g., "A") for manufactoring
10. Add "x" in component product > enter 0.0 in To consume > save
11. Click on Overview (smart button)> Error occur

This commit solves the above issue by making receipts available in the
Manufacturing Overview report when the missing quantity in a
manufacturing order is less than 1.

sentry-4110696764

closes odoo/odoo#127629

X-original-commit: 27697fd6f9b601714b0aef9884eaadca963f32f1
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
2023-07-11 21:20:58 +02:00
mky-odoo 3083402d32 [FIX] point_of_sale: allow classic users to load demo products
While click on add demo data wizard button it will generate trackback.

Steps to Produce:-
- Create database without demo data.
- Login as Admin.
- Install 'point of sale' module.
- Delete all product
- Create New User and give user access to 'point of sale'.
- Login with new created user.
- Go to 'Point of Sale' module.
- Open new session
- Click on Generate Demo Data >> Error occur

Error: A traceback appears: AccessError: You are not allowed to create
'Point of Sale Category' (pos.category) records.

This commit solves the above issue by allowing the creation of demo
data on POS for users, which has User rights.

sentry-4245391993

closes odoo/odoo#127263

X-original-commit: a8f5343f5b83f6eb069f9d1e542fc1e14fbedfcb
Signed-off-by: David Monnom (moda) <moda@odoo.com>
2023-07-11 21:20:45 +02:00
Kevin Baptiste 427d31766d [IMP] hr, hr_contract: show fields to employee manager
Adds a mechanism to have some fields available to the employee manager
on the public employee profile.

Here `first_contract_date` is available for the employee manager.

task-2882052

closes odoo/odoo#124640

Related: odoo/enterprise#42362
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
2023-07-11 18:03:18 +02:00
Leonardo Pavan Rocha 79d4a829e5 [IMP] web: many2many_tags_field allow passing noViewAll to Many2XAutocomplete
In sign, we don't want to show the view all option when choosing sign options
for a sign item in a template. This commit adds the noViewAll prop to the
many2many_tags_field component.

task-3233643

closes odoo/odoo#122157

Related: odoo/enterprise#39787
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-07-11 18:03:10 +02:00
Aaron Bohy b553163b4e [FIX] web: fix clickbot to enter studio
Since [1], the DOM of the studio icon has changed, and no longer
matches the selector of the clickbot menu. As a consequence, it
no longer entered Studio. This commit fixes the selector.

[1] odoo/enterprise#9da0c9fab6c066aa97bc8cb99eb0e54b5a76a08f

closes odoo/odoo#128040

X-original-commit: aba563c58ec890bbf33d4a7d3cc34e9b2a4012a0
Related: odoo/enterprise#43910
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-07-11 12:00:49 +02:00