Commit Graph
163215 Commits
Author SHA1 Message Date
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
luvi 0302e2f4df [IMP] web: add onInput props to SelectMenu
This commit adds the onInput props, allowing to run code from the parent
of the SelectMenu depending on the search value. This can be used in
situations where the list of choices must be dynamic. Also, whenever the
list of choices or groups is edited in length, the menu is filtered using
the newer values.

For example, choices can be generated from a fetch of items. Now, instead
of loading all items before instanciating a SelectMenu, a limit could be
set during the fetch, and another fetch can happen as the user type.

A test has been added to verify that the onInput props is called correctly,
and executes its code. In this test, the list of choices is edited, and we
assert that the newer elements are present in the menu.

closes odoo/odoo#124224

Signed-off-by: Bastien Fafchamps (bafa) <bafa@odoo.com>
2023-06-08 13:10:14 +02:00
vlst 9eb008dd77 [IMP] point_of_sale: Improve the flow of emailing gift cards
The process of emailing _gift cards_ bought from the Point of Sale is rather confusing.
This PR makes the experience more intuitive.

closes odoo/odoo#123222

Task: 2711714
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
2023-06-08 13:10:09 +02:00
Antoine Guenet 9aa5d76938 [FIX] web_editor: remove double "end of selection" character from test
One of the list tests had two "end of selection" characters in its
content before and after the step function. This made it unclear which
was relevant and which wasn't.

closes odoo/odoo#111119

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-08 13:10:03 +02:00
Antoine Guenet 508c77fa32 [REF] web_editor: remove sanitization of zws in favor of cleanForSave
Superfluous zero-width spaces were removed by the sanitizer and then
upon saving (`cleanForSave`). This commit removes the code dedicated to
that from the sanitizer in favor of the code in `cleanForSave` (adapted
to cover all cases).

Note: this means that with this commit, superfluous zero-width spaces
are not removed from the editor during edition anymore, but only when
saving.

task-3081457

Part-of: odoo/odoo#111119
2023-06-08 13:10:02 +02:00
Antoine Guenet 9d644624dd [FIX] web_editor: only clean ZWS in text nodes actually containing ZWS
When cleaning zero-width spaces (ZWS) in the editor, we were replacing
the node values of all text nodes descending from the node we were
cleaning, regardless of whether they contained a ZWS or not. This could
lead to wrong selections in the tests when arbitrarily changing the
value of a text node in the selection.

Part-of: odoo/odoo#111119
2023-06-08 13:10:02 +02:00
Antoine Guenet c270ba9e85 [REF] web_editor: refactor the sanitizer
This refactors the editor's sanitizer for clarity and efficiency.

task-3081457

Part-of: odoo/odoo#111119
2023-06-08 13:10:02 +02:00
Antoine Guenet 60b37a6fcf [REF] web_editor: turn Sanitize class into a function
The sanitizer was declared as class but was only used as a function.

task-3081457

Part-of: odoo/odoo#111119
2023-06-08 13:10:01 +02:00
Achraf (abz) 6ddcb44861 [FIX] base: Update non-stored field error logging to include exc details
We have many issues with this log, except that with a `logger.error` we
do not have exception information (exc_info).

As mentionned in the documentation above, we cannot use `logger.exception`
in this case because we are not within an exception handler.
However, we can still retrieve the exception information using `sys`
module and the `exc_info()` method.

https://docs.python.org/3/library/logging.html#logging.Logger.exception
```
exception(msg, *args, **kwargs)
  ...
  This method should only be called from an exception handler.
```

https://docs.python.org/3/library/sys.html#sys.exc_info
```
sys.exc_info()
This function returns the old-style representation of the handled exception.
...
If no exception is being handled anywhere on the stack, this function
return a tuple containing three None values.
...
```

closes odoo/odoo#124208

X-original-commit: b0844d2f3c0c9655746b4c16c9b612bae9954618
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2023-06-08 11:43:36 +02:00
Damien Bouvy 227e089efc [FIX] web: restore calendar navigation
Since the new 'milk' backend theme, we removed previous/next buttons in
the calendar view and made the mini-calendar the main control mechanism
for the calendar view: users were expected to discover that clicking on
a specific date in the mini-calendar would change the main display to
the period encompassing said date (e.g. if the calendar is in week moed
and I click on June 7th 2023, I would see the week of Jun 5-11)

As it happens, it is rather coutner-intuitive and users expect to find a
clearer control mechanism (and I don't blame them).

This commit re-introduces such controls in the sidebar, next to the
period selector.

closes odoo/odoo#123978

X-original-commit: 89897d0902c6e14bcd03fd9853f2fadbe7f348e3
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
2023-06-08 10:26:40 +02:00
Damien Bouvy 8dbba67cae [FIX] website: theme chooser UI
Some buttons got lost in the milk theme changes for theme formviews.

X-original-commit: 41eb91a81292ae9ac7a802e8f596ea468183c33f
Part-of: odoo/odoo#123978
2023-06-08 10:26:40 +02:00
Adnan Saiyed 8b90e6be45 [FIX] web_editor: in list heading does not indent by tab
Current behaviour before commit:

In list, heading element doesn't indent when pressing tab.

Desired behaviour after commit:

Now heading element gets indented using tab.

Task id- 3239958

closes odoo/odoo#123569

X-original-commit: e9b33cdb835d36329effa01e2d1045980ec288e9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-06-08 10:26:36 +02:00
luvi 2a1a388ffb [FIX] mail: clear groupBy from ActivityModel load
This commit fixes issues that could happen when a groupBy is present
in the load params from the ActivityModel. Before the rewrite of the
view to Owl, this code was present but was forgotten. This causes
crashes whenever web_search_read is then called, leading to undefined
record in the template, and crashing the view.

Now, the groupBy param (if present) is replaced by an empty array.

A test has been added to verify that during the load, even if the
ActivityModel has received a groupBy in its load parameters.

closes odoo/odoo#124215

X-original-commit: b6fa8ec174f5467baaed32b0c12acd0224757281
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
2023-06-08 09:10:04 +02:00
Mohamed Lamine LALMI 23da6c637f [CLA] mohamedlaminelalmi.md: Sign CLA
This commit adds the signature for mohamedlaminelalmi.md, indicating
that the Contributor License Agreement (CLA) has been signed.

closes odoo/odoo#124211

X-original-commit: bd2082c07f6605a4b991e577aae5249010ff0ccc
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-06-08 09:10:01 +02:00