Commit Graph
161978 Commits
Author SHA1 Message Date
John Laterre (jol) c8bd18ff80 [IMP] account: introduce new grouping threshod field on reports
Since these commits:
- https://github.com/odoo/enterprise/commit/d6e771f1f9ab4440e47188ea24c2fc80f58c2919
- https://github.com/odoo/enterprise/commit/51bc88bdec323035c5d1949a8ab76e2c032b26f2

Several reports were using a config parameter to define
a threshold used to group report lines.

The goal here is to replace this parameter by a new
`prefix_groups_threshold` field on `account.report`.

task-3330099

closes odoo/odoo#122138

Related: odoo/upgrade#4694
Related: odoo/enterprise#41362
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-06-09 17:00:30 +02:00
Chintan Panchal (can) 5872f9c678 [FIX] website: restore website systray action color
Before this commit, the Product (backend link) is not readable to the community
and in the enterprise, it's not matching with the rest other backend links
(blueish) (e.g. New) due to the default text color. Same way TRANSLATE button
have visual glitch for community and enterprise.

After this commit, the backend link is readable for the community and matches
with others in the enterprise version by using `$o-navbar-entry-color`

task-3346020

closes odoo/odoo#124455

X-original-commit: 154be2e2f673c039e62e148e7b2c05304af6b568
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-06-09 15:05:52 +02:00
Saurabh Choraria 1a1011d78e [FIX] base,website_sale,gamification: prevent quick create of new field
When user tries to quick create a field where model is not specified, the error
will occur.

Steps to reproduce:
1. Turn on developer mode.
2. Go to Settings > Technical > Fields Selection.
3. Create a new record and quick create a field.

Traceback will be generated.

Applying this commit will fix this issue.

sentry-3956146718

closes odoo/odoo#124442

X-original-commit: 9e64211eb4398b25c57d73bc5a92eda88d314bd1
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 13:50:14 +02:00
Maximilien (malb) 96f22bd8f0 [FIX] web: company details
In Odoo editor when a html field is empty, we add en empty <br> inside the <p>.
This change broke all if statement checking that company details is empty.

In this commit, we add a function is_empty_company_details that return True if
the company details field contains only a <br> and False otherwise. With this
method, we can check that company details is empty and displaying other thing
that just an empty line break.

closes odoo/odoo#124440

Task-id: 3168705
X-original-commit: 2aaca9afb6c54be3ef87ea38646af90a2599aa6b
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Maximilien La Barre (malb) <malb@odoo.com>
2023-06-09 13:50:08 +02:00
Maximilien (malb) 7833e01255 [IMP] web: invoice layout
Before this PR, when multi vat was activated and a foreign vat number was set on
 a fiscal position it was not printed on the invoice for the following layout:
 Striped, light and boxed. The Bold layout is not impacted since it does not use
 company details.

 This PR adds the foreign vat on the invoice when it's necessary.

Task-id: 3248767
X-original-commit: 181bd158d149530d085b6da7e1c5ca3003f36bd3
Part-of: odoo/odoo#124440
2023-06-09 13:50:08 +02:00
Bruno Boi 8d1700c3af [FIX] web: fix sub-dropdown alignment
Since [1], the sub-dropdowns are misaligned as soon as the user
interacts with them.

**Before this commit**
![before]

**After this commit**
![after]

[1]: e6bdce9025fb106bc9dd7bc99c67be4df6365f22
[before]: https://github.com/odoo/odoo/assets/1159815/a293ebe1-30cc-4397-9e17-c0813846922b
[after]: https://github.com/odoo/odoo/assets/1159815/7a151e51-a4e5-45e0-a1bf-61e89ae8aabb

closes odoo/odoo#124439

X-original-commit: 2f5055861f46cce77ae8687f546aff68ff262366
Signed-off-by: Michaël Mattiello (mcm) <mcm@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-06-09 13:50:04 +02:00
Bruno Boi 3006be6184 [FIX] web: fix undeterministically failing test
Recent commit [1] introduce a test that fails undeterministically.

It was waiting for the jSignature lib to commit its changes before
making some assertions, but it was not waiting to the lib user's
component to render.

[1]: 0a4bc245a

fixes runbot error 21803

closes odoo/odoo#124438

X-original-commit: 8006bb2c435def4aaa656194d26a987fc5c3c4d9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
2023-06-09 13:50:01 +02:00
Renaud Thiry f86f55f1ef [IMP] crm: ask for loss reason in leads too
In odoo/odoo#118494 we made it possible to set a loss reason on a lead
from the list view action.

However this did not update the behavior of the form view button.

As we remove the 'set reason' suggestion in this PR (odoo/odoo#124103)
It makes sense to update the form action to behave
the same way as the list view one.

task-3356095

closes odoo/odoo#124437

X-original-commit: 4a2534c8eda1b005e1a09a389fc77dcf7b3547fa
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
2023-06-09 13:49:57 +02:00
Renaud Thiry 629666c489 [IMP] crm: remove loss reason toggle
To set the lost reason you currently need to toggle a field
in the wizard if you are marking a lead as lost.

As the loss reason isn't technically necessary, we can just let users
choose whether to input anything or not without having to click anything

We also introduce groups so field strings are displayed.
As the first field cannot easily be implied
to be the loss reason anymore.

task-3356095

X-original-commit: b5181ea609f798e09e2032fe182e01fd07d1c10e
Part-of: odoo/odoo#124437
2023-06-09 13:49:57 +02:00
Mahamadasif Ansari cfc7df15a7 [FIX] point_of_sale: prevent ValueError when tip product is deleted
"ValueError: No record found for unique ID point_of_sale.product_product_tip.
It may have been deleted." is generated when user delete 'Tips' from the product
and try to enable tip payment from the POS setting.

Step to produce:
1. Install point_of_sale
2. Open product and delete 'Tips' product
3. Open POS > Configure > Setting
4. Enable Tips in payment > select any product in tip product
5. click save >>> Traceback generated

This commit solves the above issue by passing 'raise_if_not_found=False'
to ensure it does not throw an error when the tip product is not found.

sentry-4232555961

closes odoo/odoo#124435

X-original-commit: b3675accd7d4ddfe97712060cda1259cf0b131f6
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
2023-06-09 13:49:53 +02:00
Chrysanthe (chgo) 83b138c165 [FIX] account: search panel size
=== ISSUE ===

If you navigate to Accounting > Accounting > Journal items and click on
an item in the sidebar, there is an issue with longer number
being hidden by the sidebar. This is mostly due to the fact that
the font-size is now 14px instead of 13.

=== AFTER ===

We simply move the panel width from 50px to 54px. This is calculated
based on the width of `.o_search_panel_category_value`
with a `.o_treeEntry` class (41.12px) + the 6px `padding`
from `.o_search_panel` with a `.account_root` class, so 42px + 12px.

task-3354841
part of task-3326263

closes odoo/odoo#124434

X-original-commit: 3981dc3054dbf47b01825bf9d1fc229dce6dfba7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-09 13:49:50 +02:00
Alex Guardado 432cb478ff [CLA] signature for flalexg
closes odoo/odoo#124417

X-original-commit: cbe17436610c5c7dea2b4b0006511d17628b6523
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2023-06-09 13:49:47 +02:00
Achraf (abz) ff9da0e9e2 [FIX] base: Add exception info to logger.error
This commit includes the exception
details when logging an error in the registry module.
By importing the sys module and using the exc_info() method,
the commit ensures that the complete exception information is captured
by Sentry.

This modification improves the error reporting functionality
by providing more comprehensive information about the encountered
exceptions. This will aid in debugging and diagnosing issues,
enabling faster resolution of potential problems.

closes odoo/odoo#124318

X-original-commit: 55118b726bcd2532d2a7e67322eccb1ea6b75b7f
Signed-off-by: Achraf Ben Azzouz (abz) <abz@odoo.com>
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2023-06-09 13:49:43 +02:00
snd c57f9efe83 [IMP] stock, stock_repair: various features
add the following features:
- add location in form , kanban and list view. Change location creates move
- add smart button for repairs
- add next activity widget in list and kanban
- from the lots/SN smartbutton on the product form, open the kanban view
- show the last delivery partner on serial

closes odoo/odoo#117316

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-06-09 13:49:40 +02:00
snd 0beb6608c2 [IMP] stock: add properties to lot/serial
Lots and serials are currently only differentiated by their number and potentially expiry dates. In many industries, they choose their lot/serial based on many data.

For instance on Iron lots in the metal industry there are multiple properties helping to define the quality. This also happen in the second-hand industry and many others.

added:
- properties field on stock.lot
- properties field on stock.quant, related to stock.lot
- kanban view on stock.lot
- search on properties in stock.lot and stock.quant list views

task 3061173

Part-of: odoo/odoo#117316
2023-06-09 13:49:39 +02:00
vlst 517d21dda5 [FIX] point_of_sale: add the enterprise flag to the preparation display setting
The `Preparation Display` is only available in the `enterprise` version, but it's setting does not reflect that

This means that in community, one sees the option to enable the `Preparation Display`, without any sort of feedback as to why the optiondoes not actually work.

This PR adds the `enterprise` flag next to the name of the option. Now, when a user of the `community` version tries to enable the option, they are greeted with a popup that explains the situation.

closes odoo/odoo#124178

Task: 3349726
X-original-commit: b57b64158ab3c64f581ed643b0617ffac98bceee
Signed-off-by: Monnom David (moda) <moda@odoo.com>
Signed-off-by: Vlad Stroia (vlst) <vlst@odoo.com>
2023-06-09 12:21:53 +02:00
Touati Djamel (otd) 2922b05ea2 [FIX] mrp: access BoM overview with dynamic variants
Steps to reproduce the bug:
- Create an attribute with "Variant Creation Mode" = Dynamically
- In a product template, add the attributes and some values
- Create a new BoM for this product
- Click on "Overview" smart button

Problem:
Traceback is triggered, because the `_match_all_variant_values` function
is called but without the product, while it takes at least one:

https://github.com/odoo/odoo/blob/7b7f65d5047731978d2d8bcbd8d77cfa86ac1d53/addons/mrp/models/mrp_routing.py#L95

https://github.com/odoo/odoo/blob/7b7f65d5047731978d2d8bcbd8d77cfa86ac1d53/addons/mrp/models/product.py#L209

As the variant creation mode is set to “dynamically”, we can skip the
get of operation line.

opw-3332902
opw-3329263

closes odoo/odoo#124015

X-original-commit: d8d312280aa041d5beee437c8192cb63050bfc40
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2023-06-09 12:21:50 +02:00
Ali Alfie (alal) 10d0805c94 [IMP] hr_expense: include paid by company expenses in status bar
Before: in the "My Expenses" statusbar, only expenses paid by the employee were shown.

Now: for the "to submit" and the "under validation" states, we show expenses paid by the employee AND the company. For the "to be reimbursed" state, we ONLY show expenses paid by the company.

task-3319115

closes odoo/odoo#121627

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-06-09 12:21:47 +02:00
Chrysanthe (chgo) 7aab866654 [FIX] hr_holidays: display option layout
=== ISSUE ===

If you navigate to Time Off > Configuration > Time Off Types and open a
type, the layout of the display option is not consistent.

The option should be displayed under the title and not next to it.

=== AFTER ===

We remove the empty `group` tag and add the `string` attribute to the
second one, in order to fix he layout.

task-3332666
part of task-3326263

closes odoo/odoo#124403

X-original-commit: cdd41cef07cb82b37e7c09b8f4a622ac7dde81a3
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-09 10:55:05 +02:00
Renaud Thiry ef37dce5fa [FIX] web_editor: _blank href for readonlyIframe
The "readonly iframe" mode of html_editor does not do
the processing required to ensure all links target a new tab when
the setup is called more than once.

As this happens often, links effectively did not redirect to a new tab.

Additionally sandboxedIframe did not allow new tabs to open.
We add `allow-popups` and `allow-popups-to-escape-sandbox`
to the sandbox attributes.

This is safe as the popup will not have access to the odoo window.
Which should mean it's as safe as opening a link without the sandbox.

opw-3337670

closes odoo/odoo#124395

X-original-commit: 61b6b6bf6181fe703cd3d455dba9004e1fad7135
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Thiry Renaud (reth) <reth@odoo.com>
2023-06-09 10:55:02 +02:00
Daniel Kosky (dako) c007449230 [FIX] l10n_ie: standard vat on EU purchases
A rate of 17.5 is wrong for standard rate purchases in Ireland.
The standard Sale and purchase VAT have an amount of 23.

closes odoo/odoo#124386

X-original-commit: 2b5a9fc5c9ae9f9492ccd03f993c1e2d514f6aa7
Signed-off-by: William André (wan) <wan@odoo.com>
2023-06-09 10:54:59 +02:00
uso-odoo 4ce3588b20 [FIX] point_of_sale: prevent traceback when value of line.discount is 100
When the value line.discount = 100 in 'get_total_discount' method, the traceback
is generated. The main reason is because of 'BODMAS Rule - Bracket, Order,
Division, Multiplication, Addition, and Subtraction

Steps To Produce:-
1. Install point_of_sale module
2. Go to Point Of Sale Configuration
3. Make 'Line Discounts' True and save it
4. Create New Storable Product, ordered quantity with 100 cost and sales price
    then remove taxes and Vendor Taxes
5. Open POS Session and select the newly created product
6. Apply discount = 100 % and validate payment and close the session
7. Go to Reporting > Sales Details, and add the date range based on the current
   pos order, click on the 'Print' button.

Traceback will be generated.

Applying these changes will resolve this issue.

sentry-4216418906

closes odoo/odoo#124364

X-original-commit: db81e242d250d244fa5ed87e0c05911a43ab32d4
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-09 10:54:56 +02:00
Chrysanthe (chgo) d5bf431aba [FIX] base_import: cp button spacing
=== ISSUE ===

If you go to PLM > click on a primary button > click on the cog >
import  records, the buttons have a `.m-1` which is added on top
of a `.gap-1`.This result in a double margin, which is not consistent
with other CP's behavior and affects the whole CP layout.

=== AFTER ===

We remove these unnecessary `.m-1`, making sure that no matter how many
buttons are shown they have a correct spacing.

task-3355375
part of task-3326263

closes odoo/odoo#124337

X-original-commit: 40666bfe89ff5bc9013fbb20928c18001b66c6ad
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-09 10:54:53 +02:00
Tiffany Chang (tic) bfbd3e56ff [FIX] product_expiry: make quant.expiration_date readonly
PR odoo/odoo#109511 added in a related expiration_date field linked to
its lot_id's expiration_date. This field was added as readonly=False,
which was a mistake due to the following issues it causes:

bug - the related dates (use_date, removal_date, alert_date) won't
      correctly update, this is easily fixable
bug - [mostly a nuisance, but will be confusing for users], if there are
      2 lines for the same lot (e.g. different locations) then updating
      the expiration_date for one line won't show in the other lines
      without a view refresh (could be fixed with custom JS, but not
      ideal)
bad UX - cluttered view of editable values
redundancy - the ability to edit the expiration_date is easily done by
             clicking on the lot name within the view or by opening the
             list view of the lots and batch editing dates

For stable we will make this field readonly. This field and
`removal_date` would ideally be removed since they would never be
different from the lot value, but both need to remain stored since they
are used for the removal_strategy_order and gathering non-expired
lots/SNs.

opw-3328901

closes odoo/odoo#123746

X-original-commit: d21d9259aef855c900169263db90873b736f3df6
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-09 10:54:50 +02:00
Theo VINCENT (thvi) ee792569f0 [IMP] point_of_sale, *: improve customer display
*: hw_drivers

Improvements:
 - Makes the display responsive to practically never have a horizontal scrollbar.
 - Automatically reconnect to the customer display popup if it's still open from a previous session, allowing the user to keep it open between sessions.
 - Adds a view when no order is selected (in the restaurant POS UI, when the user is in the floors and tables view for example), which is also opened before leaving the POS UI (closing session or clicking on the Backend button).
 - Adds an empty order title as the one displayed in the backend when there is no product.
 - Improves the display of payment lines to take benefit of all the available free space.
 - Shows customer notes and discount in the customer display.
 - Adds order line unit next to or under the quantity (so as not to lose horizontal space).
 - Adds a footer dedicated to the Odoo logo, always visible.
 - Adds an optional user-customizable background image displayed either on the right side of the customer display if it is in landscape orientation, or in the top header of the portrait orientation.
 - Adds a title bar "Your Order".
 - Removes the "Customer Screen" label in the POS session UI and moves the status message of this screen to a notification and the title of the button.

Fixes the local display of customer display for restaurants when the "Customer Screen" button is clicked from the main view (floor with tables) and not from the view of a table order.
Removes .pos-adv and .pos-js_no_ADV css properties that no longer seem to be used.

Thanks to Xavier (xlu) for the design ideas and mockups.

task-id: 2906039
Closes #106907

closes odoo/odoo#118721

Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-09 10:54:43 +02:00
niyasraphy 652acdeadc [IMP] base : add menu for res.city
closes odoo/odoo#106373

Signed-off-by: Rémy Voet <ryv@odoo.com>
2023-06-09 10:54:40 +02:00
smna-odoo db0d943b0f [FIX] stock: add SM without scheduled date
If a user adds a new SM to a picking without any scheduled date,
traceback will appear

To reproduce the issue:
1.  create a new picking and remove the scheduled_date.
2.  try to add a new storable product in move lines.

Error: A traceback appears: "TypeError: '>' not supported between
instances of 'datetime.datetime' and 'bool'"

On the picking form, the default SM date is the scheduled date of the
picking:
https://github.com/odoo/odoo/blob/2c3f53d5a0380e7de27977f56f20307ff2bccabf/addons/stock/views/stock_picking_views.xml#L358
Therefore, in the above use case, when triggering the onchange/compute
methods, the field `date` of the SM will not be defined. At some
point, we need to get the forecasted quantities of the SM product
(see the method updated by this commit) and, to do so, we compare
the SM date with `now`. Since this date is `False`, it will lead to the
above traceback

sentry-3979281197

closes odoo/odoo#124352

X-original-commit: e6179a5147a33dc53ce4ffbdace2585f13f18a14
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-06-09 09:35:02 +02:00
dasz 4a711f24a0 [FIX] hr_holidays: accrual plan in hours, leave and accrue again
An accrual plan configured to give hours will give to many hours after reaching the maximum for the level,
creating a leave and then accruing again, it will consider the maximum of time to add as days instead of hours,
so if the limit is 80 hours, then 8 are spent on 1 day of free time, the next time the plan accrues,
it will consider that the maximum it can give is 8 days instead of 8 hours.

task 3354892

closes odoo/odoo#124293

X-original-commit: 45f23d28a2136e87f1e55040371aff0ed8c4e305
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-06-09 09:34:59 +02:00
Aurélien Warnon e0257347a7 [IMP] website_slides[_survey]: hide email sharing if not available
This commit improves the various sharing templates to check if there is a
configured mail template before suggesting to share the course/slide by email.

Currently the user gets an error message suggesting to configure templates,
which is not ideal as the sharing feature can be used by everyone including
portal users, that have no idea what that means.

Task-3349606

closes odoo/odoo#123702

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 09:34:56 +02:00
Guillaume (gdi) 9562fba0ce [FIX] website, web_editor: prevent mixing navbar colors
This commit allows users to choose any color for their navbar when it is
over the content. With this commit, the user can choose the color he
wants for his navbar when it is scrolled and when it is not scrolled
without worrying about color mixing.

To simplify the explanation below, note that "Colors" option means the
Colors option of the header (just below the Template option) and the
"Background" option means the option below Header Position.

By following these steps:
- Drop some blocks in a the page (to be able to scroll)
- Set a light transparent red for the Colors option.
- Set the navbar position to "Over the content"
- With the Background option, set the background color to a dark color.

=> When you are at the top of the page, the color is the one of the
Background option. So far so good. Now when we scroll, the color of the
navbar is dark red. This is not what the user expects. The user should
be able to have any color he wants for the scrolled navbar. It's not the
case before this commit. He cannot have a dark transparent header on the
top of his page and a light transparent red when he scrolls. In this
configuration, the Colors option should set the color of the navbar once
the user has scrolled. The colors should not be mixed.

Technical explanation of the problem:
Background option applies the color on the header element and Colors
option sets the color on the nav element. The nav element is a child of
the header element.
So when the header has a color set by the Background option and nav has
a color set by the Colors option which has transparency, the color of
the header influences the color of the navbar when scrolling. This
commit allows to correct this.

This commit also fixes the same problem for the gradient option.

task-2904507

closes odoo/odoo#106281

Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
2023-06-09 08:23:09 +02:00
roen-odoo 31b8151736 [FIX] pos_stripe: fix stripe rounding issue
Current behavior:
When you setup a stripe payment terminal, there was a rounding issue.
If you sold a product for 1.10€ with a tax of 7%, the total amount
was 1.18€, but the amount sent to the stripe terminal was 1.17€.

Steps to reproduce:
- Setup the stripe payment terminal
- Create a product with a price of 1.10€ and a tax of 7%
- Create a POS order with this product, the total is 1.18€
- Pay the order with the stripe payment terminal, the amount sent to
  the terminal is 1.17€

opw-3298277

closes odoo/odoo#124372

X-original-commit: 356a6b089c020a9a83c8c7b65b588a50491c13a8
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2023-06-08 23:01:26 +02:00
Romain Estievenart 46992fa90f [FIX] board: display all data when force 1 column layout on small screen
Before this commit, on a dashboard having a multi-column layout, the
user couldn't see all those columns' actions when the layout fallback to
the "1 column" on a small screen.

This commit fixes it by, not only keeping the fallback to "1 column" to
optimize the screen's real-estate, but also properly bringing the hidden
columns' actions in the single column, so they become accessible by the
user.

Steps to reproduce:

- Create My dashboard on PC with two views set one next to the other
- Open My dashboard on mobile devices, and you see only the action
inside the column on the left and not the action inside the columns on
the right => bug

opw-3145706

closes odoo/odoo#124360

X-original-commit: fa1da53af1d327c4fafd944547dbf3c7312a93b4
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-06-08 23:01:23 +02:00
Pulinckx Pierre (PIPU) 911e2a5df9 [FIX] website,* : fix map on jquery arrays
Jquery find return an object instead of an array of element.
When you map on this object, the first callback element is
so the index and not the element. This commit fix wrong usages of
.map() used with Jquery.

closes odoo/odoo#124359

X-original-commit: b87dac213dcc8a197dc7c00245a392d1e4d86925
Signed-off-by: Géry Debongnie <ged@odoo.com>
2023-06-08 23:01:21 +02:00
niyasraphy 98cd8f90ad [IMP] product: hide all products label when no product is linked to tag
When no product is linked to a given tag there is no need to display
a void many2many. Indeed tags are configured mainly from products and
this field is used as a reminder of its usage.

closes odoo/odoo#124342

X-original-commit: 42ab359785fb38c098a524d03535c3aa6cca1173
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-08 21:52:49 +02:00
Sébastien Theys 9dba4e0d77 [REF] mail, *: reorganize JS files
Remove "fake" feature sub-folders that make files harder to find.

Note: If there are too many files in the main folder now, a new split
that actually makes sense can be done at a later time: this would not
just be code move, but removing coupling between said feature and the
rest of the code.

Apply consistent structure, where the top level folder is a feature (or
core), and sub-folders are subdivision of the feature depending on
context (closely related to assets bundles).

```
- core
    - common
    - public
    - web
- feature
    - common
    - public
    - web
```

The opportunity is taken to reorganize the top of the files and imports:
- Always use absolute path in imports to be able to find all usages of a
  file with a single search.
- Reorganize imports to group them by module, and to sort them
  alphabetically by path/feature.
- Always use single asterisk (*) for `odoo-module`: less characters yay!
  And double asterisk should be used for JSDoc comments, not for custom
  instructions.

Part of task-3265211

closes odoo/odoo#124168

Related: odoo/enterprise#42121
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-06-08 21:52:44 +02:00
Valeriya(vchu) 09583d1563 [IMP] product, website_sale: add chatter to pricelist
add chatter to product pricelist to improve collaboration. Track
currency, company, country groups, discount policy and website fields.

task-3316528

closes odoo/odoo#121244

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2023-06-08 19:15:17 +02:00
Valeriya(vchu) 167944cc93 [IMP] mail,*: support tracking x2many fields
X2many fields tracking was not supported in the implementation of
`mail` module:
* not needed in the past
* the logic was not hooked in the same place before.  Now that it is
managed pre-commit, x2many values don't have to be handled as commands,
but can be compared as records.
* ...

The support was added for two specific models in specific modules, but
it's a good opportunity to clean that and to support it directly in `mail`.

Task-3316528

Part-of: odoo/odoo#121244
2023-06-08 19:15:16 +02:00
Mahamadasif Ansari 7a4db8a51e [FIX] account: change logger type to 'warning' when upload corrupt pdf
'PdfReadError Could not read malformed PDF file' log error is generated
when user upload a corrupted PDF file in an invoice.

This commit changes the logger exception to a warning to avoid an
unnecessary error in the log.

sentry-4188965420

closes odoo/odoo#124290

X-original-commit: 834065aab5d62cacbbecb815428a25a37cae2291
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: ANSARI MAHAMADASIF (maan) <maan@odoo.com>
2023-06-08 17:40:32 +02:00
Yolann Sabaux 323bce4f89 [FIX] account: apply constraint only on add line strategy
This PR added a constraint https://github.com/odoo/odoo/pull/120892

This constraint should only be applied on `add_invoice_line` cash rounding strategy.

Initial opw-3185950

closes odoo/odoo#124289

X-original-commit: 02183ef878f8809032892338c41cc8816cab9669
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-06-08 17:40:29 +02:00
Adrien Schoffeniels 33ebfd68a0 [IMP] web: adapt draggable_hook_builder for new sortableList hook
Purpose:
--------
Knowledge's sidebar revamp introduces a new draggable hook "SortableList"
that is meant to replace the usage of jQuery's sortable widget and of the
NestedSortable library previously used for the sidebar.

To be able to build this hook using the `draggable_hook_builder`, some
changes have been introduced:

- Do not remove the height of the dragged element when computing its max
allowed height (so that the dragged element is below the cursor even when
the cursor is at the max allowed height, instead of being on top of the
lasts elements, obstructing the view)

- Allow to define mandatory params in the built hook's default params, so
that one does not have to define this mandatory param for each instance of
the hook (eg. SortableList is intended to only work with `li` elements)

Task-3074123

closes odoo/odoo#107490

Related: odoo/enterprise#34788
Related: odoo/upgrade#4118
Signed-off-by: David Beguin (dbe) <dbe@odoo.com>
2023-06-08 17:40:13 +02:00
Sébastien Geelen (sge) 8369ae63c5 [FIX] web_editor: never sanitize null element
The target for `this._pluginCall('sanitizeElement', ...)` should never be null.

As we provide the parent element of the initial target for optimal sanitization,
we can encounter some cases where the target element is not yet added in the DOM
and as such doesn't have a parent Element.

We add a verification to ensure sanitization doesn't generate error in those cases.

task-3356284

closes odoo/odoo#124287

X-original-commit: 1d9decd6b08eb2d093f0dcead73f3bb895be27ff
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
2023-06-08 16:10:38 +02:00
Habib (ayh) 5c43467c99 [IMP] account: component props
Many components did not define props, causing warning messages in the developer tools console.
This PR adds static props definitions to components where they are missing.

closes odoo/odoo#124275

X-original-commit: 2df195e6f3d86999442e1c6beeeb5c0c27fb7797
Related: odoo/enterprise#42167
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-08 16:10:29 +02:00
Lou (loha) 60e2fc966e [FIX] web_editor: fix infinite flicker on option button hover
Bootstrap tooltips are overlapping the parent box, it could cause an
infinite flicker in the web editor because the pointer goes over the
tooltip, disabling the tooltip, refocusing the parent, enabling the
tooltip, etc.

Since commit [1], the tooltips are centered differently, making this
worst because of a bigger overlap.

Steps to reproduce:
- drop a "Text" block
- select it
- hover the bottom border of the "50%" Height option
--> The tooltip flickers infinitely, along with the blue overlay on the
editor.

This commit fixes it by disabling the pointer events of the tooltip.

[1]: https://github.com/odoo/odoo/commit/09b720eff1a7

task-3299236

closes odoo/odoo#124262

X-original-commit: ec343728831c12eacdc6b3d031eb8d0b4b82ecdc
Signed-off-by: Soukéina Bojabza (sobo) <sobo@odoo.com>
2023-06-08 16:10:26 +02:00
Karnav Sojitra ad498a3b3b [FIX] mrp: create MO while location type is not in production
This issue occurs when the user tries to create a manufacturing order while the
location type of products is not in production.

steps to produce:
1. install mrp module
2. create a new company and switch to it
3. open inventory module > settings > enable storage locations >
save the changes > configuration > locations > virtual locations
4. now change the default location type from production to any other value
5. Try to create a manufacturing order and the error will be generated.

in mrp_production the location_by_company takes default 'usage' as production:
https://github.com/odoo/odoo/blob/012cfbf82717248631626cab73867fe0362cd59c/addons/mrp/models/mrp_production.py#L474-L477
Therefore, in above use case at time if triggering onchange/compute method, if
location type is not in production, location_by_company gets `Nonetype` which
will lead to above traceback.

sentry-4215242929

closes odoo/odoo#124261

X-original-commit: b07183fbfb938b67edb220f3b53f58053bde5aad
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-06-08 16:10:24 +02:00
Thomas Lefebvre (thle) 4132408f26 [FIX] sale_project: link subtask to sale order line of parent
Steps to reproduce:
-------------------
- create two product of type "service";
- field "Create on Order" is set to "Project & Task";
- create a Sale Order with these two products;
- condirm the Sale Order;

Two tasks are created in a project and each task has its own Sale Order Line Item.

- create a subtask from both tasks respectively;
- select a project for the subtask.

Issue:
------
The same Sale Order Line is selected for the two subtasks.
It always take the first Sale Order line.

Cause:
------
To choose the sale order line, we first look to see if
the subtask belongs to a project.
If so, we take the sale order line which created the project.
Unfortunately, a subtask can belong to a project created with
a sale order line without belonging to the same sale order line
(in the case where a task is added to a project via another product
and therefore another sale order line).

Solution:
---------
- A project without parent --> use project's sale order line
- A parent without project --> no sale order line defined
- A parent in the same project --> use parent's sale order line
- A parent in an other project --> use parent's sale order line

opw-3333936

closes odoo/odoo#124260

X-original-commit: 323d7f631916f5acc5ab34f8531ae59bb0455828
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
2023-06-08 16:10:21 +02:00
Om Rabara 491d22e1df [FIX] mrp: fix singleton error while multiple moves in 'move_finished_ids'
ValueError: Expected singleton: stock.move(32, 33)

This error occurs when we get the multiple lines of the same products in
'finish_moves' and after that when we try to mark as done at that time this
error occurs.

applying these changes will resolve this issue.

sentry-4217897073

closes odoo/odoo#124251

X-original-commit: 4933609bd6a8473272f6bb94a1de8aea5cdf6687
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-06-08 16:10:16 +02:00
Romeo Fragomeli 976491e012 [IMP] web,*: add accordion menu component
* = project,website

On the small screen, the sub dropdown is a bit weird to positioning, so
we use an accordion instead.
We apply this change also on desktop to avoid split behavior between
small screen and bigger screen and also to avoid duplicating code.

Also, we have made some DOM/CSS change:
* avoid reflow of the search bar menu by adding a min-width on the
  columns and a max-width on the input for custom groupbys and favorite
  filters
* re-align caret vertically for accordion indicators
* reword favorite edition items and add a tooltip
* all menu items have the class `o_menu_item`

closes odoo/odoo#122635

Note: DOM and some tests were adapted to reflect the change
Task-id: 3276542 (Part of)
Related: odoo/enterprise#41563
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-08 16:10:05 +02:00
Lucas Perais 1c1aaa883c [FIX] web: list: _view_ref and search_default should not be passed down
Have an action with *_view_ref and search_default_* context keys.
This action has a list view that itself has a many2many_tags field
(it is editable for simplicity's sake)

click on that many2many_tags field and click on the search more item.

Before this commit, the action's context keys *_view_ref and search_default_* were passed
down all the way to the field and to the search more dialog, causing, inevatibly, crashes.

After this commit, those keys are not passed and there are no crash.

opw-3226398

closes odoo/odoo#124252

X-original-commit: 47eab4d987d8cb91a30507c6c33348d1945698f1
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2023-06-08 14:32:43 +02:00
Robin Lejeune (role) 3749c03ceb [FIX] website: expand Facebook snippet URL validation
Some Facebook pages have a different URL pattern than what we currently
accept for the snippet. Namely:
- /profile.php?id=<id>
- /people/<name>/<id>
- /p/<name>-<id>

This commit adds these to the accepted patterns and adjusts the call to
the Facebook page plugins with the right format.

task-3147321

closes odoo/odoo#124250

X-original-commit: f3e82c3842f44aaf10cb1a56a90883b5f5338af1
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-06-08 14:32:40 +02:00
Samuel Degueldre fcdd2acc5a [REF] pos*: namespace component templates, remove useless super calls
pos*: l10n_ae_pos, l10n_co_pos, l10n_fr_pos_cert, l10n_in_pos,
point_of_sale, pos_discount, pos_epson_printer, pos_hr, pos_loyalty,
pos_mercury, pos_restaurant, pos_sale, pos_sale_product_configurator,
pos_six

Previously, none of the templates of the pos were namespaced, this means
that depending on context, you have to access them differently: in xpath
the module prefix is necessary even if the template name itself isn't
namespace, but in owl components you cannot use the namespaced version
because owl doesn't have the notion of modules.

This commit namespaces the component templates of all the pos modules so
that it's consistent with the rest of the code base. It also removes
some extraneous calls to super.setup() that were leftover and are not
necessary for components extending directly owl's base Component.

closes odoo/odoo#124069

Related: odoo/enterprise#42094
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-08 14:32:34 +02:00