Commit Graph
162001 Commits
Author SHA1 Message Date
Antoine Guenet c33ecdf27c [FIX] web_editor: prevent undefined class/style
The `_wrap` util function of `convert_inline` was not checking if
`className` and `style` were defined before adding them to the wrapper
element, leading to things like `<div class="undefined">element</div>`.

X-original-commit: 9fd6e069d07c3f7964511af7289d95c970d11b3e
Part-of: odoo/odoo#124465
2023-06-09 17:01:43 +02:00
Antoine Guenet 6b2a18be8a [FIX] mass_mailing: ensure mails don't get distorted with DPI scaling
This ensure the layouts of emails don't get distorted in Outlook when
the user is using DPI scaling (typically, some elements get scaled up
while others don't).

X-original-commit: 2348efb6e22544d82ce53d542975f334d5553f62
Part-of: odoo/odoo#124465
2023-06-09 17:01:42 +02:00
Antoine Guenet ec4006549c [FIX] web_editor: ensure no sibling tables for Firefox
Firefox doesn't seem to do well with sibling tables, so we need to
wrap them each in separate rows.

X-original-commit: 625a6545ee9e64a90e36b676c5b7b9a3c8d42418
Part-of: odoo/odoo#124465
2023-06-09 17:01:42 +02:00
Antoine Guenet 2b7ba8151a [FIX] web_editor: properly handle Bootstrap's rows' negative margins
Bootstrap rows have negative left and right margins, which are not
supported by GMail and Outlook. Sometimes we use padding on columns to
undo the negative margins of their child rows. This corrects these.

X-original-commit: dc7c7330b4b7a1c17c3b736aa60c21882a455a31
Part-of: odoo/odoo#124465
2023-06-09 17:01:41 +02:00
Antoine Guenet 18b172e821 [FIX] web_editor: properly inline and inherit body line-height from var
Before this commit, the line-height of the body was not properly
inherited where it should. It is defined as a CSS variable and its value
was incorrectly retrieved (if the value is 1.5 and the font-size is
10px, `getComputedStyle` returns 15px instead of 1.5). Other properties
related to fonts were likewise improperly inherited.

X-original-commit: 12ae698bd9aff8466d69819e0b849752f967c126
Part-of: odoo/odoo#124465
2023-06-09 17:01:41 +02:00
Antoine Guenet a61d9f3c26 [FIX] web_editor: fix alignment issues
This addresses a series of alignment issues in the conversion of html.

X-original-commit: 5b5a0030f8cd75f0a977d7804b54dc454a6a8751
Part-of: odoo/odoo#124465
2023-06-09 17:01:40 +02:00
Antoine Guenet 337c859ba2 [FIX] web_editor, mass_mailing: properly handle (responsive) images
This addresses a series of issues regarding images, their responsive
behavior and their alignment.

opw-3244705
opw-3185231

X-original-commit: e20bc14e8860ce8f84eb5b0006ec67b708530161
Part-of: odoo/odoo#124465
2023-06-09 17:01:40 +02:00
Antoine Guenet 3bfccb19b1 [FIX] mass_mailing: ensure base64 images in mso comments get converted
Base64 images get converted to attachments. However, if they are in a
mso comment, they were not converted.

X-original-commit: 2fa0694227a7beb6a000c2e8219fdd8c073cf348
Part-of: odoo/odoo#124465
2023-06-09 17:01:39 +02:00
Antoine Guenet 897c47a5ac [FIX] web_editor: convert background-images without flattening them
Prior to this fix, elements with background images were converted to
images via the html2canvas library. This made them work in Outlook at
the cost of several tradeoffs:
- the process was slow and asynchronous
- there could be no interactivity (links, buttons, etc.) in the
  converted element
- responsive behavior was wonky: if only a slice of the image was shown
  when it was converted (due to background-size cover behavior), the
  rest was lost so if more width was needed in mobile, we would be
  zooming on that slice, making it sometimes irrelevant and pixelated
This replaces all that with a conversion to VML, which is a vector
format supported by Outlook. This conversion is done only for Outlook,
which means that all other clients are getting the original background
element again.

There is a way to keep the background-size cover behavior in VML, using
the "aspect" attribute with value "atleast" but this only works on
v-fill elements and sadly putting the image on a v-fill element bugs in
Windows Mail (which is the default mail client on Windows 10 and 11) and
this client can't be singled out of mso conditionals. To get around this
issue, since this is only for desktop clients, we assume the width of
the screen to be large and mimick the cover behavior by cropping the
image to the target size. This allows us to put the image on the v-image
element and have proper rendering in Outlook and Windows Mail on
desktop.

Note:

When retrieving the image by URL in Python in order to crop it, we need
to ensure we have an absolute path. This is done - perhaps seemingly
naively - by checking if the URL contains '//'. Here's the reasoning
behind that choice. To check if a URL is absolute, we could use
`urllib.parse.urlparse` and check if it has a scheme but that would lead
to `www.odoo.com/path` being considered relative (and thus we'd add a
host to the URL even though there's already one). Instead, we could
check it it has a netloc but that would lead to the same issue since the
documentation of `urlparse` says:

> Following the syntax specifications in
[RFC 1808](https://datatracker.ietf.org/doc/html/rfc1808.html), urlparse
recognizes a netloc only if it is properly introduced by ‘//’.

Still, it would be more technically correct since `//some/path` would be
considered absolute (which it should be since it resolves to
`<current_scheme>//some/path`).

Base on that documentation, it seems that simply checking if the URL
contains '//' is pretty much equivalent to checking if it has a scheme,
with the double advantage that it's simpler and that it works for
`//some/path` as well. However, note that it doesn't solve the issue of
`www.odoo.com/path`.

In summary, here are the results with the current method:
```
http://www.odoo.com/path -> http://www.google.com/path // OK
some/path -> http://localhost:8069/some/path // OK
/some/path -> http://localhost:8069/some/path // OK
//some/path -> //some/path // OK
www.odoo.com/path -> http://localhost:8069/www.google.com/path // WRONG
```

X-original-commit: 9561ba31917024825705c876442139405e7a7957
Part-of: odoo/odoo#124465
2023-06-09 17:01:39 +02:00
Antoine Guenet 2361bc62e9 [FIX] web_editor: fix general column responsiveness issues
Several issues were found regarding the responsiveness of columns,
especially in the Masonry snippet. This implements a new, more robust
approach to responsiveness of columns, based on article [1], where each
column is wrapped inside a new table, itself wrapped in an inline-block
div element, and all adjacent wrapped columns are in turn wrapped in a
common table cell:

```html
<.container>
    <.row>
        <.col id="A">
        <.col id="B">
    </.row>
</.container>
```
becomes something like:
```html
<table>
    <tbody>
        <tr>
            <td>
                <div style="display: inline-block;">
                    <table>
                        <tbody>
                            <tr>
                                <td id="A">
                            </tr>
                        </tbody>
                    </table>
                </div>
                <div style="display: inline-block;">
                    <table>
                        <tbody>
                            <tr>
                                <td id="B">
                            </tr>
                        </tbody>
                    </table>
                </div>
            </td>
        </tr>
    </tbody>
</table>
```
with some additional attributes and styles to make it work.

[1]: https://www.litmus.com/blog/mobile-responsive-email-stacking/

task-3184107

X-original-commit: 3ddba4dbd57891c2d9fc80fb7aa0dd08338fe3f6
Part-of: odoo/odoo#124465
2023-06-09 17:01:38 +02:00
Antoine Guenet 453ee09648 [FIX] web_editor: properly convert complex masonry grids
Conversion of some masonry grids caused unexpected responsive behavior,
leading to a result that didn't match the edited design. This was caused
by a few separate issues:
1. Sometimes Masonry declares rows with a height of 100% but with
   columns that overfit the grid. In these cases, we split the rows into
   multiple rows but we failed to adapt their heights for them to be
   divided equally.
2. A call to `setProperty` failed silently, making it so the height was
   never set on certain rows.
3. When converting background images, we failed to remove their padding.
4. Bootstrap grid media queries were only inlined from the xl breakpoint
   and up, but the snippets typically use the lg breakpoint.
5. The "o_desktop_h100" class was not applied to the parents of
   `.o_desktop_h100` cells, making the rows too big for their cells in
   mobile.
6. A combination of the above made the conversion fail when the masonry
   snippet had a non-automatic height.

task-3184107

X-original-commit: 04d1c0caeb78ee3bedff579e229e5da47c2689ce
Part-of: odoo/odoo#124465
2023-06-09 17:01:38 +02:00
Antoine Guenet 0a61a82841 [REF] web_editor: centralize mso comment creation
This adds two util functions, to create mso and !mso comments (which can
be error-prone).

X-original-commit: e258a28aa147db97eab1d3dc5db3595adf91541c
Part-of: odoo/odoo#124465
2023-06-09 17:01:37 +02:00
Antoine Guenet c195682ca9 [FIX] web_editor: fix mso conditionals
This addresses a series of issues with mso conditionals that were not
closing in the right places.

X-original-commit: 247e05a9cca403fca3de01feb49d0f0374ea38de
Part-of: odoo/odoo#124465
2023-06-09 17:01:37 +02:00
aliya 64a0f84640 [IMP] account_peppol: add tests
account_peppol module currently doesn't have any tests.
This commit adds tests to test the participant,
sending and receiving peppol messages, peppol functionality in the
send and print wizard.

task-3321786

closes odoo/odoo#124436

Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-09 17:01:18 +02:00
Laurent Smet 688897cf10 [FIX] account*: Always send an invoice report using send & print
In case of error, the send & print wizard is crashing or log an error on the invoice chatter.
In that case, nothing is sent to the end-customer.
This is problematic for all flows in which we want to send a mail to the customer automatically.
For example, e-commerce with automatic invoicing or subscription/recurring invoices.

To avoid that, the current logic of the send & print has been reshaped. In case of error, a proforma
PDF is sent instead. This is exactly the same document as the PDF but without the legal layer.

To do that, a lot of refactoring has been necessary to always provide the cumulated data for invoices
to be able to access the generated proforma report and to allow the overrides to know exactly in which
mode the hooks are called.

Also, this commit renames the method by something less generic about invoices. Indeed, this wizard needs to be
usable for others documents than invoices. That's the purpose of the invoice_single/invoice_multi mode.
For that reason, all methods about invoices are now expricitely prefixed by 'invoice'.

Fix also a performance issue on multi-invoices since the invoice_pdf_report_id document was invalided for the
whole model instead of the current record. When dealing with X invoices, the whole model was invalidated X times.

Fix the managment of attachments:
- The manual attachments wasn't send when sending a mail 'invoice_single' mode.
- When changing to another mail template, the manual attachments were lost.

Fix the double generation of PDF using a web-service.
When opening again the send & print wizard, the PDF must not be regenerated but reloaded from the previous one.

Task: 3339352
X-original-commit: e9e90811aeee46989a83b21f9b59071a9c7bc362
Part-of: odoo/odoo#124436
2023-06-09 17:01:17 +02:00
Chrysanthe (chgo) d343f647d0 [FIX] web: unselect all list controller alignment
=== ISSUE ===

If you navigate to Project > Task > Gantt view > magnifying glass
and select some items, the arrow inside the `unselect all` component
is not aligned with the text.

This is due to the fact that the `.oi-large`
class uses a CSS variable called `--oi-vertical-align` which aligns the
icon a little bit under the middle.

=== AFTER ===

We add a `.align-text-bottom` class to the icon in order to align
the icon with its label.

task-3338235
part of task-332626

closes odoo/odoo#124433

X-original-commit: 0c33fcbd7ccad15179e9873cce04272cf0ec0b48
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2023-06-09 17:01:09 +02:00
25f43c2161 [FIX] web, *: cogMenu visual flaws
*: account, base_import, board, website

This PR enhances the "cog menu" by fixing several UX flaws.
Notable improvements include:
- Reordering entries in a more logical manner, enhancing user intuitiveness.
- Assigning icons to common actions for quick comprehension.
- Grouping both print actions and module-specific actions for better organization.

Enterprise:
- https://github.com/odoo/enterprise/pull/41851

task-3337951
task-3355224 (milk post-merge fixes)
part of task-3326263

closes odoo/odoo#124413

X-original-commit: 596772885a87016d29f002cd4e41b5a973965e40
Related: odoo/enterprise#42212
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Co-authored-by: Brieuc-brd <brd@odoo.com>
Co-authored-by: Pierre Paridans <app@odoo.com>
Co-authored-by: stefanorigano (SRI) <sri@odoo.com>
2023-06-09 17:01:06 +02:00
Brieuc-brd 42f28ec012 [IMP] web: oi_icons, add "view", "archive" and "unarchive" icons.
task-3337951

X-original-commit: f1484bd88c2f22798fd5e692d99e84c88f63ae12
Part-of: odoo/odoo#124413
2023-06-09 17:01:05 +02:00
Aditya Sharma f79f2be85c [FIX] mail: preview of some documents were broken
How to reproduce the bug
========================
-> Try to preview some documents like (Employement Contract.pdf or Odoo CLA.pdf).
-> Preview is broken.

Technical
=========
"application/pdf;base64" mimetype was not included in the isPdf()  so the
method was returning the false value.

After this commit:
==================
Now the PDF containing this mimetype are previewable.

Task-3305415

closes odoo/odoo#124412

X-original-commit: 698d51fa56be47eb108cec299b12a3f6b58058b9
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-06-09 17:00:58 +02:00
Laurent Smet 2afd431756 [FIX] account: Fix removal of attachment when cancelling send & print wizard
- Create an invoice
- Send it using sent & print
- Re-open the wizard
- Click on 'Cancel'
=> The PDF has been deleted.

This is because we want to remove the attachments manually added by the user but the condition to do it is wrong.

closes odoo/odoo#124345

X-original-commit: 26e95e1eb906d6770016a80c39c79eb2be03c1f6
Signed-off-by: John Laterre (jol) <jol@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
2023-06-09 17:00:55 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre dacb31aa85 [REF] spreadsheet: use name service in DisplayNameRepository
We make the class DisplayNameRepository use the name service instead of
BatchEndpoint. This makes the code simpler and allow to avoid a lot of
rpcs (in some occasions) when fetching display names.

closes odoo/odoo#124090

Related: odoo/enterprise#42124
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:48 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre c41fb94946 [REF] spreadsheet: simplify DisplayNameRepository
The method getDisplayNameAsync being no more called, DisplayNameRepository
has no need to manage deferreds. We simplify it.

Part-of: odoo/odoo#124090
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:48 +02:00
Mathieu Duckerts-AntoineandLucas Lefevre f2edbb27f4 [IMP] web: name service
We define a new service "name". That service makes possible to load in
batch display names and maintains a cache. Some known display names
(fetched otherwise) can be added to the cache. The cache is cleared at
least each time the UI is updated via _updateUI (action service).

Part-of: odoo/odoo#124090
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Lucas Lefevre <lul@odoo.com>
2023-06-09 17:00:47 +02:00
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