Commit Graph
158912 Commits
Author SHA1 Message Date
Paolo Gatti (pgi) 774e2e26e4 [FIX] l10n_it_edi_sdicoop: fix EDI notification logic
In some cases, Odoo's move state is unaligned to that on the
IAP Proxy Server, because the ACK message from Odoo to IAP
deletes all attachments from the EDI transactions on the IAP
without regard if they are with type "Send" or "Receive".

We fix both cases by making Odoo just look at the state and not
to the attachment when it's not needed, and it's only needed when
there is a rejection of the document being sent.

We reserve for the future a change to the ACK to only delete the
attachments by transmission type (Send/Receive) so that they don't
interfere.

Error case 1:
- Odoo client sends an invoice to the IAP Proxy
- The IAP proxy will send it to the SdI
- If everything goes well, the SdI will send a notification back
- The IAP proxy sees the notification and saves it
- The Odoo of the client downloads the notification and sends an ack
- The IAP proxy sees the ack and deletes the attachment
- (ERR!) The client resets to draft, modifies and re-confirms
- The state of his invoice is set again To Send
- Odoo tries to re-send the invoice with the same Id Transaction
- The notification for that Id Transaction is already on the IAP proxy
- Odoo client asks for changes, but just sees the old notification
- (-->) The old notif. has no attachment, so Odoo thinks there's no news
- The move in Odoo stays in the To Send state forever

Error case 2:
- Odoo client sends a Tax Integration for a Vendor Bill (reverse charge)
- The IAP proxy will send it to the SdI
- If everything goes well, the SdI will send the same Vendor Bill back
  as the client's CodiceDestinatario is actually the recipient in the XML
- The IAP proxy sees the file, the Id Transaction is the same
  for both the received and the sent documents
- The SdI sends a notification because the tax integration is OK
- The IAP proxy saves the notification, there are now two EDI
  transactions with the same Id Transaction.
- Odoo checks for new documents
- IAP proxy sends the document to Odoo
- Odoo sends an ACK for that
- (ERR!) the IAP proxy sees the ACK and clears the attachment
  from BOTH the records for sent and received document
- Odoo checks for documents updates and gets the record without
  the attachment
- (-->) The notification has no attachment, so Odoo thinks there's no news
- The move in Odoo stays in the To Send state forever

Ticket link: https://www.odoo.com/web#id=3194378&model=project.task
opw-3194378

closes odoo/odoo#114051

X-original-commit: f85744ee4533ea8593b81a88ef200ec4dc1b1b94
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Paolo Gatti (pgi) <pgi@odoo.com>
2023-03-02 00:27:48 +01:00
Guillaume (guva) 9069d17794 [FIX] l10n_din5008: add shipping address in .pot
Add missing term "Shipping Adress"

opw-3198115

closes odoo/odoo#114023

X-original-commit: 50eafb5447fc28b31904f529116a90bffc3a4734
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-03-01 23:28:38 +01:00
Ahmad Khanalizadeh 3bd787a4bb [FIX] point_of_sale: prevent adding extra rounding line
Steps to reproduce:
1. Make a cash rounding method, make it specific to cash
2. Add a product line with non-rounded price
3. Enable invoice, and add a customer
4. Make a payment with a combination of cash and bank
5. Validate, an error appears that "the move is not balanced".

The issue is there is a rounding line added, that should be removed.
However, here `unlink` and `write` methods, trigger a dynamic sync
operation that re-generates the rounding line, making the move
unbalanced.

To fix the issue, we can prevent the sync operation, so that no extra
rounding lines are added.

opw-3180708

closes odoo/odoo#114020

X-original-commit: 3bd28525d9486e2f33b8d338c39675125fa22d7a
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
2023-03-01 23:28:35 +01:00
Kevin Baptiste 0f2e567ff3 [FIX] hr_holidays: show sum of closest allocations
In the time off dashboard, only the number of available days of the
first closest allocation to expire was shown, which is not correct.

If you have many allocations expiring on the same day, their sum should
be shown.

task-3203519

closes odoo/odoo#114010

X-original-commit: ff35654ae8c44014aab99ec07493f035e9a2d80d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-01 23:28:32 +01:00
Samuel Degueldre 7d451e2200 [FIX] point_of_sale: fix crash when switching to pos in new tab
In odoo/odoo#112219 the closePos method was moved to the pos store, but
one call site was improperly adapted and tried to call the closePos
method on the Chrome component instead of on the pos store, this commit
fixes that.

closes odoo/odoo#114009

Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2023-03-01 23:28:29 +01:00
Hansun (hale) fd30bdeffb [FIX] website_crm_partner_assign: foolproof translation for partner lvl
To reproduce the issue:
1. Add French as a language to your profile
2. Install [CRM], [Resellers] on Apps
3. On [Settings]>[Website]
- set the language to French then SAVE
4. Go to [CRM]
- click [Configuration]>[Partner Level]
- click Gold
- click [Go to Website] at the top right corner
- adjective and subject order is not natural for French speakers

Desired behavior: Remove the word 'Partner' (show level only)

Impacted versions: 14.0 up to master

opw-3160102

closes odoo/odoo#113999

X-original-commit: dd5446c66aba2a86ef331e7e832d44f0f22d7142
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-01 23:28:27 +01:00
xO-Tx 4de7f5f785 [FIX] website: open the right EditMenuDialog for content menus
To reproduce the issue:

- Go to website > In a website page with content menu (Event,...).
- Edit mode > Click on a menu item > Click on the "Edit Menu" on the
displayed link popover.
- A dialog to edit the menu appears, but this time it targets the main
website menu instead of the currently edited one.

Starting from [1], an OWL component `EditMenuDialog` is used to edit
website menus. It gets the targeted menu as a `rootID` prop value and
fallbacks to the current website main menu if this value is not
provided.

The goal of this commit is to target the right content menu by providing
the corresponding `rootID` value.

Remark: before [1], a different code was used to open the "Edit Menu"
dialogs and it was based on sending a `beforeReloadCallback` to the
`edit_menu` action (to save page updates once the menu edition is saved,
before finally reloading the page). Now, this callback is sent as a
`save` prop value to `EditMenuDialog`, which means the old callback is a
dead code => removed in this commit too.

[1]: https://github.com/odoo/odoo/commit/2c77b90eee4945d25e9d7f0ffe24484cf91b650a

task-3172234

closes odoo/odoo#113995

X-original-commit: 15deee2424434e9f520a8651b771627704a784a5
Signed-off-by: Arthur Detroux (ard) <ard@odoo.com>
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2023-03-01 23:28:24 +01:00
Dossogne Bertrand 13c575afde [IMP] hr{|_hourly_cost}: move employee currency field
This commit moves the currency_id field on the
employee model from hr_hourly_cost to hr in order
for it to be used in payroll localisations.

task-3029348

closes odoo/odoo#113992

X-original-commit: 60599b735568c1873fdfde85e667b05347432382
Related: odoo/enterprise#37661
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-03-01 23:28:18 +01:00
MerlinGuillaume d1d3992dc0 [FIX] web: add Mongolian moment locale
An error is raised when trying to render date picker with the Mongolian
locale

Steps to reproduce:
1. Install Sales
2. Install and switch to Mongolian language
3. Open Sales and create a new quotation
4. An error is raised: `locale() locale mn-MN is not loaded from moment
   locales!`

Solution:
Add the Mongolian locale. It is not present in the version of Moment.js
we use (2.19.3) so we get it from a newer version (2.29.2)

Problem:
The Mongolian locale was unintentionally removed in this PR
https://github.com/odoo/odoo/pull/111986 so we add it back

opw-3188184

closes odoo/odoo#113983

X-original-commit: 055c13af01c445c5e105d63ea3cd98e3ad2915a8
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-03-01 23:28:13 +01:00
Adrien Widart (awt) ff75b9d4f4 [FIX] purchase_stock: add POL to existing PO if draft
To reproduce the issue:
1. In Settings:
   - Days to Purchase: 10
2. Create two products P01, P02:
   - Storable
   - With the same seller
     - Delivery Lead Time: 1.0
3. On replenishment page, create a new line:
   - Product: P01
   - Min Qty: 1.0
4. Order once
   - a RfQ is created and the order deadline is in ten days
5. Time travel to the next day
6. Repeat steps 3-4 with P02

Error: a second RfQ has been generated. However, as the first one is
still in draft state, the POL of P02 should be added to that first RfQ

When processing the orderpoint of P02, at some point, we try to find
an existing RfQ with its order deadline equal to `today + 10 days`.
Since we are the next day (step 5), the order deadline of the first
RfQ is `today + 9 days`, so we don't find it.

OPW-3047931

closes odoo/odoo#113982

X-original-commit: 8bf7f9038915be520488b2602c20929ca115a033
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2023-03-01 23:28:10 +01:00
std-odoo 5d15afdb30 [FIX] google_gmail: remove the constraint on the from_filter
Bug
===
Remove the constraint on the from_filter for the Gmail outgoing mail
server, because it can be used for custom domain name, and we can allow
an email address to send as an other one.

E.G. if the user has an email address "admin@mycompany.com" and he
activated "all addresses from the domain", he would be able to set
- email: admin@mycompany.com
- from_filter: mycompany.com
to use the mail servers for all email addresses in the same domain.

Task-3169015
Ticket-3141747

closes odoo/odoo#113959

X-original-commit: e9426c8b7bd4eb3d5c2c1c89fcf6ee3bdef95b3b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-03-01 23:28:07 +01:00
momegahed e429addc1d [FIX] web: invoice preview is not rendered correctly
Steps to reproduce:

- go to any invoice
- click on Preview
- the lines after the invoice number are in separate rows

Bug:

here is bootstrap 4 implementation of `.col-3`
```
.col-3 {
  -ms-flex: 0 0 25%;
  flex: 0 0 25%;
  max-width: 25%;
}
```

and here is bootstrap 5 implementation:
```
.col-3 {
  flex: 0 0 auto;
  width: 25%;
}
```
we can notice that bootstrap 5 changed the way that the width is
applied to the flex object.

now in https://github.com/odoo/odoo/pull/51715

the width property is overridden for the class `.col-auto` which is
not useful in bootstrap 5 anymore anyway. This creates a problem with
elements that are both `col-auto` and `col-3` as the override from
`col-auto` misses with the new `col-3` implementation

Fix:
remove the override of `width`

OPW-3171131

closes odoo/odoo#113938

X-original-commit: b9d19643cbdfb58531f5bd7020f26c905df9c5b8
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>
2023-03-01 23:28:02 +01:00
Maruan Aguerdouh (magm) da6bf603ee [FIX] web: fix pie chart when no data and when negative and positive data is mixed
Steps to reproduce:

1. Install Dashboard & Inventory (enable multi-locations)
2. Make inventory adjustments to have a location with negative stock
3. Go to the dashboard app & click on “Inventory On Hands”.
4. An error shows up: TypeError: chart.dataSource.getData() is null

Issue:

If one of the locations have negative stock, the pie chart will not be
displayed and it will throw many errors, It has the same behavior If
every location have negative stock.

Solution:

Discussed with the PO, when we have positive and negative values, we
want to ignore the negative values and display the pie chart with the
positive values only. For this case, we modified `_prepareData` and
`_isValidData` methods so they check and filter the positive values in
case we have any. For the other case when we don't have any data, that
can be displayed in the pie chart, we added a way to don't get any error
and only display a blank pie chart.

opw-3103967

closes odoo/odoo#113794

X-original-commit: 3fdfc357097fc77cb998e8a6794efe1f9ffa53bb
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2023-03-01 23:27:58 +01:00
Martin Maes 0967efaa24 [FIX] delivery: pick up point delivery address not showing
Fixed the problem where the address of the delivery was not correct on
	- emails
	- order pdf
	- order confirmation page

The solution is to create a new partner of type delivery linked to the existing partner.
We first check if the partner exists based on the address to avoid creating an infinite number of res.partner

Fixed the problem where the non-logged user could not check the pick up locations

Remove the possibility to pay if no carriers are selected

closes odoo/odoo#105848

Related: odoo/upgrade#4124
Related: odoo/enterprise#33986
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-01 23:27:55 +01:00
Martin Maes cb1b5970a5 [IMP] delivery: Sendcloud and Fedex delivery points
The main goal of this commit is to add the possibility to use delivery/pick up points with the carrier Sendcloud.
The user can check the "Use Sendcloud Location" on the shipping method and choose the radius and radius unit to limit the distance between the address of the recipient and the pick up point.

As Fedex already had a similar feature and to prepare the pick up points implementation for future carriers, we factorized the existing Fedex code into the website_sale_delivery module.

The issue where it is impossible to select a pick up location when there is only carrier has also been fixed.

The factorization applies to :
	- /controllers/main:
				- set_access_point sets the address of the access point directly in the order
				- get_access_point retrieves the data set in set_access_point
				- get_close_locations calls the API of the carrier and returns the pick up locations obtained

	- /website_sale_delivery.js:
				- getCurrentLocation retrieves the location already set in the order and displays it
				- _onClickShowLocations displays a dropdown with all the pick up points available in the area
				- _displayCarrierDropper displays the button showing the dropdown
				- _onClickLocation sets the location in the order

Part-of: odoo/odoo#105848
2023-03-01 23:27:55 +01:00
Stanislas Gueniffey b100626de0 [FIX] web_editor: allow copy-pasting link target
The `target` attribute for a link specifies where that link should open
(for example, in a new tab). Previously, copy-pasting links in the
website editor (within text blocks for example) would remove the
`target` attribute. This implied loss of functionality.

This commit whitelists the `target` attribute to fix that behavior.

task-3184150

closes odoo/odoo#113908

X-original-commit: 1464752aca36198e5fed5dc8f5b5041244e6e4a9
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2023-03-01 22:35:53 +01:00
Stanislas Gueniffey 866ee94791 [FIX] web_editor: allow html if data-oe-type=html
The `isHtmlContentSupported` function incorrectly returned `false` for elements
inside `data-oe-type="html"` nodes even though those in fact do support html.

task-3184150

X-original-commit: 7d9a040fdefa527ace3150e39a03b833024b7973
Part-of: odoo/odoo#113908
2023-03-01 22:35:53 +01:00
qsm-odoo b20f120cab [FIX] web_editor: properly hide fa sizes buttons that should be hidden
Commit [1] added buttons with a `data-dependency` equal to "fake",
thinking it would hide those buttons automatically as the "fake" widget
would not exist. Somehow this got merged despite the fact that was not
working (testing probably focused on the more important things [1] was
fixing). At some point, using a fake dependency was hiding an element
but this changed one year earlier with [2].

This commit explicitly hides widgets with `data-dependency="fake"`.

[1]: https://github.com/odoo/odoo/commit/f59affcdfe9529645a02680214f3d7d96ebacf6e
[2]: https://github.com/odoo/odoo/commit/e927d1e89bc124002bb5e0b69dee711ea0d8147c

task-3208632

closes odoo/odoo#113936

X-original-commit: 7a46759a529b2d781585e0dbcb99bf7084c88007
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-01 20:55:02 +01:00
Romain Derie 1d309793d4 [FIX] website_blog: show search bar even if more than one blog
Commit [1] hid the blog navigation bar if there is only one blog.
It made sense as that navigation bar purpose is simply to select a
specific blog and not "all".

But commit [2] introduced a search bar in that blog navigation template
which was hidden if only one blog existed.
It does not make sense as the search targets blog posts which you still
want to be able to search even if you have a single blog.

This commit fixes that by moving the visibility condition from the whole
container (which includes both the search bar and the navigation bar) to
the navigation bar only.

[1]: https://github.com/odoo/odoo/commit/0a540e0ef25a439e29a762de5b35a2c6a63ad7f7#diff-6ed720c420b3e0591aeaf1c45061775765e1901d1592c46eb36b804c4c7c39f5R8
[2]: https://github.com/odoo/odoo/commit/ea009585e1d14041fe19f1e6e190b286e96c0681#diff-6ed720c420b3e0591aeaf1c45061775765e1901d1592c46eb36b804c4c7c39f5R24

closes odoo/odoo#113928

X-original-commit: 1e0bd3143623d89f504e67fb74e0f56b540530cc
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-01 20:54:59 +01:00
gawa-odoo 4fc16e94a7 [FIX] l10n_de{,_skr03,_skr04}: change tax report lines name and order
The regulation for the German tax report has changed.
We adapt it and its export to the regulation (that changed in Jan 2023)
The reference for this tax report comes from https://www.bundesfinanzministerium.de/Content/DE/Downloads/BMF_Schreiben/Steuerarten/Umsatzsteuer/2022-12-21-muster-der-vordrucke-im-umsatzsteuer-voranmeldungs-und-vorauszahlungsverfahren-fuer-das-kalenderjahr-2023.pdf?__blob=publicationFile&v=1
and from elster.de

We can see some lines are wrong.
Some categories are also not well-ordered.
Some indentation should be done better.
Some taxes had to change, as the report lines they were pointing to should not exist,
and the tax row had to be added
Some taxes should point to a tax report line when they were not.

A migration script has been added to transform the tag of the amls who have '+68'/'-68' to the same for '60'.
The reason being that this tag was used for the `account.sales.report`.

opw-2767535
opw-2974560
task-3082233

closes odoo/odoo#113864

X-original-commit: 5ef2970f6197b6e4353a96389f68e8ea29fb998c
Related: odoo/enterprise#37615
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
2023-03-01 18:43:01 +01:00
pedrambiria 1398ad0b0d [FIX] point_of_sale: allow to close order after validation before printing
Before this commit: if "Automatic Receipt Printing" is enabled in a PoS
restaurant, and a printer is configured, an error will raise if the user clicks
on "New Order" before the end of the printing process.

To reproduce the issue, I added a sleep at the beginning of the
`_printReceipt` of `AbstractReceiptScreen`, and clicked on "New Order"
immediately after validating the order.

The solution is to keep the `currentOrder` in a variable before printing.

opw-3096677

closes odoo/odoo#113820

X-original-commit: 37a5d8197ba13d91f40c0495e0e14fb2825c21d6
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
2023-03-01 18:42:56 +01:00
Andrew Gavgavian 41d458d91d [FIX] stock: correct reserved_qty inverse
Issue:
Since PR #80434, for versions 15.2 onward stock.move.line changed the
product_qty field to reserved_qty. When doing this change, the compute and
inverse function definitions were changed, but the inverse method on the field
was never corrected. This means that if something tries to write to reserved_qty
a traceback will occur:

AttributeError: 'stock.move.line' object has no attribute '_set_product_qty'

To recreate this error, make a write call on stock.move.line to reserved_qty
and you will get the traceback instead of the UserError.

Solution:

Change the field's definition to the correct function name (_set_reserved_qty)
leads to the proper UserError instead of a traceback.

opw-3204213

closes odoo/odoo#113812

X-original-commit: 5ac0568af2909864a2231309fa3e72397a581957
Signed-off-by: Tiffany Chang <tic@odoo.com>
2023-03-01 18:42:53 +01:00
yhu-odoo f00c2d364d [IMP] mrp: Set quantity in consumption warning
In consumption warning, we add a new button that can correct all
qty_done according to should_consumed_qty.

closes odoo/odoo#113538

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-03-01 17:01:17 +01:00
yhu-odoo 9c5e80fb32 [IMP] mrp: improve Produce All
Currently, if the user change qty_done on any raw moves without
changing qty_producing on the MO, it's not possible to validate the
order. In this commit, we make it possible to validate the order as an
immediate production.

When qty_producing is 0 and validate the MO:
1. manual consumption moves: current consumed qty will be kept when
process the MO.
2. non-manual consumption moves: For tracked components, if
use_auto_consume_compoents_lots checked, and there is enough products
reserved, the qty_done will be filled, otherwise, an error will be
raise to ask user to fill in lot/sn. For non-tracked components,
qty_done will be filled.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:17 +01:00
yhu-odoo ba7bf97444 [FIX] mrp: always no manual consumption when use_auto_consume_components_lots
When use_auto_consume_components_lots is on, it's always no manual
consumption on a MO even when the product is no tracked. Fix it

Part-of: odoo/odoo#113538
2023-03-01 17:01:17 +01:00
yhu-odoo 7fb27bd8b1 [IMP] mrp: untick manual consumption when remove operation_id
On the BOM, we add "Consumed in Operation" to a line, manual consumption
will be ticked automatically. In this commit, we make it that when
remove "Consumed in Operation" on a line, manual consumption will be
automatically unticked.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:17 +01:00
yhu-odoo 5bb0f96f19 [IMP] mrp: manual consumption improvement
Previously we set a component on MO to be manual consumption by comparing
the To Consume and Consumed, if they are not the same, we consider it a
manual consumption. Now if any input activity in the Consumed cell, we
will consider it a manual consumption.

Note that in the code, we make the css class change happended in the
list renderer instead of the field widget. We do that because we want to
change the background color of the whole cell not just the text of the
field.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:16 +01:00
yhu-odoo 439ba7d945 [FIX] mrp: show manual consumption when workorder not enabled
In 49bc9aac201136e684cac9d84df97f80d217afa4, when we need operation_id
when we check if manual_consumption is readonly or not, so
groups="mrp.group_mrp_routings" was added for manual_consumption.
As a result, we can't see manual_consumption on BOM when workorder is
not enabled.
To fix, we add a computed field as a workaround.

Task-3116125

Part-of: odoo/odoo#113538
2023-03-01 17:01:16 +01:00
Bruno BoiandMathieu Duckerts-Antoine d19037e141 [IMP] web,*: better classes handling in view archs
**Before this commit**
- The optional "class" attribute set on the root node of a view arch
  is ignored, except for the kanban view which has a custom
  way of using it.
- The optional "js_class" attribute set on the root node of a view arch
  does not have any impact on the class names passed to its controller.

**After this commit**
The content of the optional attribute "class" set on the root node of an
arch like in

<list class="o_custom_class">
    ...
</list>

as well as an additionnal class derived [1] from the value of the
"js_class" attribute set on the root node of an arch like in

<list js_class="extended_list">
    ...
</list>

will both be found in the prop "className" of any view controller.

[1] a js_class value of "xyz" yields to the class "o_xyz_view"

**Note on this commit**
The kanban view was already appending the root node class attribute
to its renderer element. This is no longer the case and some styling
rules has been adapted.

closes odoo/odoo#113014

Related: odoo/enterprise#37265
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>
Co-authored-by: Bruno Boi <boi@odoo.com>
2023-03-01 17:01:03 +01:00
Bruno Boi af00a92b3e [REM] *: remove unused class 'oe_background_grey'
This class is a ghost from the past.
Last related style has been found in da86f505a

Part-of: odoo/odoo#113014
2023-03-01 17:01:02 +01:00
Panagiotis Kyriakou 80e9dc746a [IMP] project: change the way we work with subtasks
This commit changes some of the way that users will
work with subtasks in the project app.
Initially, it changes subtasks from a many2many to
a one2many field.
We also add the ability for subtasks to be viewed
straight from the kanban view by drawing a list of
them inside of the kanban box of the parent task.

task-3085016

closes odoo/odoo#112279

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-03-01 17:00:56 +01:00
niyasraphy ee00f84c21 [IMP] hr_holidays: remove non used report action
hr.holidays.summary.dept model is no longer existing in odoo and it seems the time off summary report action is also redundant and one is not used.

closes odoo/odoo#108001

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-01 17:00:40 +01:00
Dossogne Bertrand a171164b8a [IMP] hr_holidays: links accrual to company
This commit adds a company field to accruals.

Also removes the unused 'parent_id' field in hr_leave_accrual_level.

TaskID 2817577

closes odoo/odoo#88275

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-03-01 12:21:40 +01:00
Soukéina Bojabza cdf0870e1f [FIX] web_editor: fix the widget state of the Vertical Alignment option
Since commit [1], an `align-items-start` class is added when going from
grid mode to normal mode in order to always have one of the four choices
of the Vertical Alignment option selected. Indeed, without this class,
none of them are chosen. However, only a few snippets have this option
and it is therefore not possible to modify this class easily in the
snippets that do not have it (except removing it from the DOM manually).

The real issue in fact comes from the computation of this option widget
state, which should select the last button (so the `align-items-stretch`
one) if no class is present, since the behaviors are equivalent in these
two situations.

This commit removes the addition of this `align-items-start` class and
fixes the `_computeWidgetState` of the Vertical Alignment option.

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

task-3142615

closes odoo/odoo#113949

X-original-commit: 75ef0d5d7ed000cf55b47bebb00cc2d0bb34b581
Signed-off-by: Vray Benjamin (bvr) <bvr@odoo.com>
2023-03-01 11:08:01 +01:00
qsm-odoo 468096cb6b [FIX] web: restore some dropdown styles in the backend
Steps to reproduce the bug (in 16.0 and above only):
- Go in the backend
- Focus the searchbar
- Type something and use the arrow to navigate the search dropdown
=> You cannot see what you are highlighting anymore

This occurs since [1] (its forward-ported version) which removed rules
that were targeting the frontend dropdowns by mistake while they were
indicated as wanting to target OWL dropdowns only. It appears that those
rules were actually used by chance in 16.0: to style the searchbar which
is not using OWL dropdowns and whose specific 15.0 styles were removed,
fallbacking on those erroneous rules. On top of that, the wanted style
here concerns a rule about the `focus` class... which is actually not
part of Bootstrap 5 anymore but that our old searchbar still uses.

There is a high chance that the problem is only confined to the 16.0
searchbar and not anything else. But as a precaution this commit fixes
the issue by restoring all the rules that were removed (well, rather
moved to be more specific to OWL dropdowns) but inside a backend file
only. The legacy/dropdown.scss file seemed very suitable for this
purpose. Obviously, those rules should be removed as soon as possible
once it will be judged ok in master after a searchbar adaptation.

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

closes odoo/odoo#113944

X-original-commit: 77537678d6b6f3533eb0c9d9d37d8fe679ef9580
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-03-01 11:07:58 +01:00
Bohdan Lisnenko d9215a766a [FIX] account: recreate analytic lines on account change
Steps to reproduce:
1. Login to Odoo 16.
2. Install Accounting app, apply Generic CoA, enable Analytic Accounting.
3. Create Analytic Plan with list of accounts. Departments for instance.
4. Create Invoice with any product, set financial account to 400000 Product Sales, and specify analytic account.
5. Post the Invoice.
6. Go to Accounitng -> Analytic Items. It should contian Analytic Item with financial account 400000 Product Sales.
7. Go to accounting -> Journal Items, find Journal Item related to our invoice where product and analytics were defined.
8. Mark journal item with checkbox to enable multi edit feature. Change financial account to 450000 Other Income.

Current behavior:
Analytic Item still has financial account 400000 Product Sales.

Expected behavior:
Analytic Item should be updated with financial account 450000 Other Income.

closes odoo/odoo#113940

X-original-commit: d0fdc38385f5f259da259d21e9137494e6d7c17d
Signed-off-by: William André (wan) <wan@odoo.com>
2023-03-01 11:07:50 +01:00
Corentin Thaon (thco) a15199ea8f [FIX] point_of_sale: pos.order _compute_margin
The call to check if the pos.order or the pos.order.line margin is zero
was considering the rounding precision as the number of decimal places.

opw-3179013

closes odoo/odoo#113931

X-original-commit: e3faa0659a0c6206740895e68face14c27af14a4
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: thco-odoo <thco@odoo.com>
2023-03-01 11:07:47 +01:00
MerlinGuillaume 25d7d3327d [FIX] base: change default Norwegian date format
The date format set on the Norwegian language is not kept when we click
on date fields

Steps to reproduce:
1. Install Sales
2. Install and switch to Norwegian language
3. Open Sales and create a new quotation
4. Click on the 'Quotation Date' field
5. The date format is changed from '%d. %b %Y' to '%Y/%m/%d'

Solution:
Change the default Norwegian date format to a valid static format
The format used comes from babbel[^babbel], double checked with the
Norwegian locale[^nb.js]
[^nb.js]: https://github.com/odoo/odoo/blob/16.0/addons/web/static/lib/moment/locale/nb.js#L25
[^babbel]: https://www.babbel.com/en/magazine/how-to-write-the-date-in-norwegian

Problem:
The old date format didn't pass the `isValidStaticFormat` test of the
date picker, so the default format 'yyyy/MM/dd' was used instead

opw-3191605

closes odoo/odoo#113926

X-original-commit: c27226e13392207811b61aceb3c77d1e9fcc180d
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2023-03-01 08:51:20 +01:00
Guillaume (guva) 5d492f4632 [FIX] l10n_de: add missing translations
Add missing translations to .pot

opw-3198115

closes odoo/odoo#113906

X-original-commit: e8762c4b56657df61a05d5720c73027f44c8858f
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2023-03-01 08:51:18 +01:00
Hansun (hale) 7af08cadeb [FIX] hr: random border appearance on employee badge
To reproduce the issue:
1. Install [Employees] app
2. Add some employee records if not there by default
3. Click on Print icon and [Print Badge]
4. pdf version will show borders

Issue: with the introduction of bootstrap5, setting the class became a necessity
Desired behavior: Make the borders invisible

Impacted versions: 16.0 up to master

opw-3126185

closes odoo/odoo#113925

X-original-commit: 0b78509b1bcba8547e0fe95ff4a14c7199adba92
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
2023-02-28 23:49:57 +01:00
Benjamin Vray c547012420 [FIX] web: fix smooth scroll on drag in iframes
This commit addresses a bug in jQuery Draggable where the 'stop' event
did not trigger a 'mouseup' event outside of the dragged element window
if it was inside an iframe. This issue only occurred in Chrome (Firefox
was not affected).

In mass_mailing, this issue occurred in the email editor when the mouse
was released in the area above the editor. This error also affected the
Sign module, where elements can be dropped into a PDF, and where the
'stop' event of the dragging did not trigger outside of the iframe.

Steps to reproduce the bug in mass_mailing:

- Open the Email Marketing app.
- Create a new mailing.
- Choose the second available email template.
- Click and hold the "drag and drop" button of the first snippet (Your
logo) to start dragging it.
- While dragging the snippet, move the mouse outside of the email editor
iframe.
- Release the mouse button.
- Bug: the drop zones are still present in the DOM, and it is possible
to save the template with them.

opw-3164969

closes odoo/odoo#113893

X-original-commit: f083e664bfe5b6b6abeec7aeee242771a21d8710
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2023-02-28 23:49:49 +01:00
Antoine Dupuis (andu) cfb84de489 [FIX] account: Avoid ir_module.account_templates compute error
Issue / How to reproduce:

At the moment, if a localization's python module is not present,
the computation of the `ir.module.module.account_templates` field fails
with a ModuleNotFoundError

How to reproduce:
- Create a fresh DB with a localization e.g. l10n_be
- Remove the localization directory
- Start the DB again and navigate e.g. to Inventory > Configuration >
  Settings. You will see a traceback, whose root cause is that the
  computation of the `account_templates` field failed.

We noticed this in a runbot upgrade between 16.1 and 16.2, for a new
localization that was introduced in 16.0.

Solution:

Make the computation return False if the Python module cannot be found.
Also, filter out the modules where account_templates is False when
constructing the list of available chart templates.

closes odoo/odoo#113875

Signed-off-by: William André (wan) <wan@odoo.com>
2023-02-28 23:49:47 +01:00
Antoine (ande) 26be824319 [FIX] l10n_din5008: wrong translation invoice
To reproduce the issue:
1. new db
2. localization in CH (french)
3. install module l10n_din5008
4. select an invoice
5. change invoice's client's language to
   french (CH)
6. print invoice
7. "Facture d'achat" should be "Facture client"

Error: invoice translation not correct

Invoice translation of this module is not
maintained by transifex
So invoice translation is changed manually in
fr.po

OPW-3186496

closes odoo/odoo#113851

X-original-commit: 5bc846a06cf817d78cfe1847f758bf9aadb4d93b
Signed-off-by: Grazioso Andrea (agr) <agr@odoo.com>
2023-02-28 23:49:35 +01:00
Xavier-Do 7431dac2fc [IMP] tests: add file selection for tags
The test-file is used by some dev to run all test classes from a file.
But test-file is always post install and doesn't always have the same
behaviour of a normal test execution.

This commits modifies the module test tags behaviour to be able to
give a file.

closes odoo/odoo#113850

X-original-commit: 5aff8cf22ab0cbac7a9a3cebf39860f55617f79e
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
2023-02-28 23:49:33 +01:00
Xavier-Do e9b170da38 [IMP] tests: refactor unittest classes
Odoo Test environments requires to modify many parts of the unittest
TestCase, Suite and Result.

The main initial reason is to **avoid to postpone result at the end of
the test suite**, because even if it is convenient to have all errors
visible after the tests in some case, odoo logs adds information during
the execution that can be useful to debug when a test fail, to have
context for an error. (see **OdooTestResult**)

We are also fixing the stack trace comming from a unittest and since
there is no proper way to hook inside the TestPartExecutor, a dirty hack
injects anoter result on the outcome to manage the error and complete
the stack trace. This was also a way to avoid to postpone subtest logs
at the end of the test case (see _ErrorCatcher)

`_feedErrorsToResult` was used to test the test suite behavior since
there are many customization and this is quite fragile, especially if
unittest changes behavior in other python version.

**Python 3.11** introduced python/cpython#664448d8 That, in a way, goes
in the same direction of the changed introduced with _ErrorCatcher:
immediately feed errors to resut instead of postponing it. But this also
removes `_feedErrorsToResult` that was used to test this behaviors, as
well as other ones.

Since odoo should remain multi-version, this amount of changes on the
initial behavior become to complicate to keep cross-version and the
(already in our mind for a while) solution to **vendor unittest** will
help to simplify most of our test code base.

This commit modified the vendored unittest files to simplify them as
much as possible to suite our needs.

Since the runner is still the unittest one, we need to inherit from
unittest.Testcase in order to have the right type.

This also means that we still have access to all TestCase methods
without overriding them all. This is convenient for assertion methods as
an example but the initial idea is to vendor our own version of TestCase
to avoid having trouble to adapte our miscommunications to future python
versions. A trade-off must be done to chose what should remain in our
code base. The idea is to keep logic closely linked to our changes in
our code base, mainly around the run method, but also addClassCleanup
wich need to be vendored for python 3.7, but assertions methods are
independent. Any logic can be moved fom unittest to our
vendored version in the future if needed.

X-original-commit: 9a5d1ea54be49e4cc8208c33e76a6bbd2414d5d0
Part-of: odoo/odoo#113850
2023-02-28 23:49:33 +01:00
Xavier-Do 630b6484a2 [FIX] tests: vendor some unitest files
Vendor some unitest file before modifying them in next commit

Chosen files are suite, case, and result since they are working together
and are the most modified classes in odoo.

mock, signals, runner and utils will still be imported from unittest.

X-original-commit: 742d165b9a1bff23deb736dee6b266c76f3ce727
Part-of: odoo/odoo#113850
2023-02-28 23:49:32 +01:00
oco-odoo 1997c0a01d [IMP] account: improve test helper
Creating a test invoice without tax was impossible with this helper, as the default tax got applied when the 'taxes' parameter was None. We change that to allow doing it by simply providing an empty list in it instead of None.

closes odoo/odoo#113541

X-original-commit: f3ae4f7fa91b73be6a5647724697f73fdf77cbdd
Related: odoo/enterprise#37484
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2023-02-28 23:49:25 +01:00
Julien Castiaux eaff61793b [FIX] website: public user should see published pp
As the public user, browse the website where you usually should see some
profile pictures (e.g. inside the forum). All the images are wrongly
replaced by the grey avatar placeholder.

When using `ir.binary._find_record` it was checking the access rights
and raising `AccessError` early even if the record was
`website_published`.

closes odoo/odoo#113526

X-original-commit: 0611fb437b699588317919e72ccfa1c41f1245bc
Signed-off-by: Julien Castiaux (juc) <juc@odoo.com>
2023-02-28 23:49:22 +01:00
Kevin Baptiste 6419bd7f06 [IMP] hr_recruitment: no refuse reason on archive
Don't ask for the refusal reason when archiving an applicant.
Show a pill/ribbon for archived applicants.

task-3172203

closes odoo/odoo#113474

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 22:49:57 +01:00
Kevin Baptiste 1aff45e35e [IMP] hr_skills: improve resume
- Replace "CV" with "Resume"
 - Allow to choose which information to show on the resume (Contact +
   Skills)
 - Use the company colors by default
 - Minor cosmetic changes on the template (reduced margins, better page
   break, etc.)

task-3198645

closes odoo/odoo#113218

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2023-02-28 20:39:11 +01:00