Commit Graph
157157 Commits
Author SHA1 Message Date
niyasraphy 044231fb10 [FIX] hr_skills, hr_skills_{}: fix typo
closes odoo/odoo#107513

X-original-commit: 641571c27a2c8cfb4da243977ddec512dea11587
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-09 10:45:02 +01:00
niyasraphy d91fa0c405 [IMP] hr_recruitment_{}: improve user error message
in the model/view the name of the field is Applicant's Name and in the user error message the warning is shown as Contact Name, improving the message for easy and better understanding for the end user

closes odoo/odoo#107498

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-09 10:44:59 +01:00
Nicolas Bayet 34b1f71491 [FIX] web_editor: spellcheck properly on Safari
Before this commit, when using the spellcheck of safari, the selected
word was interpreted as the text "#" by the editor.

task-3093997

closes odoo/odoo#107563

X-original-commit: b8d1ff6bc39530e601baa29971bca720e2dd06cf
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-09 09:44:25 +01:00
Sébastien Geelen (sge) 9d1422f9d5 [FIX] web_editor: better command condition
Improve a condition to be more inclusive
and be truthy in some rare cases.

closes odoo/odoo#107545

X-original-commit: 51e37c00c749e6bf033317c612856d15daf6c39d
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-09 09:44:23 +01:00
niyasraphy 81a31d547c [FIX] point_of_sale: pos report wizard o2m tree width
in the wizard of sales report in point of sale module, the one2many tree's width is more than the screen size due to given col=4 and scrolling option is shown.

Point Of Sale -> Reporting -> Sales Details

closes odoo/odoo#107241

X-original-commit: b1e1ae315e7ff3e22e7533a602cea0e150eafb75
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
2022-12-09 09:44:20 +01:00
Nshimiyimana Séna bbca44b1a3 [FIX] web: make list view table borders visible in Firefox
## Steps to reproduce
* Using Firefox, Go to Accounting > Invoices > create a new invoice.
* Add a line to the invoice and remove the label.

You should see that there's no indication that the label field is
required. (It works well in Chrome)

## Cause
This is happening because the table borders (that become red when a
field fails validation) are not displayed in Firefox.

opw-3040299

closes odoo/odoo#107564

X-original-commit: 74726c649fa5bddec30573c18acd11020302d093
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Nshimiyimana Serge Séna (sesn) <sesn@odoo.com>
2022-12-09 08:46:10 +01:00
xO-Tx 3eebf5e384 [FIX] web: properly handle RTL direction for autoMoreMenu
Issue:

1. Install eCommerce + set up "Contact" header (there are probably other
   configurations where this bug occurs but this one fails for sure).
2. Go to website in english version (with few menu items on header)
3. Switch language to Arabic
=> The "+" dropdown appears on the header even when there is enough
   space for other menu items.

Explanation:

The 'AutoMoreMenu' option is used on website menu to auto adapt the
header layout so that elements are not wrapped on a new line (and sets
a "+" dropdown that contains the overflowing menu items).

When the language is switched to Arabic (or any RTL language), the
current code ('computeFloatOuterWidthWithMargins()' method) won't be
able to compute the reversed margins correctly for "unfoldable" items:

For example, if we want to compute the width (including margins) of the
"user dropdown":

============================================
IW -> Initial width value (without margins)
LR -> Left margin computing
RM -> Right margin computing
============================================

A- On English version (LTR):

1- LM: item has left auto margin class -> left margin won't be added.
2- RM: item has no right auto margin class -> right margin added (=== 0)
3- The final width is the same as the initial value (IW).

B- On Arabic version (RTL):

1- LM: item has left auto margin class -> left margin won't be added.
2- RM: item has no right auto margin class -> right margin added (> 0).
The right margin value added here is just the left auto margin
reversed because of direction. The code will return a final width > IW
and since the item is "unfoldable", its width will reduce the available
space for foldable items.

Solution:

The goal of this commit is to make the code smart enough to avoid adding
wrong right/left margin value caused by left/right auto margin class
on 'RTL' direction.

opw-2963123

closes odoo/odoo#107573

X-original-commit: 8a4a59389338ad1f50c08df3d55c267ca4d830da
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-12-08 19:59:17 +01:00
Kevin Baptiste 270b9aa7c3 [FIX] hr_org_chart: don't loop when own manager
When an employee was their own manager, the org chart would be filled
with their own name.

task-3093917

closes odoo/odoo#107546

X-original-commit: 53f9359d84a6bb500db693298a12608964a0a118
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-12-08 18:00:29 +01:00
Antoine Guenet afbe0de46f [FIX] web_editor: paste a full table after copying custom-selected table
With the tables' custom selection in the editor, copy-pasting from a
table became awkward. This ensures that copying (from) a table in the
editor guarantees a valid table on paste.

task-3061274

closes odoo/odoo#107544

X-original-commit: 9730a1f1e0053cc9633faaf0ffb424ae373bbc38
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
2022-12-08 18:00:24 +01:00
yhu-odoo 603b0ee228 [FIX] purchase,sale: Error when no partner_ids
Since #106658,
https://github.com/odoo/odoo/blob/348265db3ddb90a982b0fb60f2d8b1085ceaaf2a/addons/purchase/models/purchase.py#L338
https://github.com/odoo/odoo/blob/348265db3ddb90a982b0fb60f2d8b1085ceaaf2a/addons/sale/models/sale_order.py#L1198
trigger error when no partner_ids in kwargs.
Fix them.

closes odoo/odoo#107521

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-12-08 18:00:21 +01:00
Bastien (bvdn) 65893b50fa [IMP] project: change stage_display string in 'My/All Tasks' list view
Small fixup for already merged PR: 103318
stage_display column should have 'Stage' as a header, not 'Stage Display'
added the stage_display field to 'All Tasks' list view

Task-3024152

closes odoo/odoo#107407

Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-08 18:00:18 +01:00
Nikunj Ladava 3abc5097f2 [FIX] event_sale: show correct amount in printed ticket
As multiple tickets can be sold in a single sale order line, we should not
display the line total amount on printed tickets but the unit price instead.

Task-3078743

closes odoo/odoo#107530

X-original-commit: 63d786e67006405140e3198543640edf4b4edb1b
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-08 16:58:58 +01:00
Hugo Carlier (Huca) 27e64cf856 [IMP] sale_project: modify fields order in form view of tasks
- project.task form view - the fields
'planned_date_begin' and 'planned_date_end' are displayed after the
customer field (or after the SOL field if it exists)

Task-3046210

closes odoo/odoo#107502

Related: odoo/enterprise#34782
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2022-12-08 16:58:55 +01:00
Thomas Lefebvre (thle) 29ec845109 [FIX] onboarding: modify access rights for onboarding model
Steps to reproduce:
    - install Calendar and Appointments apps;
    - give "Access Rights" for administration to a user;
    - go to calendar app with this user.

Issue:
    The user does not have access to the calendar.

Cause:
    The user has no access rights for the onboarding model.

Solution:
    Check that the user belongs to the "group_system" group in the onboarding model controller.

opw-3083014

closes odoo/odoo#107514

X-original-commit: fa7dc387154c65ef07af1f903fa25ca5d2e890f9
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-12-08 15:51:31 +01:00
Guillaume (gdi) f7311cf3db [FIX] website: prevent console errors when changing connectors type
Since [this commit], a new option is available on the steps block to
change the style of the connectors. Unfortunately this was causing
errors in the console. This commit makes sure that we don't have these
errors in the console anymore.

Steps to reproduce the issue:
- Drop a steps block on a page
- Change the type of the connectors

=> Errors are displayed in the developer console.

[this commit]: https://github.com/odoo/odoo/commit/aba31e9f2d8a44ce1586403f2a621a6caeed57b4

task-3069766

closes odoo/odoo#107511

X-original-commit: c1805fc5d3c3eeaa5c2edca69a6b9375f4ea1a39
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
2022-12-08 15:51:21 +01:00
Victor Feyens 6e11f14970 [MOV] sale: merge sale & sale_enterprise
Now that dashboard views have been removed, there is no reason
to keep a dedicated module with 2 custom fields that could be
in community.

* Move sale.report fields:
  * invoice_status field is simply moved as is
  * avg_days_to_confirm is removed, as it was only used and meaningful in the dasbhoard view
* Merge views content inside the parent view

Task-3011195

closes odoo/odoo#104920

Related: odoo/enterprise#33588
Related: odoo/upgrade#4010
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-12-08 15:51:16 +01:00
Ricardo Gomes Rodrigues (rigr) 6db6eb60e6 [FIX] l10n_multilang: CoA not translated if the language is installed after the CoA
Currently there is a bug where the Chart of Accounts is not translated if the language is installed after the CoA.

Steps to reproduce:
1. Create a CA company (where both French and English are used)
2. Set the CA Chart of Accounts
3. Go to the general settings
4. Add the French language and switch to it
5. Go back to the CoA
6. The CoA is not translated

This is because the variable `installed` is wrongfully placed in the code. In the current flow, we install the new language, then we check the installed language, therefore the new language is marked as an already installed language. Therfore the `to_install` variable will always be empty.
This commit fixes this by first storing the already installed languages, then installing the new one, and then compute the ones to install making sure that the newly installed one will be used afterwards to translate the Chart of Accounts.

task-id 3091315

closes odoo/odoo#107500

X-original-commit: a3c3c3ccfc8e769ce39dbf38263f92e449b44abb
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2022-12-08 14:44:20 +01:00
Jérémy Hennecart (jeh) 348265db3d [FIX] mass_mailing: send at least one a/b test if possible
When there is not enough recipients for the A/B testing percentage,
we pick a minimum of one recipients (if there is at least one) to
avoid sending a/b test to no one.

task-2713198

closes odoo/odoo#107488

X-original-commit: e1fa7b10250efc790452f02490ab84d2183698ff
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-12-08 13:38:25 +01:00
dht-odoo 6bfe126313 [FIX] mass_mailing{_sms}: respect mailing_type when comparing a/b mailings
Before this commit
- When we were comparing versions, there was no such filter as
  mailing type. Due to this it will display both SMS and mail
  type records in it.

With this commit
- We have added '('mailing_type', '=', self.mailing_type)' in domain
  of compare version.

TaskId-2713198

X-original-commit: e8542e24597ad25b68104c03d4d4ed41e1efac82
Part-of: odoo/odoo#107488
2022-12-08 13:38:24 +01:00
dht-odoo 91a223bd52 [FIX] mass_mailing: disable A/B testing cron by default
Before this commit, the A/B testing cron was active by default.
It doesn't matter if A/B testing is true or false in settings.
So, with this commit, we set active equals to false by default
in the A/B testing cron. It will be active when the user sets
`group_mass_mailing_campaign` to True.

TaskId-2713198

X-original-commit: b348f8658f87c15d0fe4ee72888e99da2a529700
Part-of: odoo/odoo#107488
2022-12-08 13:38:24 +01:00
Nicolas Bayet 569407d1a0 [FIX] web_editor: replaceMedia on contenteeditable
In website, clicking on the snippet option action "Relpace" did
not work for an icon inside s_social_media as s_social_media is
contenteditable false.

The code was simulating a double click on the icon to open the media
dialog but in the double click handler, a check is made to prevent
the media dialog to be shown if the contenteditable is false. This
is important for the knowledge app to prevent changing a button inside
a knowledge view.

task-3086881

closes odoo/odoo#107487

X-original-commit: 3339c50fbebca8a6d419df4ab14ef03952ea6635
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-08 13:38:19 +01:00
Antoine Guenet 0c2015ee0e [FIX] web_editor: prevent closestElement traceback with comment nodes
Comment nodes don't have a `closest` method so when passing one to
`closestElement`, the method crashed.

----

Step to reproduce in website:
- Go to debug mode and to website app
- Click on configuration > websites
- Select a website and in the `custom_code_footer` field add an HTML
  comment
- Go to the website and try to enter edit mode -> Crash

The same error will be visible if you simply enter edit mode and drag &
drop the "Code" snippet and enter an HTML comment inside it.

-----

Step to reproduce in marketing automation:
- Install marketing automation
- Click on a campaign > Add a new activity
- On the mail template field, type something > Create and edit
- Select plain text -> `element.closest is not a function`

----

task-3083797
opw-3081323
opw-3081278

closes odoo/odoo#107486

X-original-commit: 3a9177dd6a6f12f75d0df8146b692e3486f2467c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-08 13:38:17 +01:00
Touati Djamel (otd) 515fbccae3 [FIX] mrp: do not convert the quantity if there is no BoM
Steps to reproduce the bug:
- install “mrp_mps”
- Create a storable product “P1”
    - routes: Manufacture + MTO
    - make sure there is no BoM set

- Go to “Master Production Schedule”:
    - Add the product “P1”
    - Add a quantity and click on “Replenish”

Problem:
A User Error is triggered with the following message: `The unit of
measure Units defined on the order line doesn't belong to the same
category as the unit of measure False defined on the product. Please
correct the unit of measure defined on the order line or on the product,
 they should belong to the same category.`

The `compute_qauntity` function is called to convert the qty into the
UoM of the BoM, but since there is no bom, an empty record is given as
a parameter:
https://github.com/odoo/odoo/blob/8c5fb8b71538462422c8f166b772b5e316ecd6b5/addons/mrp/models/stock_rule.py#L122

https://github.com/odoo/odoo/blob/0f91970020af640faa3a06369fa888315f83f98f/addons/uom/models/uom_uom.py#L215

opw-3085227

closes odoo/odoo#107476

X-original-commit: 7d0df9035cf603ed25ef88a3cf99ed89aef6771e
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-08 13:38:11 +01:00
Goffin Simon 76199fd956 [FIX] delivery: Multi currencies with free shipping above amount
Steps to reproduce the issue:

- Let's consider two currencies C1, C2
- Let's consider two pricelists P1 in C1 and P2 in C2
- Let's consider that the current company CY has the default currency C1
- Let's consider that the current rate of C1 = 1.0 and C2 = 5.0
- Create a shipping method SM with fixed price = 50 and free shipping is above 100 (expressed in company currency)
- Create a SO with P2 and add a line with a product of 200 C2 (equal to 40 C1)
- Add shipping method SM

Bug:

The shipping was considered as free but the total of the SO was not above 100 in the currency of the company

opw:3010266

closes odoo/odoo#107456

X-original-commit: c93ab6615f0370963b152cc0320478fe4ceed164
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-12-08 13:38:06 +01:00
yhu-odoo 589622e82e [FIX] mrp: qty_remaining missing dependancy
To reproduce:
Create a MO without product_id, then add a new line in work orders.
Error raises.

Since cab8d8fe7f744fb4dd0cd61b624f6f4519eb8d8d, we started to show
qty_remaining of WO on MO form. It triggered the compute function of
qty_remaining. Since we don't set product_id, production_id.product_uom_id
is not provided when doing the calculation.

To fix, add production_id.product_uom_id as dependancy of qty_remaining,
and don't do the calculation without it.

opw-3092723

closes odoo/odoo#107434

X-original-commit: 0b10241c0bcbecda73dae04c8a5f1ceb8033a388
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Yuchen Huang (yhu) <yhu@odoo.com>
2022-12-08 13:38:00 +01:00
Eteil Djoumatchoua (etdj) bb12e9632c [FIX] sale_product_configurator: Track custom values when adding an item to cart from the website
Steps to reproduce the issue:
- Go to the website shop
- Select a product which allows custom features (eg. Customizable desk)
- Select custom and enter a value
- Add to cart

Issue:
Neither the modal preview nor the cart of the added item doesn't show the custom value, also it
doesn't appear in the created sale order

Cause:
The optional sale_product_configurator module hasn't implemented it

opw-3052987

closes odoo/odoo#107335

X-original-commit: 954653062ad6060babb77a712b269337b479fa65
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-08 13:37:54 +01:00
niyasraphy 40d86ef921 [FIX] hr_skills: remove duplicated model definition
closes odoo/odoo#106993

X-original-commit: 8a32755ce90ffd4edbcde1af363e1808a7f09c03
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-12-08 13:37:52 +01:00
Nasreddin Boulif (bon) e10a8d21ac [FIX] l10n_din5008_sale: add translation for DE language
Steps to reproduce:

- Install modules `l10n_din5008_sale` and `sale_management`
- Activate the language `German/Deutch`
- Create a new quotation
- Set a customer with `German/Deutch` as language
- Add a product then print the quotation

Issue:

  Some sentences are not translated.

Cause

  Missing translation files.

opw-3052426

closes odoo/odoo#107454

X-original-commit: 6b990318a142fe83009a54cd967f4d23ef939327
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
2022-12-08 11:29:24 +01:00
clesgow 043cf8e418 [FIX] stock: Fix package_level unlink
Steps to reproduce :
- Create two products
- Create a planned internal transfer with one of each product from Stock
-> Location A
- Hit "Mark as todo"
- Hit "Put in pack"
- Validate the picking
- Create an new planned internal transfer, with the same products and
quantities, but from Location A -> Location B
- Remove the destination package for one product.
- This will remove the destination package for all products in the same
package.

When unlinking a package level, it will unlink all moves and move_lines
at the same time. Problem is that if a single move_line is updated in a
picking where multiple move_lines are in the same package, it will
unlink it for all the move_lines instead.

closes odoo/odoo#107448

X-original-commit: 9dcbc420f50ece3356dff57cbdc467c7893ff2c2
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-08 09:45:01 +01:00
Guillaume (guva) 924ffcaa52 [FIX] account: adapt query for items to reconcile
Changing the bank account on the bank journal led
to a traceback (expected singleton on currency_id)
when trying to open the reconciliation widget.
This is because we are trying to open a blank line
as the origin line was linked to the origin Bank account,
therefore there is no currency_id.

It has been decided to filter the statement line that
match the bank account and to adapt the action button.

Steps to reproduce:

- Create a bank statement line
- In Bank journal, change the Bank Account
- From Accounting Dashboard, click on "Reconcile X items" or
  just open the Bank Journal
-> Traceback (expected singleton)

opw-3085670

closes odoo/odoo#107441

X-original-commit: c566a48c5bc528a140e6f29399ca1fbcede60490
Related: odoo/enterprise#34762
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Guillaume Vanleynseele (guva) <guva@odoo.com>
2022-12-08 09:44:56 +01:00
Lucas Lefèvre adc972e67e [IMP] spreadsheet: update o_spreadsheet to latest version
https://github.com/odoo/o-spreadsheet/commit/300da461 [IMP] style: add vertical text align option
https://github.com/odoo/o-spreadsheet/commit/b4c1339c [IMP] doc: improve custom function documentation
https://github.com/odoo/o-spreadsheet/commit/329d1aaa [FIX] figure: Prevent the figure from moving to far.
https://github.com/odoo/o-spreadsheet/commit/5eb41878 [FIX] format: SET_DECIMAL of cells with default format
https://github.com/odoo/o-spreadsheet/commit/606cbb27 [FIX] composer: display raw content of NumberCell
https://github.com/odoo/o-spreadsheet/commit/218052ac [FIX] renderer: negative number with lot of decimal are overflowing
https://github.com/odoo/o-spreadsheet/commit/8dc32cef [IMP] figures: insert images
https://github.com/odoo/o-spreadsheet/commit/4e3a8254 [FIX] tests: typo
https://github.com/odoo/o-spreadsheet/commit/6107b266 [FIX] link display: items are not vertically aligned
https://github.com/odoo/o-spreadsheet/commit/e92c401a [FIX] scorecard chart: Fix empty translation string
https://github.com/odoo/o-spreadsheet/commit/0c76423b [IMP] menu: remove call to isDashboard as menu are never called in dashboard mode
https://github.com/odoo/o-spreadsheet/commit/7548f5b7 [REF] tests: reorganize spreadsheet tests
https://github.com/odoo/o-spreadsheet/commit/08c620dd [REF] bottom_bar(tests): Use generic helper to mount bottom bar
https://github.com/odoo/o-spreadsheet/commit/1fe66362 [FIX] scrollbar: fix the scrollbar full size

closes odoo/odoo#107372

Related: odoo/enterprise#34727
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2022-12-08 09:44:48 +01:00
Rsq 4d3126b748 [CLA] ADD lnf83515
closes odoo/odoo#107411

X-original-commit: fbe7fe7f8e029a4c76589fa5a9892172c226c9ab
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2022-12-08 08:48:48 +01:00
Jorge Pinna Puissant ebbc63dbff [IMP] web: improve setting search
Before this commit, the setting search was done exclusively in some
selected texts. These texts needed to be on some specific selectors
(field, label, span.o_form_label and div.text-muted).

Now, all text on a setting are searchable (including the text in
buttons). This commit also re-structure the setting compilers file to
remove the functions outside the class, this is done to standardize the
compilers (setting, form and view).

closes odoo/odoo#107226

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-08 08:48:46 +01:00
hupo-odoo 4f0c264ca2 [IMP] Better fiscal position auto detect tooltip's description
Improved the tooltip description of the 'Detect automatically' field for fiscal positions. The previous tooltip was "Apply automatically this fiscal position" while the new one is "Apply tax & account mappings on invoices automatically if the matching criterias (VAT/Country) are met."

task id : 3088331
PR number : #107092

Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
2022-12-08 07:52:48 +01:00
Morgane (morm) 1e961704eb [FIX] im_livechat: chatbot rules layout
Prior to this commit, the layout of the fields of the form for a rule in
a chatbot was broken because of a missing condition in the
'only_if_no_operator' checkbox label.

closes odoo/odoo#107459

X-original-commit: bcd952f358c06017fc33f3e5af74cf3aff17a18a
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-12-08 01:42:00 +01:00
Aaron Bohy 5a5c2dbbf8 [FIX] web: handle float fields with digits=0
According to the orm documentation, the `digits` attribute of
float fields must be either a tuple (int, int) or a string.
However, people set `digits=0` on a bunch of float fields (some
are there for a while now). Historically, the webclient handled
this as "there's no digits attribute set", so it fallbacked on 2
digits precision.

With the new views, and owl props validation, we assert that the
`digits` props, when given, is an array. In the above situations,
we have a props validation error.

This commit fixes the error by filtering out the `digits` props
when it is not an array, s.t. it keeps working as before (i.e.
fallbacks on 2 digits). In master, we'll remove the fallback.

opw 3083100

closes odoo/odoo#107418

X-original-commit: 36407a9837ba3bf90670ae763751dc631309867b
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
2022-12-08 00:43:08 +01:00
Rodopho Cammarosano de Lima (rcdl) ef41ffbb45 [FIX] web_editor: update z-index in CSS classes
Due to a change in Bootstrap, the tablepicker, the toolbar and the q-web
branching selector were hidden by modal dialogs.

In Odoo 15.0, the included Bootstrap version was 4.3.1, in which
.modal's z-index is set at 1050.

In Odoo 16.0, the included Bootstrap version is 5.1.3, in which .modal's
z-index is set at 1055.

Therefore, the previous z-index value of 1051 is now updated to 1056.

task# 3002456

closes odoo/odoo#107431

X-original-commit: 263137bcd38f788ff96d13d0810df4da13b72a19
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-12-07 22:48:45 +01:00
MerlinGuillaume 92424f5710 [FIX] hr_leave: validate leave in multi-company environment
Validating an employee's leave with multiple companies selected doesn't
work when the employee isn't part of one of the selected companies

Steps to reproduce:
1. Install Time Off
2. Go to General Settings > Companies and create another company
3. Connect as Marc Demo, open Time Off and create a new time off request
4. Connect as Mitchell Admin and go to Time Off > Managers > Time Off
5. Approve and validate the time off request of Marc Demo
6. An access error is raised: `Access to unauthorized or invalid
   companies.`

Solution:
Clear `allowed_company_ids` from the context when we create the
`calendar.event` to avoid raising the error

Problem:
The creation of the `calendar.event` didn't use the correct user's
`allowed_company_ids` in the context

opw-3052973

closes odoo/odoo#107415

X-original-commit: a5ab773378f5ba2241793c536cf141d27d250ae5
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Guillaume Merlin (megu) <megu@odoo.com>
2022-12-07 19:56:23 +01:00
Tiffany Chang (tic) a24d57daeb [FIX] mrp: correct unit cost in bom
Incorrect variable reference + calculation for unit BoM cost for
byproduct/product (to produce) within in BoM overview report. This
was leading to the displayed value having the cost_share being multipled
into the unit cost twice.

Steps to reproduce:

- create component with cost 100
- create BoM with 1 of this component + 1 byproduct with
  qty = 2 and cost_share = 50.00
- click on Overview

result before this commit:
Manufactured Product unit cost = 25.00
Byproduct unit cost = 12.50

actual result should be:
Manufactured Product unit cost = 50.00
Byproduct unit cost = 25.00

closes odoo/odoo#107410

X-original-commit: 2339bed170b5f670b1f5a6cebd533a9cee72d4db
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2022-12-07 19:56:17 +01:00
niyasraphy 50ee5d7a09 [FIX] l10n_pe: documentation link
current link will return 404 error, updating the website link to correct documentation link

closes odoo/odoo#107399

X-original-commit: 33f94926038bb5cf9a9f7feadd2d6596e331b4e1
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-07 18:29:39 +01:00
roen-odoo d06528728d [FIX] point_of_sale: avoid overpayment if no cash method configured
Current behavior:
If the PoS has no cash method configured, and you try to make a
payment with a greater amount than the due amount, you will get an
error message. Because you cannot give money back to the customer as you
have no cash method configured.

Steps to reproduce:
- Remove Cash payment method from the PoS
- Open a PoS session
- Create an order with some products
- Pay the order with a greater amount than the due amount
- Validate the order, you will get an error message

Solution:
If the Pos has no cash method configured, and the user try to make a
payment with a greater amount than the due amount, we will automatically
set the amount to pay to the due amount and show a message to the user.

opw-3061612

closes odoo/odoo#107398

X-original-commit: 6280e5ac921b21d10100cd78a18072120d823aca
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-12-07 18:29:36 +01:00
Adrien Dieudonné 94cb7ba07d [FIX] web: status indicator next to the breadcrumb
Before this fix, the '.o_form_status_indicator' was in the right
part of the control panel.
But on desktop, we want it next to the last breadcrumb item
to cognitively attach the "save status" to the record name.

closes odoo/odoo#107397

Task-id: 3067691
X-original-commit: 24b098767b03c97ffe108a7f8aa0f77c08aecef5
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
2022-12-07 18:29:33 +01:00
Victor Feyens ba9a84e532 [FIX] web: correctly consider monetary fields currency_field
The currency_field shouldn't have to be specified in the view if it has
the same value as the field specification in python.

closes odoo/odoo#107396

X-original-commit: 47cf3688baf6aed6f027fc44db7293d9563789f4
Signed-off-by: Vallaeys Valentin (vava) <vava@odoo.com>
2022-12-07 18:29:31 +01:00
william-andre 8bbf678d8d [FIX] l10n_au: make invoice template primary
We don't want the changes related to a country to affect all the other
countries.

closes odoo/odoo#107395

X-original-commit: 5079ace74958d4acd54d24a95579289a2eda92f1
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
2022-12-07 18:29:28 +01:00
Romain Derie 4b39ad7167 [FIX] website: prevent iframe infinite loop with naked domain/https
If the website domain is wrongly configured (set to a URL that will
actually be redirected through DNS/proxy/cloudflare etc), the website
preview iframe will loop forever.

The wrong configuration this commit is about are:
- Having set the website domain to naked URL while you configured your
  naked URL to redirect to your `www` URL.
- The other way around (`www` to naked URL).
- Having set the website domain to `http` while you configured your
  `http` domain to redirect to your `https` domain.
- The other way around (`https` to `http`) if it's even possible/done by
  someone

While this could just be considered as a misconfiguration, it's a low
effort to support it. Also, the bug it implies is quite critical as the
user can't access his website app anymore (if he is smart enough and
somehow figure it's because of the website domain, he will think about
going to the General Settings to remove the domain).

All in all, it's a low effort to fix a (rare) critical issue.

Step to reproduce (`https`):
- Go to runbot (in `https`, normal way)
  eg: https://21544921-16-0-all.runbot172.odoo.com/
- Edit the website domain and set it to the `http` version
  eg: http://21544921-16-0-all.runbot172.odoo.com/
- Try to access the website app, it will loop forever, indeed:
  1. You are on the `https` URL in your browser tab
  2. The website app will try to load the iframe with the website domain
     as URL, which is the `http` version.
  3. The code in charge of loading the iframe URL (website_preview.js)
     will detect that `http` URL as originating from a different domain
     than the one of the current tab URL (parent window).
  4. In this case, that code will reject that URL and instead load it in
     the parent window URL -> It will basically redirect your whole
     browser tab to that URL.
     This is done as if you are loading the URL of a different website,
     we want you to be completely redirect to this other website domain.
  5. As `https` to `http` redirection (and naked -> www or www -> naked)
     is done at a lower level (through nginx, dns, cloudflare etc), the
     browser will not load the `http` requested URL but redirect and
     load the `https` one.
  6. Now, you are basically back to step 1. and entering an infinite
     loop.

The same issue can be reproduced with naked domain and `www` domain but
not on runbot and difficult in local.

You can also reproduce it in local, but it will just do the useless
redirect once and won't loop as nothing is redirecting the naked to www
in local:
- Edit your `/etc/hosts` file and write
```
127.0.0.1       rde.com
127.0.0.1       www.rde.com
```
- Edit your website domain to `http://www.rde.com`
- Now go to `rde.com:8069`
- It will wrongly redirect to `www` version

-------------

On top of that, the domain misconfiguration would also lead to useless
reload when using the website switcher (it would reload the whole page
instead of just the iframe).

Step to reproduce on local (on runbot it will be replicable but it will
then enter the infinite loop described above):
- (Still with the `/etc/hosts` tweak described above)
- Edit the website_1 domain and set it to the `www` version
  eg: `http://www.rde.com:8069/`
- Edit the website_2 domain and set it to the `naked` version
  eg: `http://rde.com:8069/`
- Open the website app, land on one of the website (and its URL)
- From there, select the other one, it will redirect the whole page to
  the other domain (naked vs www) instead of just reloading the iframe.

-------------

opw-3079168

closes odoo/odoo#107394

X-original-commit: 0808659dd29db938bb6f8386ee2027eafecb2f0f
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-07 18:29:26 +01:00
Chong Wang (cwg) eab341aec3 [FIX] core: drop mismatched and illegal model terms
The model terms translations assume the number of terms in each language of a
model_term translated field should be the same.
However, sometimes the assumption cannot be promised for sake of bad
translations

This commit
1. drops illegal model term translations while translating
2. drops mismatched terms at run-time in case the database has been contaminated

closes odoo/odoo#107373

X-original-commit: f9ab5ca3e99b2883ada18a8f6deb12d45608b43f
Signed-off-by: Raphael Collet <rco@odoo.com>
2022-12-07 18:29:18 +01:00
oco-odoo eaa882cb42 [FIX] account: correct cash basis rounding in multicurrency
// CASE 1: payment with different rate

1) Setup a company in USD, with EUR activated as well

2) Set a rate of 1 EUR = 2 USD for date A, and 1 EUR = 3 USD for date B

3) Setup a Cash basis tax of 1/3, with a non-reconcilable cash basis transition account

4) At date A, create an invoice with just one line with base amount=99.99 EUR ; and using the tax setup in point 3).

5) Register a full payment for this invoice at date B

===> The exchange move created by the full reconciliation consists of cash basis rounding lines for the CABA base received, transition account and tax account. 99.99 USD for the base, and 33.33 USD for the tax. Those are introduced to bring back the total amount in domestic currency to the domestic amounts computed for the invoice at date A.

Impacting the tax account and base received account is totally wrong. When doing cash basis, we want to use the rate of the payment in the amounts that get reported, as it corresponds to the money that actually came in. So, none of the lines impacting those accounts should be there.

Only the line impacting the cash basis transition account is useful, to bring its value back to 0. But it actually corresponds to an exchange difference, and we need to balance it with an exchange gain/loss account. This account can already be set as reconcilable, and if so, will be auto-reconciled. We now choose to only rely on that behavior. The account will not be brought to 0 in domestic currency if it's not reoncilable. If it is, it will create a regular exchange difference entry to handle this case properly.

// CASE 2: multiple payments in foreign currency, at different rates

1) Setup a company in USD, with EUR activated as well

2) Set a rate of 1 EUR = 3 USD for date A, and 1 EUR = 2 USD for date B and 5 EUR = 1 USD for date C

3) Setup a Cash basis tax of 1/3, with a non-reconcilable cash basis transition account

4) At date A, create an invoice with just one line with base amount=99.99 EUR ; and using the tax setup in point 3).

5) Pay 66.66 EUR at date B

6) Make a second payment of 66.66 EUR at date C

===> The problem in this case is that the tax and base amounts in foreign currency (33.33 and 99.99 EUR) will need to be divided by 2 (because we're making 2 payments, hence 2 cash basis entries), and the currency rounding will round these values to 50.0 for the base (instead of 49.995) and 16.67 (instead of 16,665) for the tax. Summing the cash basis moves will hence give a total base of 100, and tax of 33,34, which is wrong.

To handle this, a cash basis rounding of 0.01 EUR needs to be done in the exchange difference entry. The corresponding amount in domestic currency must be computed using the rate of the most recent payment, so it will be 0.05 USD here.

Before this commit, this case behaved as the first one, and brought back the reported amount to the rate of the invoice. Moreover, since it never adjusted the amount in foreign currency, the transition account could not be fully reconciled.

// FIX

To handle both those cases, we now split the behavior of the CABA adjustment:

- For rounding errors: we now check the foreign currency amount, and adjust it if necessary, reusing the rate of the most recent payment. If there is no foreign currency, the adjustement is still done for domestic currency, of course.

- Exchange rate difference of the transition account is not handled there anymore: to do this, the transition account must be reconcilable. In case of rounding error to compensate for, the adjustment line added in the exchange difference entry will be reconciled with the one on the CABA entries and on the invoice, to reach full reconciliation.

In case a transition account is not reconcilable, we only create rounding adjustments, no exchange difference.

closes odoo/odoo#107334

X-original-commit: 01cb7e960f912c4758d30c04653b599937785799
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
2022-12-07 18:29:15 +01:00
Antoine (anso) fa1abe7f2f [IMP] web_unsplash: improve credentials inputs layout
Inputs are displayed on a colored background that made the placeholder
invisible -> fixed in PR https://github.com/odoo/odoo/pull/104136

Apply button's placement made it related only to the second input but
it should not be the case -> Space was created between button and
second input

task-2984182

closes odoo/odoo#107089

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-12-07 18:29:13 +01:00
luvi 60ac6be0d3 [IMP] web_editor: use of the useSpellcheck hook
This commit makes use of the spellcheck hook to only enable the spellcheck attribute
on the textarea element when needed (on focused element). Since form view are now
always displaying a textarea, instead of relying on a readonly state, the textarea
used by the HtmlField always displayed red underline on typos.

This means the UI can become difficult to read if there are multiple red lines in
the text.  Now, it is only present on focused textarea thanks to the useSpellcheck
hook.

This change can be noticeable in many apps, including notes from records and the
Knowledge editor.

A test has been added to verify that the hook enables/disables the attribute on the
contenteditable element used by the html editor..

task #2861428

closes odoo/odoo#106866

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-12-07 18:29:10 +01:00
luvi cc411a5076 [IMP] web: only enable spellcheck on focused inputs
This commit adds the ability to enable spellcheck on input/textarea only
if they are in focus. This avoids the UI to be bloated with unwanted
underlined text on unfocused elements. It is especially useful in a context
of form view in always edit mode.

A core hook has been introduced to allow other components to use the same
behavior without reimplementing it. It is currently used by the TextField.
It means it is also used in the HtmlField. Tests have been written, both for
the field component, and the core hook.

task #2861428

Part-of: odoo/odoo#106866
2022-12-07 18:29:10 +01:00