Commit Graph
164168 Commits
Author SHA1 Message Date
Yannick Tivisse b9b165db7d [FIX] hr_work_entry_contract: Correctly compute work entries for edge timezones
closes odoo/odoo#124222

Related: odoo/upgrade#4699
Related: odoo/enterprise#41253
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-17 10:32:54 +02:00
Yannick Tivisse 8a83cbeb28 [IMP] account: Add salary accounts to generic CoA
Part-of: odoo/odoo#124222
2023-08-17 10:32:53 +02:00
Yannick Tivisse 3312657294 [FIX] hr_payroll_acccount: Make default account configurable on journal
Purpose
=======

2 commits were making impossible to define a default account on a
miscellaneous account journal. However, this is used in payroll
to auto-balance unbalanced moves.

After a discussion with the related team, it has been decided to
revert both commits, which were breaking other use cases as well.

Revert "[FIX] account: fix the domain of default_account_id from account_journal"
This reverts commit b09f06f986.

Revert "[IMP] account: remove default account on misc journal form view"
This reverts commit f2c0bc321b.

Part-of: odoo/odoo#124222
2023-08-17 10:32:52 +02:00
Yannick Tivisse d0e2d1365c [IMP] hr: Expose Social Security Number of employee forms
Part-of: odoo/odoo#124222
2023-08-17 10:32:50 +02:00
Yannick Tivisse b634498fc0 [IMP] hr: Make contract type country specific
Part-of: odoo/odoo#124222
2023-08-17 10:32:49 +02:00
Yannick Tivisse e7ba02b1b1 [IMP] hr_payroll: Move wage_type/schedule_pay on contract
Purpose
=======

Currently the wage_type and the schedule pay are defined on the
salary structure type level, preventing users paying different
employees on the same structure with different salary types or
periodicity, which is a employee choice on certain countries,
like Mexico or the USA.

Specification
=============

Move the logic at the contract level, but keep the structure
type field definition to be used as default values.

Part-of: odoo/odoo#124222
2023-08-17 10:32:48 +02:00
althaf shaik 00ab68201e [FIX] lunch: handle error of invalid time in lunch suppliers
This traceback raises when user gives invalid time (hours) at the time of
updating a record in lunch suppliers.

To produce this issue:

- Install 'Lunch'
- Open Lunch/Configuration/Vendors
- Open an existing record and in 'Orders' click 'Send Order By' as 'Email'
- Give invalid time in 'Order Time' like -ve value or greater-than 12
- Save the record

Error: 'A traceback appears': 'hour must be in 0..23'

When user update a record 'write' method calls first than
'_sql_constraints' and in that method '_sync_cron' method is used.
Because of user giving invalid time it lead to above
traceback.

See:
https://github.com/odoo/odoo/blob/88c1541a1646c419d37a9ca94a27f069844614db/addons/lunch/models/lunch_supplier.py#L186-L199

Sentry-4297889570

closes odoo/odoo#132143

X-original-commit: 99fb33167fb6bd332548f21c83d69fd9fe6b6c69
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Altaf Shaik (alsh) <alsh@odoo.com>
2023-08-17 09:21:16 +02:00
Lucas Lefèvre (lul) 2088384de6 [FIX] spreadsheet_edition: ignore property fields
See enterprise PR ;)

Property fields are not supported in spreadsheet.
In saas-16.2, it even completely ruins the entire list
if it contains one property field.

With this commit, until we support properly property fields[1],
we ignores property field when the list view is inserted
in spreadsheet

[1] in master, see task 3329490

opw-3284273
opw-3465243

closes odoo/odoo#132138

Task: 3329490
X-original-commit: ada541d6c4a8d0a5b515c4f1f7e9d71c54b992d5
Related: odoo/enterprise#45844
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
2023-08-17 09:21:11 +02:00
Yolann Sabaux f5da45537a [FIX] account: allows ungrouped batch payment with different payment terms
Steps to reproduce:
- Create two Bills with different payment terms with one having no "early_discount" such as '30% Now, Balance 60 Days'
- Select the Bills and click on Register Payment (make sure the payment is not grouped)

Issue:
Server Error

Cause:
We try to Register Payment for all the Bills at once, but the "early_discount" is not defined for all the Bills.
So, whenever there is a move with an early discount, the mode is always considered as "early_payment".
Therefore, we call `_get_invoice_counterpart_amls_for_early_payment_discount` with an empty list since there is no early discount
https://github.com/odoo/odoo/blob/0ffaaebfa5c25c4bf71fb0e02288767dbfac959d/addons/account/wizard/account_payment_register.py#L750-L755
https://github.com/odoo/odoo/blob/0ffaaebfa5c25c4bf71fb0e02288767dbfac959d/addons/account/wizard/account_payment_register.py#L760

Causing the "local variable 'aml' referenced before assignment" error.

Solution:
We only iterate through moves belonging to the batch. This way, we avoid setting the mode to "early_payment" and entering the confition.

opw-3378445

closes odoo/odoo#132113

X-original-commit: 9bba9576d3365500a5c1eda0cfd57457fd999878
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Yolann Sabaux (yosa) <yosa@odoo.com>
2023-08-17 09:21:02 +02:00
althaf shaik 1e77837bf5 [FIX] purchase_stock: print report of the purchase order with incoterm location
The traceback arises when a user tries to print 'Request for Qutation'
in 'purchase order' after providing 'Incoterm Location' and 'incoterm' value.

To reproduce this issue:

1) Install 'purchase_stock'
2) Open any existing purchase order
3) Click on 'Other Information' and give any value for 'Purchase Location'
4) Select any 'Incoterm'
5) Now print 'Request for Qutation' template

Error:-''purchase.order' object has no attribute 'invoice_incoterm_id''

On 'purchase_report_template' instead of 'incoterm_id', 'invoice_incoterm_id'
is used.
See:-
https://github.com/odoo/odoo/blob/158f8090ef30065b97ebe8b15b0bf73fff6a9ac4/addons/purchase_stock/report/purchase_report_templates.xml#L43-L48

In 'Purchase_order' there is no attribute of name 'invoice_incoterm_id'.
When the user tries to print 'request for Qutaion' and because of
'invoice_incoterm_id' is used, which leads to above traceback.

sentry-4379690422

closes odoo/odoo#132080

X-original-commit: c1daf78d1aa4252bf0f85cd704df0e929062f496
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-17 09:20:49 +02:00
Chrysanthe (chgo) 8120fca14f [FIX] account, kanban_dashboard: fix favorite alignment
Commit[1] introduced some changes in order to fix a layout issue in the
accounting dashboard but these changes were applied in a way that affects
a lot of modules and files that should not be modified.

In fact, by removing the padding inside the `kanban_dashboard.scss`
commit[1] is actually removing the padding in every place where
the boolean_favorite widget is used.

There is also a change applied in the Bootstrap library files, which
should remain untouched.

=== AFTER ===

We revert the changes applied by commit[1] and also fix the layout issue
in the accounting dashboard that it aimed to fix.

commit[1]: d4ba0c1

task-3453799
part of task-3326263

closes odoo/odoo#132134

X-original-commit: f78571cec0a5debf78c5dd1859c78b13d33df1ab
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-17 01:04:34 +02:00
Walid d9e31fbb51 [FIX] delivery: apply tracking to all pickings in multistep delivery
Steps to reproduce:
- Install DHL carrier
- Enable multistep routes
- On warehouse config set 3 steps(pick,pack,ship) on outgoing shippments
- Create an SO  and add DHL shipping
- Validate the first picking and send to shipper

Bug:
only the first picking has a tracking ref
this causes an issue because this an in internal picking and only the
last is shown to the customer on sales portal so the customer doesn't
have acces to the tracking ref

Fix:
set the referrence on all the pickings of the so

opw-3269257

closes odoo/odoo#132142

X-original-commit: fd19ba5483dc4312e4459100582f417a38b52b3b
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-08-16 22:22:46 +02:00
Xavier ALT 99d4bc5e04 [FIX] mail: correctly parse body as html for pure-html email
Some external tools send email as pure html (no multipart) and when
parsing such email we ends up having the raw HTML as body (text)

This commit ensure we correctly parse and sanitize the body as HTML
for such emails.

closes odoo/odoo#132127

Task-id: 3451889
X-original-commit: a4763d214bfc7b09510226e552f749f9cd95870e
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
2023-08-16 21:12:52 +02:00
Romain Derie ec6677b79f [FIX] website: allow again external website redirect
Broken by commit [1], where only the `url_to` should've been part of the
check for 301/302. The rest of the `if` was about relative URL check,
routing map check and converter check, all related to 308 only.

Note that in the meantime, commit [2] was added in those checks and
needs to be part of 301/302 too.

[1]: https://github.com/odoo/odoo/commit/14a850976711431f36b7f889ea9cf31b1114513d
[2]: https://github.com/odoo/odoo/commit/26fa923f6ab01298bf1a1e9f6a615c9aa9e2e5ed

Fixes https://github.com/odoo/odoo/issues/129290

closes odoo/odoo#132114

X-original-commit: ec27fd45868318542f365ec4ec1b3c9d5084f586
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-08-16 20:03:42 +02:00
moerradi de368ba9b4 [FIX] account: Make generated follow-up reports accessible in menu
Resolved an issue where follow-up reports linked to a partner weren't
visible in the follow-up menu due to 'partner_rank' not incrementing
after a misc entry. The commit ensures the correct update of
'partner_rank', making all relevant reports accessible.

closes odoo/odoo#132082

Task-id: 3437930
X-original-commit: fd97480760f5f02c0b25fd39d86c4f0d3e36308e
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Mohamed Erradi (moer) <moer@odoo.com>
2023-08-16 19:05:02 +02:00
Adrien Dieudonné c147339a0c [REF] web: remove legacy redirect
This function is not used anymore.
We now call ´browser.location.assign(...)´ directly.

Related PR: https://github.com/odoo/odoo/pull/112621

closes odoo/odoo#132072

Signed-off-by: Romain Estievenart (res) <res@odoo.com>
2023-08-16 19:04:58 +02:00
Jinane Maksoud 4492bfbb11 [FIX] account: change tax repartition lines default order
The update of repartition lines was matching exitsting values
to the wrong records in the chart template due to a difference
in the sorting.

closes odoo/odoo#132069

X-original-commit: 017eec9112f4cf00fc4392528877c48c6ded1a85
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-16 19:04:53 +02:00
Walid f60e9b07b6 [FIX] stock: return packages
Steps to reproduce:
- Deliver an SN-tracked product with the Destination Package set (put in pack button also sets this).
- Return that product without setting the Source Package (you can also click "put in pack" which will put the product in yet another pack).
- This already results in two lines with the same SN in the same location, one with +1.00 and one with -1.00 quantity.
- Deliver that product again and put in pack.
- Now there's three lines with the same SN in the same location, two with +1.00 and one with -1.00 quantity.

Bug:
source Package isn't set bydefault when confirming the move_line
we update the stock quantity for that lot_id and Package set to False
the existing quantity has a Package set so it is filtered out and a new
negative quantity is created

Fix:
set the source Package on the return

opw-3179388

closes odoo/odoo#132056

X-original-commit: 9d2d3911a3ac6711d3040d22e146f9eb18de2197
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-16 19:04:49 +02:00
Laurent Smet cf23952a97 [FIX] l10n_eg_edi_eta: Remove auto-install
The auto-install has wrongly been introduced by:
https://github.com/odoo/odoo/commit/2d2faafb744abdb09f199ab85f11d317ee1d065e

l10n_es_edi_sii has already been fixed by:
https://github.com/odoo-dev/odoo/commit/02f72d6a2ee73e844537e27594d02c9533954d26

closes odoo/odoo#132052

X-original-commit: 95c3401a274aa3c73a10d32b3c54b357d5c6c114
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-16 19:04:44 +02:00
Camille Spiritus c5e1716d2e [FIX] account/l10n_ch: QR Bill: adapt QR header to invoice's
In Switzerland, since 16.0, the QR Bill page always has the external_layout template, whatever template the user chose for his invoices. 

This was a "lesser evil" choice to allow the user to print QR-bills : BootStrap5 and wkhtmltopdf were not compatible, causing a display bug and generating incorrect QR Bills before this.  

See for an example the task-3037921.

Returned to the original behaviour, namely :

- Display the invoice header on the QR Bill ;
- Adapt said header display to the layout chosen by the user ;
- Fixed Din5008 display. 

task-3241502

closes odoo/odoo#132051

X-original-commit: 061a6780d445b9e23e62ef69b9da2503cb212cfb
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Camille Spiritus (casp) <casp@odoo.com>
2023-08-16 19:04:40 +02:00
Josse Colpaert f20caf3add [IMP] l10n_ec: Add and fix tax group accounts to automate tax closing…
… entry

- These new accounts are to automate the tax closing entry on 103 and 104 reports.
- The tax names of account 11050201 is changed to a better accounting standard name for the understanding of the accounting accounts to be configured in the tax groups, based on the name of the new account group created.
- Accounts payable and receivable are added for each of the tax groups, by company. It's not set in chart template property accounts, because they are different accounts for each tax group. For this reason, the accounts are set in load chart template method.
- Add irbpnr tax group account
- Add Exchange Outflows accounts and fix ec translation for exchange outflows account
- Filter companies with EC chart template set

We needed to adapt to saas-16.2

closes odoo/odoo#132050

X-original-commit: f7b2ff2028490fd1cf97f8fa1bc5e7103fefaa34
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-08-16 19:04:35 +02:00
Walid 1fb4d356b5 [FIX] mrp_account: AVCO product valuation with component cost 0
Steps to reproduce:
- Create a manufactured product P with AVCO valuation
- On the bom of the previous product add a component C with unit cost 5$
- Manufacture product P (Unit cost correct so far 5$)
- Change component cost to 0 and manufacture again
- Unit cost of P is still 5$ were it should be 2.5$

Bug:
since the move unit price is 0 the standard price of the product P is
used insted for the valuation of the newly created qty

Fix:
force unit price to 0 in the case of manufacturing

opw-3374462

closes odoo/odoo#132047

X-original-commit: f6c2b5368e3abdc292e66dc04efc4031eb12f742
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
2023-08-16 17:48:19 +02:00
Valentin Chevalier 127147bbab [FIX] sale: fix decimal precision in the catalog
A new way to add products in sale orders, through a catalog, was
introduced in commit 216fa84fbe. The precision of the price shown in the
catalog was the currency's precision, but the product price precision
should have been used.

closes odoo/odoo#132046

X-original-commit: 37b5626f58284e13ecfe113842134fe5006f5517
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Valentin Chevalier <vcr@odoo.com>
2023-08-16 17:48:14 +02:00
Samuel Degueldre 9210bbf5fb [IMP] web: improve time taken to parse owl templates
This commit removes some code that would allow one to define multiple
templates with the same name, and would cause the the last template with
a given name to override the previous one. This doesn't happen in
practice, nor should it, and the code that is used to allow it
repeatedly queries the document for a selector that is difficult to
process (selecting for elements with a specific attribute value,
especially when many elements in the document have that attribute).

A simple profile, with the crm and project apps installed, brings the
time that it takes to load the owl templates from ~200ms to ~35ms

closes odoo/odoo#132044

Signed-off-by: Francois Georis (fge) <fge@odoo.com>
2023-08-16 17:48:10 +02:00
Adrien Widart (awt) 9a5df70861 [FIX] stock_picking_batch: ensure batch consistency
When processing a batch without backorder, if a picking is not fully
done, it will be removed from the batch

To reproduce the issue:
1. Create two delivery pickings P1 et P2 with demands = 5
2. Have the quantity in the stock
3. Add both to a batch and confirm it
4. Set the done quantity on P1
5. On P2, set a done quantity to 4
6. Process the batch without backorder

Error: Both pickings are done, and so does the batch, but P2 is not
linked to that batch anymore

When processing the batch, we will call `button_validate` on the
pickings recordset
https://github.com/odoo/odoo/blob/213b74be16cecc50e6e99c00f47786a9cbf327a8/addons/stock_picking_batch/models/stock_picking_batch.py#L252-L258
Later on, there is an override of `StockPicking._action_done` in the
batch module. In this override, once we have called `super`, we then
ensure that all pickings of the batch are done, else we detach some
of them:
https://github.com/odoo/odoo/blob/213b74be16cecc50e6e99c00f47786a9cbf327a8/addons/stock_picking_batch/models/stock_picking_batch.py#L252-L258
But here is the issue: as mentionned above, we first call
`button_validate` on pickings recordset. In this method, we will
call `StockPicking._action_done` two times:
https://github.com/odoo/odoo/blob/ca168f7fbcbb8a300a8fa0b46f79a6c116b5aa93/addons/stock/models/stock_picking.py#L1088-L1089
The first time, for the pickings without the backorder option (P2 in
the above use case), and the second time, for the pickings with the
backorder option (P1 in the above use case). As a result, during the
first call, we reach the override in batch module, and of course, P1 is
not yet processed (it will be done during the second call of
`_action_done`). Therefore, we think there is an inconsistency, and we
detach P2.

OPW-3346255

closes odoo/odoo#132037

X-original-commit: c2817285adf9dd44ad7155963f08d324995ba072
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart (awt) <awt@odoo.com>
2023-08-16 17:48:05 +02:00
Romain Estievenart 4ae61cee22 [IMP] web *: remove unused jquery.scrollTo library
*: project, mrp_subcontracting

This commit is a code cleanup, we remove an unused lib from the codebase

The last usage of jquery.scrollTo was dropped in saas-16.4 after the
refactoring of livechat, see here [1].

Note that we have our own ´scrollTo´ utility.

References :
https://github.com/flesler/jquery.scrollTo

[1] https://github.com/odoo/odoo/commit/20c1772d351e14e5233a636313dc79c2fe5b9115#diff-8925fb7187d27cf7abc3fbb149a22cdcfa83eaa435a667b5beb042c4fd0fe3fdL220

closes odoo/odoo#132035

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2023-08-16 17:47:56 +02:00
SaddemAmine 5bd4120928 [IMP] hr_expense,project_sale_expense: Clarifying user error when partner is missing
When the partner is missing, the error message is not clear enough.
This commit adds a new error message to clarify the issue.

Task ID: 3438559

closes odoo/odoo#132029

X-original-commit: 5be853ebb6da19a4f0a147944995583e234bf1b9
Related: odoo/enterprise#45779
Signed-off-by: Laurent Smet (las) <las@odoo.com>
Signed-off-by: Naceur Amine Saddem (sana) <sana@odoo.com>
2023-08-16 17:47:45 +02:00
Brieuc-brd 92ce339ec0 [FIX] mrp: BOM control_panel layout
This commit fixes the layout of the BOM control panel.

task-3419079
Part of task-3326263

closes odoo/odoo#132025

X-original-commit: c0fac4b7b8b66315a553337956999d8eb602ac13
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-16 17:47:36 +02:00
David Monnom (moda) 4295c88f94 [FIX] pos_loyalty: wrong syntax for super call
The call to super was wrong, it was called in the old way this._super().

This has now been corrected with the new method
super().`function name`()

closes odoo/odoo#132022

Signed-off-by: Adrien Guilliams (adgu) <adgu@odoo.com>
2023-08-16 17:47:31 +02:00
Tiffany Chang (tic) 33cc629001 [FIX] mrp,repair,stock{_dropshipping}: correct show_operations visible
PR #106911 added the new picking.type for repair and hide the
`show_operations` field from its form view. Unfortunately this writes
over the existing invisible attr for mrp_operation (depending on the
order of module installation, otherwise mrp will do the same to repair).
Therefore we update the attribute logic to only include the picking
types that should have the field visible (incoming, outgoing, internal,
and dropship).

closes odoo/odoo#132012

X-original-commit: 1688a8d82ce7aec32f17fc8c35295cccbb682dd6
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-16 17:47:27 +02:00
Aungkokolin1997 8a7f221c91 [FIX] project_purchase: use model indicator in query
This commit adds alias table to be sure the `analytic_distribution`
column will not be ambiguous because another table could have the
same column name.

closes #121611
closes #110291

closes odoo/odoo#131991

X-original-commit: 253479633b32383e141fe2ca2ca7395f22651485
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-16 17:47:18 +02:00
niyasraphy abda470f53 [FIX] website_forum: show votes from same forum
before this commit, if the user profile is opened
from a particular forum, the votes tab is displaying
the votes from all the forums for this user.

where us, the questions and answers tab is filtering
the data based on the selected forum.

after this commit, the data displayed in the votes
tab will also be filtered based on selected forum,
similar to questions and answers tab.

closes odoo/odoo#131487

X-original-commit: ae33d2e3832cc2ce5597a6727fd44c9d745d36c5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-16 17:47:13 +02:00
mehjabinfarsana 5a8f233b32 [IMP] website_slides: add _rec_name for model
before this commit, _rec_name was not added for
slide.channel.partner

after this commit, _rec_name is added

closes odoo/odoo#123800

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-16 17:47:07 +02:00
Julien Alardot (jual) 7e1855f5b1 [FIX] hr_expense: Fix expense unit_amount computation
This fixes a bug when you change currency on an already saved expense
due to the fact that the unit_amount is never recomputed but used to
generate the move line balance

Step to reproduce:
- Duplicate an existing expense paid by an employee
- Change currency + save
- create -> post expense report
- The total amount and remaining amount do not match

closes odoo/odoo#131709

closes odoo/odoo#131818

X-original-commit: e0bceb37ee7656c37ab99a4a4bb3b71d85199e1b
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Julien Alardot (jual) <jual@odoo.com>
2023-08-16 16:05:51 +02:00
Arjun Panchal cd5faa380e [IMP] l10n_in: COA on Tax Configurations
Before this commit
==================
COA for CGST-SGST, IGST, CESS & RC Tax was not properly set in the distribution
for refunds.

After this commit
=================
COA for CGST-SGST, IGST, CESS & RC Tax in the distribution for refunds has been
updated according to the attached spreadsheet.

task - 3284312

closes odoo/odoo#131595

X-original-commit: 6a67b7055c2c53fae2462c70cb5899f372365661
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:40 +02:00
mehjabinfarsana 0b2133fe4a [FIX] hr_expense: remove quick_create from expense report kanban view
before this commit, on expense report kanban view
after adding group by status, it allows the
to quick create expense report in approved
status.

after this commit, quick create is disabled

closes odoo/odoo#131579

X-original-commit: 6848d8e37d1bce0cb767ba9328b38038b6056e77
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:35 +02:00
niyasraphy 933856d669 [FIX] hr_expense: warning in log on posting expense je
before this commit, on posting journal entry from
the expense it shows a warning in the log.

*warning in the log*

Action {6: account.move(49,), 'type': 'ir.actions.act_window_close'} contains custom properties 6. Passing them via the params or context properties is recommended instead

after this commit, on posting journal entry
warning wont be displayed in the log

closes odoo/odoo#131444

X-original-commit: 00b09c548b0a01191bea20584193da6a02681a36
Signed-off-by: Laurent Smet (las) <las@odoo.com>
2023-08-16 16:05:26 +02:00
Julien (jula) a44fb24cb5 [FIX] web: check if navLink exists
__Current behavior before commit:__
If there is no link in one of the hamburger menu element,
`el.querySelector` will return `null` and an error will be thrown when
it tries to access `classList`.

__Description of the fix:__
Add a check on `itemLink` and `navLink` before accessing `classList`.

__To reproduce:__
1. Add 2 pages with long names to the website, make sure they are
included in the navbar
1. Open Website Editor
1. Click on the navbar
1. In the **CUSTOMIZE** tab, inside the **Navbar** section, change
**Mobile Menu** to `Off-Canvas`
1. Set **Mobile Menu > Off-Canvas Logo** to `Text`
1. Reduce the width of the page *just enough* so that the hamburger menu
appears instead of the navbar menus only when the web editor is on
1. Click on the hamburger menu, and remove the link of the "My Website"
text at the bottom
1. Exit the Web Editor

([Video](https://watch.screencastify.com/v/dWI3g6NnT5uRcp2KmBOO))

opw-3443200

closes odoo/odoo#131373

X-original-commit: 5b9eb3a1d016a16d395e9888ccd1606543eb99e2
Signed-off-by: Luca Vitali (luvi) <luvi@odoo.com>
2023-08-16 16:05:22 +02:00
FrancoisGe e3da5f1b7d [REF] *: convert legacy dialogs
The goal of this commit is to convert a bunch of legacy dialogs into owl dialogs.

closes odoo/odoo#131278

Task-id: 3453920
Related: odoo/enterprise#45484
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-16 16:05:12 +02:00
Mohit Beniwal a2b41824df [FIX] l10n_es_edi_facturae: handle ZeroDivisionError when discount value is 100
This traceback raises when user tries to 'Send & Print' the invoice of sale
order having a discount of 100%.

Steps to reproduce:
1) Install "l10n_es_edi_facturae" & "sale_management" and switch to "ES Company".
2) Open "Sales" >  "Configuration" > "Settings" and click on
   "Discounts" checkbox > "Save" button to activate it.
3) Now click on "Orders" > "Quotations" button and then "New" button .
4) Select any "Customer" and in "Order Lines" select a "product" with
  "Invoicing Policy" as 'Ordered quantities' (ex. 'Chair floor protection').
5) Now, in that 'Sale order line' enter the value of 'Disc.%' as '100' .
6) Click on "Confirm" button and then "Create Invoice" button.
7) In "Create Invoice" Wizard, select "Regular Invoice" if not >
  "Create Draft Invoice" button.
8) In "Customer Invoice", click on "Confirm" button > "Send & Print" button.
9) In "Configure your document layout" wizard, click on "Save" > "Send & Print".

Error: ZeroDivisionError: float division by zero, is generated from
"_l10n_es_edi_facturae_inv_lines_to_items"  method.

See: https://github.com/odoo/odoo/blob/b5c19d368339f9d2b7af6e61e88a918d6ba318ee/addons/l10n_es_edi_facturae/models/account_move.py#L195

It gets the value of "line.discount" as 100, so the overall value of
"(1 - line.discount / 100.0)" becomes Zero and it tries to  divide
"line.price_subtotal" by 'Zero', that's why this error is coming.

sentry-4325625223

closes odoo/odoo#131029

X-original-commit: 363e679601920f1a5a1fd6e1021521dae2a76714
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Signed-off-by: Mohit Beniwal (mobe) <mobe@odoo.com>
2023-08-16 16:05:06 +02:00
SaddemAmine 0b3d9a0360 [REF] account, l10n_{bo,lv}: remove 'none' figure_type
This commit removes the 'none' figure_type from the account_tax_report
because it is redundant since other figure_types have been added.
Especially 'string' which practically does the same thing.

task ID: 3434197

closes odoo/odoo#130166

Related: odoo/enterprise#44833
Related: odoo/upgrade#5010
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-08-16 16:04:51 +02:00
Alvaro Fuentes f7cd412725 [FIX] core: fix remove constraints at uninstall
This patch aims to fix multiple issues with the removal of table
constraints at module uninstall.

1. We cannot remove `ir.model.constraint` records before calling
   `_module_data_uninstall` on them. Otherwise we either won't find them
   when performing the search
   `self.env['ir.model.constraint'].search([('module', 'in',
   modules.ids)]` or, if we somehow keep the ids and use `browse`
   instead, would get an error because `_module_data_uninstall` tries to
   access field values of records already removed. Note, although not an
   issue, the removal is redundant for non FK constraints since
   `_model_data_uninstall` already unlinks the record.
2. When a constraint has a name longer than 63 characters (Postgres
   default) we would fail the check for the existence of the constraint
   since the names are truncated.
3. When checking for the presence of a constraint we assumed its type
   would be `u` in `pg_constraint` because for us that means non FK
   (i.e. not `f` type). That's incorrect since there are many more
   types. Here we propose to handle `c,u,x` types.

For bullet 2 we use `tools.make_identifier` that hashes the name and
ensures it fits in the 63 chars limit.

Revert "[IMP] models: warn if constraint key len exceed 63"

The check from commit 823d9e10dc is no
longer needed since the name is ensured to fit length limit.

[IMP] code: improve uninstall tests

Perform extra checks for removal of SQL constraints. Note the test is
commented out in `__init__.py`. It can be uncommented locally for
testing. It's kept commented out to avoid random errors in runbot.

closes odoo/odoo#129084

X-original-commit: af288b7178c25261329dd85a2e64b9dd635cd9e1
Signed-off-by: Raphael Collet <rco@odoo.com>
2023-08-16 16:04:47 +02:00
Kartik Chavda ba90ec9603 [REM] calendar: remove unwanted code
This commit remove deprecated method.

task-3390334

closes odoo/odoo#126768

Related: odoo/upgrade#4865
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
2023-08-16 16:04:27 +02:00
Kartik Chavda efac5707d1 [REM] calendar: remove attendee_status field
Purpose of this commit to remove `attendee_status` field
which was only usefull in one place where it can be easily
replacable and also this field contains some heavy
computation and added in calendar view which might be
cause some perfomance issues.

So, in this commit remove `attendee_status` field and its
related code and replace it be alternative which gives
desire output as before.

task-3390334

Part-of: odoo/odoo#126768
2023-08-16 16:04:26 +02:00
adjo-odoo 1ebc6c0044 [IMP] project(_sms),rating,hr_timesheet: improve the UI for project
The purpose of this PR is to improve the generic usage of the project app.

So in this PR done following changes:
 - In reporting > tasks analysis measures:
   - removed the # of tasks and average rating measures
   - Changed rating value (/5) to rating (/5)
 - In task analysis reporting formatted overtime as hh: mm
 - In the project  burndown chart added tip to action helper
 - In project.task search view > quick searches:
   - changed sale order to sales order
   - under the SO one, a 'sales order item' has been added to the quick search
 - Added many2one_avatar_employee widget in project sharing-> timesheets notebook
 - In project.project form view > share editable added text in muted
 - Added tip in the project.project form view > invoicing notebook under
   employee/SOL o2m
 - A placeholder has been added to the rating email template field in the project
   task stages: 'Task: Rating Request'
 - now rating submission page is editable
 - In task stages list view :
   - moved the project field on the right of the name
    - switched the 'SMS template' and 'email template' fields from the place
 - In project.task > recurrence notebook:
   - moved the 'next tasks' list to the right of the recurrence
      configuration fields
 - In project.task > sub-tasks notebook > optional fields >
   renamed 'initially planned hours' into 'allocated hours'
 - In project.task portal form view: renamed
   'history' into 'Message and communication history'
 - Added 'open' filter in my tasks menu search view
 - Added 'schedule an activity' status in the kanban activity widget

task-2903637

closes odoo/odoo#95971

Related: odoo/enterprise#29467
Related: odoo/upgrade#4095
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-16 16:04:09 +02:00
Adesh Jolhe (adjo) b623d25196 [IMP] portal: improve the portal share template
The purpose of the commit is to improve the share template
messaging and ui.

so in this commit did the following changes:
  - In invitation email template made some changes as follows:
    - You have been invited -> Mitchell Admin has invited
    - following document -> following project(record description)

task-2903637

Part-of: odoo/odoo#95971
2023-08-16 16:04:08 +02:00
damr bd1d22a269 [IMP] stock : update action_launch_stock_rules
This commit's purpose is to allow the overwrite of a condition inside
the action_launch_stock_rule in order to ensure the data to be corretly
updated in the flow of the industry_fsm_stock

task:2720328

closes odoo/odoo#114757

Related: odoo/upgrade#3607
Related: odoo/enterprise#23000
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-16 16:03:55 +02:00
Hubert Van de Walle (huvw) 5023e1a52c [FIX] web: commitChanges with a field input removed during an update
Steps to reproduce
==================

- Go to Payroll > Payslips > All Payslips
- Click on any line
- Click on the cog > Edit Payslip Lines
- Change an amount
- Press Tab

```
Cannot read properties of null (reading 'value')
    at commitChanges (/web/static/src/views/fields/input_field_hook.js:163)
    ...
```

Cause of the issue
==================

A custom Field is used: PayslipLineField.
It is used to override the record.update to trigger an action.
https://github.com/odoo/enterprise/blob/f8c027685a49fca519fd6ac2f41dd5f30b243934/hr_payroll/static/src/js/payslip_line_one2many.js#L63-L80

This causes the view to be destroyed -> `inputRef.el` becomes undefined.

Solution
========

Use the field value before the update.

opw-3434835

closes odoo/odoo#131971

X-original-commit: 546978c70f5bee59b9985246977585ef59d761cd
Signed-off-by: Francois Georis (fge) <fge@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-16 14:21:50 +02:00
xO-Tx e70cc2ea86 [FIX] website: adapt background image URLs on language switch
Steps to reproduce (on Chrome with browser cache enabled):

- Go to website > Create a new blog post.
- Switch to edit mode > Add an image to the blog cover from unsplash.
- After save, switch to a secondary language > Unsplash images disappear
and you need to refresh the page to get them to appear.

This behaviour is a "very specific" Chrome related issue: when switching
language, Chrome cannot load inline background images correctly right
after the redirect... and unlike other image URLs, background images
don't have the language code prefix (The `url_for()` will add the
language code before the image "src" E.g. `<img src="/unsplash/...."/>`
=> `<img src="/fr_BE/unsplash/...."/>` when switching to `fr_BE`...).

The goal of this commit is to prevent this behaviour by adapting the
"background-image" URLs in the same way as image "src".

opw-3412961

closes odoo/odoo#131891

X-original-commit: 5f20f50f9a9fd4bc5145d380609cdca80a8d7511
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2023-08-16 14:21:46 +02:00
mehjabinfarsana 805735fd9f [IMP] product: vendor product name and code in search view
before this commit, vendor product name and
vendor product code was not added in
vendor pricelists search view

after this commit, vendor product name
and vendor product code is added

closes odoo/odoo#129301

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2023-08-16 12:47:45 +02:00