Commit Graph
146264 Commits
Author SHA1 Message Date
Xavier BOL (xbo) 5eddca2ace [FIX] project: force the project sharing form view for subtasks
Before this commit, when we do a fields_view_get in unit test, we get
the form view of project task view in backend and not the project
sharing form view in project sharing feature.

This commit adds in the context the `xml_id` of the form view used in
project sharing feature.

task-2633229

closes #77156

X-original-commit: 7dfb44e703f9ff8293412030cfd308e2545f121c
2021-11-05 17:14:26 +01:00
Xavier BOL (xbo) bd4acaa220 [IMP] project: add unit tests for project sharing feature
This commit adds unit tests to check the access of portal user. That is,
we check if the readable fields are only available in read access and
writable fields are available for the edition of the task.
We also check if the other fields in task model raise a AccessError if
the portal user wants to access to one of them.

task-2633229

closes #77156

X-original-commit: 1e7185bcdd8913c006148466dec260b8f6d53c0b
2021-11-05 17:14:19 +01:00
Xavier BOL (xbo) 0f24225bbe [FIX] project: remove the set a cover button in project sharing
Before this commit, we add the Set a cover image in the kanban view of
task for portal user in project sharing feature. However, the portal
user has not access to `ir.attachment` model. So, those users cannot
selects a cover image for a task.

This commit removes this button in project sharing feature.

task-2633229

closes #77156

X-original-commit: 2f8bb52c942416528de4d7d95c53e0ac1c99bf5b
2021-11-05 17:13:43 +01:00
Xavier BOL (xbo) 8f84155337 [FIX] project: not set by default the height of the chatter
Before this commit, the border left displayed when the chatter is aside
the task form view is not from the top to the bottom of the page in
project sharing feature.

This commit removes the fit-content set to the height in css to have the
border left displayed from the top to the bottom as expected in project
sharing feature.

task-2633229

closes #77156

X-original-commit: 886bc7577b2d6f437c28ea18e5786b36930a7cc2
2021-11-05 17:13:24 +01:00
Xavier BOL (xbo) 4c12d0410d [FIX] project: remove checkboxes in list view for project sharing
Before this commit, the portal user can select multiple tasks in the
list view with the checkboxes but no action is available.

For this reason, this commit removes these checkboxes.

task-2633229

closes #77156

X-original-commit: cef79697a014c6443c1d1dfdcf498c18fcb27fb9
2021-11-05 17:13:19 +01:00
Xavier BOL (xbo) 596a676984 [FIX] hr_timesheet: remove avatar widget on employee_id of timesheets
Before this commit, when we use the same widget than backend view, the
problem is the portal user cannot see the avatar picture of the
employees whom are not in the same company than him.

For this reason, this commit removes the avatar widget for this field.

task-2633229

closes #77156

X-original-commit: 3a21160d879d6244527b6b5640f796cfb84edfe2
2021-11-05 17:13:14 +01:00
Xavier BOL (xbo) 7beaa04201 [FIX] sale_project: remove the SO stat button in project sharing
Before this commit, the user can see the stat button but this button is
disabled. Since this button gives no more information.

This commit removes this stat button in the project sharing feature.

task-2633229

closes #77156

X-original-commit: 0e6995533f6733993a4d2554b2ed407f3a3ba3e1
2021-11-05 17:12:15 +01:00
Xavier BOL (xbo) 150686947b [FIX] project,hr_timesheet: add uom in session to use widget
Before this commit, since we don't have the uom in the session, the
timesheet_uom widgets does not work in project sharing feature.
Because those widgets need the uom stored in the session.

This commit adds the uoms needed in the session used for project
sharing feature.

task-2633229

closes #77156

X-original-commit: a8f27ac776e8f381cb467be3a0256b197d6e688f
2021-11-05 17:10:15 +01:00
Xavier BOL (xbo) 0b8961a963 [FIX] project: search view in project sharing feature
Before this commit, we add the same search view than one in backend
views. But some filters are not needed since we display only one
project. For instance, the group by project is not useful since we have
only one project.

This commit removes the groups by project and create_date and add a
separator in filters.

task-2633229

closes #77156

X-original-commit: 1af17e529161bb745a183458b91972fa3a9b69f7
2021-11-05 17:09:53 +01:00
Xavier BOL (xbo) d04b1c2abc [FIX] project: remove import button in favorite menu for project sharing
Before this commit, the portal user can see this button, but this button
should not be accessible by collaborators.

This commit removes the import button in project sharing feature to not
allow this to collaborators.

task-2633229

closes #77156

X-original-commit: 74d7308dfb8df0b923e68aa228ec406e36b0b89a
2021-11-05 17:07:49 +01:00
Adrien Widart aef496fce3 [IMP] stock: display the SM's date on picking form
Adding the date of a SM on the picking form allows a user to reschedule
the delivery of a specific product instead of rescheduling the delivery
of all products.

Linked to OPW-2651828

closes odoo/odoo#79413

X-original-commit: 845f5bdde594f37d42ad12adcbe9489b1b64bd83
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-11-05 13:00:50 +00:00
oco-odoo 2f893dd79b [FIX] l10n_es: check if chart of account is installed in migration
In last added migration script in odoo@b40216a, the code assumes the chart of account of l10n_es is installed. But happens that you may have installed several l10n_* modules, including l10n_es, but not having the chart of l10n_es installed (you have installed the chart of another module).

In this case, then the update crashes because tax_ids is None and tuple(tax_ids) crashes!

closes odoo/odoo#79323

X-original-commit: b7d21a93c9712d96340c5d57eaeb91bae80028b5
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-11-05 13:00:41 +00:00
Aktiv Software f0778bc462 [FW][FIX] sale: properly show order rejection feedback on sale portal
**Description of the issue/feature this PR addresses:**
There is no message shown to guest user on portal when he tries to reject a quotation.

**Current behavior before PR:**
When a guest user tried to reject am order in quotation state the popup just closed and did not give him any feedback or message that why the order is not getting cancelled.

**Desired behavior after PR is merged:**
In the /decline controller there is already a check via has_to_be_signed() method. If the check fails `message=cant_reject` is added to query_string.
On the XML side there is another check made towards has_to_be_signed method which will not render the message.

This commit removes the duplicate check from XML side and the message is now shown correctly to the portal user.

Fixes #79205

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#79409

Forward-port-of: odoo/odoo#79207
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2021-11-05 11:45:38 +00:00
Raman Salihi 4cad597041 [FIX] base: use display_name instead of name in assert_log_admin_access
`assert_log_admin_access` uses the `name` field of `ir.module.module` for logging.
`assert_log_admin_access` was added to `install_demo` method of `ir.demo` in d345fb649e3e3c1bf141dca49b45503b8b3a7164 but `ir.demo` does not have `name` field, hence causing AttributeError.
The proposed solution here is to use `display_name` instead

closes odoo/odoo#79398

X-original-commit: 9d6f54e7f7219cbbda41129e35682f6a76aae1d4
Signed-off-by: Julien Castiaux <juc@odoo.com>
Signed-off-by: Raman Obaid Ahmed (raob) <raob@odoo.com>
2021-11-05 11:00:54 +00:00
Vincent Larcin b70752321a [IMP] project: add demo data for tasks in personal stages
This commit will modify some of the tasks from the demo data to place them in different personal stages for the demo users, to better showcase the feature.

Previously, none of the demo tasks belonged to a personal stage of any user.

Task-2657697

Closes #77870

Related: odoo/enterprise#21463
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-05 11:00:41 +00:00
Vincent Larcin f4373cd034 [IMP] project: indicate private tasks in multiple views
This commit will indicate 'fa-lock private' for the 'Project' field for private tasks in the following views: list, calendar popover, kanban, activity.

Previously, this field was left blank.

Task-2657697

Closes #77870
2021-11-05 11:00:41 +00:00
Vincent Larcin 95b0bcca6d [IMP] project: change default project tasks pivot view
This commit will change the default pivot view for tasks to only show the "Count" measure.

Task-2657697

Closes #77870
2021-11-05 11:00:41 +00:00
Adrien Widart 218db1cd5f [FIX] stock: display 'Order Once' if qty > 0
If the multiple quantity of a RR is less than 1.0, the buttons 'Order
Once' and 'Automate Orders' may remain invisible

(Need sale_management,purchase_stock)
1. Create a product P
    - Type: Storable
    - Add a vendor
    - Routes: Buy
    - Reordering rule:
        - Trigger: Manual
        - Min Quantity: 0
        - Max Quantity: 0
        - Multiple Quantity: 0.01
2. Create and confirm a sale order with 0.50 x P
3. Inventory > Operations > Replenishment

Error: P is present, its qty to order is 0.50, however the button 'Order
Once' is not displayed

OPW-2612472

closes odoo/odoo#79379

X-original-commit: 81b2677677645329999cc496dc961db22bd522dd
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-11-05 10:16:52 +00:00
Thomas Josse e83dfa4eb5 [IMP] website_(sale_)slides: clean frontend onboarding
Purpose
=======

Improve frontend onboarding: add placeholders, improve tour, improve experience
when buying course (display what has been bought, avoid displaying buy now on
an already purchased course).

Specifications
==============

The tour of the front-end has been updated. It adds a step to enter fullscreen
mode and allow users to test it.

It updates the placeholders for the quiz creation, adding examples and hints
to ease user filling fields.

The course purchasing flow has been improved. It adds a direct link to the
purchased course(s) when the payment is done with the `sale_purchased_course`
template.

It also blocks the possibility to rebuy a course if the user is already a
member of said course by showing the buying options only if `channel.is_member`
is False. INdeed it makes no sense to display the "Buy" button when having
already bought the course.

This commit also removes the autocompletion of fields in modals.

Task-2623471

closes odoo/odoo#77050

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2021-11-05 09:31:50 +00:00
desdelinux e0763a9adb [FIX] l10n_pe: l10n_pe_vat_code for VAT must be 0
closes odoo/odoo#76927

X-original-commit: 310835756fac1ce0c92675721e4cf4f5bba98c46
Related: odoo/enterprise#21952
Signed-off-by: Josse Colpaert <jco@openerp.com>
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-05 08:49:47 +00:00
remi-filament 0bcb940511 [I18N] l10n_fr_fec: translate in French
Fixes odoo/odoo#78932
Closes odoo/odoo#79274

closes odoo/odoo#79389

X-original-commit: ec5ac114405e936af1b04be74176f919adb8ec71
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-04 16:51:44 +00:00
remi-filament 5e55653cca [I18N] l10n_fr_pos_cert: translate the module
Fixes odoo/odoo#78932
Closes odoo/odoo#79273

X-original-commit: 73b076df9facdf071c99758a208cbe24f3d1603b
Part-of: odoo/odoo#79389
2021-11-04 16:51:43 +00:00
Adrien Widart 5ec823e9ff [FIX] website_sale_stock: include WH in SO's context
In a multi-warehouses environment, editing the quantities of the cart
products can lead to incorrect behaviors.

To reproduce the issue:
(Let WH01 be the default company's warehouse)
1. Create a second warehouse WH02
2. In Settings > Website > Products:
    - Inventory > Warehouse: WH01
3. Create a product P:
    - Type: Storable
    - Availability: Show inventory on website and prevent sales if not
enough stock
    - Available on eShop
4. Update P's quantity:
    - Location: WH01/Stock, Qty: 10
5. Create a sale order SO:
    - Lines:
        - 100 x P
    - Warehouse: WH02
6. Confirm SO
7. Go on eShop
8. Add P to the cart
9. On cart page, increase the quantity of P

Error: The quantity becomes -90 (then the product is automatically
removed from the cart)

The quantity maximum that the user can select is defined thanks to:
https://github.com/odoo/odoo/blob/8d2fd05382705d4b3987ebac4c842d8507ede9cf/addons/website_sale_stock/views/website_sale_stock_templates.xml#L12

When computing all the quantities (in `_compute_quantities_dict`), if
there isn't any warehouse in the context, the quantities will be
calculated on the basis of all warehouses:
https://github.com/odoo/odoo/blob/48698838dd47442145395d3d4396b64b6901dba1/addons/stock/models/product.py#L238-L248
As a result, in the above case, `virtual_available` will be equal to
`10 - 100 = -90`. However, a SO is linked to a specific warehouse, so
the computations should be based on this warehouse. That way,
`virtual_available` will be 10 and, when editing the quantities in the
cart, the maximum value will be correctly computed.

OPW-2667470

closes odoo/odoo#79370

X-original-commit: 2beb6b1b35ef4c02b6ca1494d1b10fb2cd3b752d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2021-11-04 14:29:39 +00:00
Touati Djamel (otd) fdc2ed1ee6 [FIX] mrp_workorder: fix the WO planned date
we recently fixed this issue via this commit: https://github.com/odoo/odoo/pull/78377/commits/f3bb0dcc013960d6a43b9182b7daa5d33cab5aaa
But we forgot to add a “break” in the loop in order to go to the next available interval when the current interval duration has been used

the test has been modified to better cover the use case

closes odoo/odoo#79361

X-original-commit: b8201b7a523b66cfdbb4a220250608e15d67190c
Related: odoo/enterprise#22096
Signed-off-by: Steve Van Essche <svs@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2021-11-04 13:40:52 +00:00
Laurent Stukkens (LTU) 8abe924d2d [FIX] project: prevent duplication of project update stat button
Prior to this fix:

    The project update stat button is duplicated.

After this fix:

    The project update stat button is no more duplicated.

task-2684233

closes odoo/odoo#79347

Signed-off-by: Xavier <xbo@odoo.com>
2021-11-04 13:40:48 +00:00
Adrien Widart 714fc63ac4 [FIX] mrp: compute MO's components status
The component status of a MO is not correctly computed

To reproduce the issue:
(Use demo data)
1. Create and confirm a MO for 1 x [FURN_9666] Table
2. Unlock and edit the target of To Consume Qty:
    - For [FURN_8522] Table Top: 0.1
    - For [FURN_2333] Table Leg: 0.1
Error: The Component Status of the MO becomes "Available" while Table
Top and Table Leg are not available.

Due to the signature of `float_compare`:
https://github.com/odoo/odoo/blob/56f8c1c0487bf95325ca859e2f266d1beed28ad4/odoo/tools/float_utils.py#L127
`move.product_id.uom_id.rounding` is implicitly given to
`precision_digits`, which is incorrect.

OPW-2669931

closes odoo/odoo#79362

X-original-commit: c7077dedd63ad317517ad383855821e6570b963d
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-11-04 12:58:48 +00:00
Josse Colpaert a33d0f9fdb [IMP] l10n_mx: move demo data put on main company to demo company
closes odoo/odoo#79309

X-original-commit: 419e3cf824aaabf6b92d3f34668a2c4c98b0998f
Related: odoo/enterprise#22070
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-04 11:07:19 +00:00
Hardik Prajapati 3d2fe2f2d8 [FIX] website_forum: fix forum back button url from backend
Currently, when user open the question from helpdesk ticket and
user clicks on the back button of the forum page,
it redirects the user to the app switcher. It happens because the
back button contains the homepage URL as httprequest.referrer
does not support the fragment url with hash(#).

so this commit fixes the issue by binding the onclick event on the
back button so clicking on the back button redirects the user
to the helpdesk ticket.

task-2602604

closes odoo/odoo#77458

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-04 11:07:16 +00:00
yhu-odoo 8e599caf7a [FIX] mrp: trigger RR after change product qty
In 1e93c161ca454313436b65427542db961f6ddcdd we trigger RR when
confirming a MO. Same thing should be done if we changed the product qty
for a confirmed MO.

Task-2653116

closes odoo/odoo#79332

X-original-commit: 22eb5c38ff45f4e5cd5d2025d31960efa051ad6b
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-04 10:22:02 +00:00
Andreas Perhab cc4b2b2ffd [IMP] readme: use https urls
For status images

closes odoo/odoo#79297

X-original-commit: e2bccd33e157542c37528ce159577e1574b63fdc
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2021-11-04 10:21:58 +00:00
svs-odoo 15f27dde29 [REV] repair: fix repair mail template
This reverts commit 3b3a47f0d3414ae5bee159f6ec4644e64441040f.

task-2667207

closes odoo/odoo#79333

X-original-commit: 09cb77ebf6915e6a98bc3d36869b71f5b495d878
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Steve Van Essche <svs@odoo.com>
2021-11-04 09:39:50 +00:00
Géry Debongnie 2cf87ea02f [IMP] web: update owl to 1.4.8
Release notes: https://github.com/odoo/owl/releases/tag/v1.4.8

closes odoo/odoo#79337

X-original-commit: bfbd0d956f3a7a22a22dfb4c466b7a6f0a916a7d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2021-11-03 19:00:46 +00:00
Nicolas Pierre 1f00ffb0f2 [FIX] stock: inventory adjustments fixes
- When locations are activated, fix not being able to add a quant for tracked products just after
creating one from the 'update quantity' window due to Inventory Adjustment location being auto-selected [since it is the last quant]
 - Fix quant not properly making fields invisible after confirming from the stock track
confirmation window

closes odoo/odoo#79338

Pr: https://github.com/odoo/odoo/pull/78768
Task-id: 2674732
X-original-commit: ff26704e7afaa537530c0e092a88b73ee791775f
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: npi-odoo <npi@odoo.com>
2021-11-03 17:28:55 +00:00
Sébastien Geelen (sge) 66851b042c [FIX] web_editor: fix the beforeunload warning
The warning shown on beforeunload when quiting a page during edition
was missing since the new editor merge.

task-2666177

closes odoo/odoo#79325

X-original-commit: 6a7fa263e72de45d2e92c436321c01c4b70870a8
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-03 16:44:40 +00:00
Hubert Van de Walle (huvw) 5f2c143623 [FIX] web_editor: don't show the active style entry if absent
Steps to follow

  - Edit a report with studio
  - Add an inline text element
  - Select it
  - Select the text in the sidebar
  -> An error is raised

Cause of the issue

  firstButtonEl is undefined because the style section is not always
  present in the toolbar

opw-2674302

closes odoo/odoo#79335

X-original-commit: 45b590d8961d56f8d207c22efbf1ba7188a3b1fa
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-03 16:02:11 +00:00
Tiffany Chang (tic) dd1ea09f34 [FIX] mrp_subcontracting, stock: don't change loc when dupe SN
Previous task: odoo/odoo#61287 improved warnings for when using a
duplicate SN, including an auto-update of the source location when
appropriate. Unfortunately the auto-update is too risky when registering
a subcontracting SN tracked components.

Instead, we no longer update the source location when in a
subcontracting situation and update the warning message to match the
expected flow to fix the issue.

closes odoo/odoo#79334

Task: 2669180
X-original-commit: a430c4d7d6e2a02ef9b3905b554a779fc1643bcf
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-11-03 16:02:07 +00:00
roen-odoo 76b556fd3c [FIX] purchase_requisition : PO Agreements wrong qty ordered
Current behavior:
If you have 2 time the same product in the agreement and you confirm an order with just one line of this item
the 2 lines in the agreement will have the quantity.

Expected behavior:
Only the ordered item should have the quantity applied. In this case the products are compared with the price and
product ID. If you modify the price in the PO the first line of the agreement will have the quantity by default.

Steps to reproduce:
1. Create a new Purchase Agreement
-Add two lines with the same product
- First line has a scheduled date and price that are different from the second line
2. Generate RFQ and confirm PO with only the first product line and a set quantity
3. Once the PO has been confirmed, going back to the Purchase Agreement, the ordered quantities on both lines will be the same, although the PO was generated for only the first line.

opw-2627898

closes odoo/odoo#79322

X-original-commit: c09a16fb2483e8cec4c9c9e6a936ae2bcc490646
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2021-11-03 14:12:46 +00:00
Audric Onockx (auon) 5c09a8d9f7 [FIX] purchase : Account analytic default changed by user is reset in invoice
Reproduce :
1. Add a default analytical rule: if Coin Gourmand partner then Administrative analytical account
2. Create a PO at the Coin Gourmand supplier, add a product, and select the Internal analytical account.
3. Bill for this product.

Result :
Internal analytical account has disappeared from the invoice line. It has been replaced by Administrative.

Issue :
AccountMove.create() computes an account in the move and this causes the analytic account to be reset at its default value from the rule.

Fix :
Since the account pocalypse in 13.0, account.move is making magic things during the creation of the invoice to create dynamically the invoice lines like account.invoice did before this huge refactoring.
The create is making a 'New' record to simulate the onchange but this code is a hack triggering unexpected recomputation like the analytic account.
To avoid that, we ensure to assign the minimum number of fields to preserve fields like the analytic account.

closes odoo/odoo#79321

X-original-commit: 876e2d1073312fe65cb6b2e3038235aeaa082c8a
Related: odoo/enterprise#22074
Signed-off-by: Laurent Smet <las@openerp.com>
Signed-off-by: Josse Colpaert <jco@openerp.com>
2021-11-03 13:26:55 +00:00
Nicolas Bayet bd8260b3f5 [FIX] web_editor: not showing toolbar in theme tab
In the website builder, the toolbar was appearing in the theme tab
incorrectly.

task-2664956

closes odoo/odoo#79311

X-original-commit: a2198490befddb8c4cc6f3a543f47bbffe243f64
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2021-11-03 12:38:59 +00:00
svs-odoo 03676ae11a [IMP] stock: orderpoint by date instead of time
Before this commit, the Replenishment orderpoints `qty_to_order` are
computed according to a precise forecast which take the time in count.
For example, if you plan a consumption for a product with a purchase
lead time of 2 days for the 2021-12-12 at 12:30, if the current date is
2021-12-10, the orderpoint for this product will have a quantity to
order once the hour is meet too but not before. With this commit, it
will take the forecast for the day regardless the time.

task-2652920

closes odoo/odoo#78712

Signed-off-by: Tiffany Chang <tic@odoo.com>
2021-11-03 12:38:53 +00:00
Hubert Van de Walle (huvw) 957ae2b84a [FIX] web_editor: resize the codeview with the field_html resize handle
Steps to follow

  - Go to email templates
  - Select some text
  - Click on the code button
  - Resize the editor
  -> Nothing happens

Cause of the issue

  The default view of the editor is resized but not the code view

Solution

  Change the code view height with the default view

opw-2669259

closes odoo/odoo#79315

X-original-commit: 3adc1ddb04dfc0dcd3b10e56e9ecaef7b04a18d4
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2021-11-03 11:48:51 +00:00
luvi d304be57be [FIX] web: scrolling to anchor working badly
This commit fixes a bug when you clicked on a link related to an anchor.
e.g. an <a> tag with an href="#anchor". The scroll to the element
with id="anchor" didn't happen because the position was not found correctly.
The fix uses getBoundingCLientRect to get more precise positions
of the element with the anchor and the scrollable area.
A test is introduced to check scrolling for multiple anchors in a template
with a more complex structure (Note: the test fails without the fix).
The scroll behaves differently depending if the target is an anchor or
an element. An other test has been added for the command palette about this
behavior.

closes odoo/odoo#79310

X-original-commit: b0da44d62f85d6530f8e568025f7fea25c5454c5
Signed-off-by: FrancoisGe <fge@odoo.com>
2021-11-03 11:48:46 +00:00
Rémy Voet (ryv) 837e72fbfa [REM] base: remove unused code in translate.py
Remove unused code of translate.py file:
- remove unused trans_parse_rml method (since 3425752eac)
- remove unused in_modules method (since eb04aa1e39)
- remove unused ENGLISH_SMALL_WORDS set (since d85bf78976)
- remove unused node_pattern compiled regex (since 085e972e4a)

task-2678192

closes odoo/odoo#79011

Signed-off-by: Rémy Voet <ryv@odoo.com>
2021-11-03 11:06:18 +00:00
Hardik Prajapati 742b4954a2 [FIX] account: reposition tooltip indication
Currently, hovering on the tooltip displays some content out of
the viewport. It happens because tooltip content div requires
270px width to display the text and the distance between the
tour indicator and viewport is less than 270px

so this commit fixes the issue by changing the position of the tooltip
indicator from left to the top so that the tooltip indicator displays
top of the element and hovering on it displays the full content

TaskID-2667140

closes odoo/odoo#79129

X-original-commit: 219d4aa27fbae944af6e18216b7bb96277b3d06d
Related: odoo/enterprise#21946
Signed-off-by: Laurent Smet <las@openerp.com>
2021-11-03 10:05:47 +00:00
Adrien Widart 8728d1ec5f [FIX] mrp_account, sale_mrp: check if BoM line is correct
Suppose an automated AVCO product category. When confirming an invoice,
if the associated product was a kit and if its BoM has changed during
the process, a traceback can occur.

To reproduce the issue:
(Need sale_management)
1. Create a product category PC:
    - Costing Method: AVCO
    - Inventory Valuation: Automated
2. Create 3 products P1, P2, P3:
    - Product Type: Storable
    - Category: PC
3. Update P3's quantity > 0
4. Create two bills of materials:
    - BOM01:
        - Product: P1
        - BoM Type: Kit
        - Components: 1 x P2
    - BOM02:
        - Product: P2
        - BoM Type: Kit
        - Components: 1 x P3
5. Create a sale order SO with 1 x P1
6. Confirm SO and process the delivery
7. Edit BOM02:
    - BoM Type: Manufacture
8. On SO, create the invoice INV
9. Confirm INV

Error: an Odoo Server Error is displayed with a traceback: "[...] in
_compute_average_price, bom_line_data = bom_lines[bom_line] [...]
KeyError: mrp.bom.line(19,)"

On step 7, when changing the BoM type, a new BoM line is created.
Therefore, in `_compute_average_price`, the BoM associated to the move
(i.e., `bom_line`) is not one of the lines in `bom_lines` (i.e., the new
BoM lines). There is already a check in case the line has been deleted,
but not if it has been changed.

OPW-2610685

closes odoo/odoo#78917

closes odoo/odoo#79293

X-original-commit: 3ae0b781bcb5c2840f848bc63b9f3f9e1b2812cb
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
2021-11-03 07:09:39 +00:00
Xavier BOL (xbo) d22c9a540f [FIX] sale_timesheet: avoid using timesheet_grid views
Before this commit, we search grid and form views defined in
`timesheet_grid` module but this module is not available in
`sale_timesheet`.

This commit removes the grid view and use the form view defined in
`hr_timesheet` module instead of `timesheet_grid`.

Steps to reproduce:
==================
1) Go to the project app
2) Select Project updates for a project with `allow_timesheets=True`
3) Click on "Billable Time" button.

Expected behavior:
=================

Open by default the list view of timesheets related to the project.

Actual behavior:
===============

Traceback when the user clicks on this button because it does not found
the grid and form view in `timesheet_grid` module.

task-2665899

closes #78120
closes #79034

closes odoo/odoo#79291

X-original-commit: 9fd8fbe1c778fc05ac9e1441356ac5d0673b9ffc
Related: odoo/enterprise#22056
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-02 16:59:57 +00:00
Xavier BOL (xbo) 2ca28bca34 [FIX] project_timesheet_holidays: take all leaves in given interval
Before this commit, we search the leaves in the same interval of the
public leaves.

This commit searches all leaves containing the public leave in their
interval to get all leaves and not create a timesheet for this public
leave for an employee is already off.

task-2665899

closes #79034

X-original-commit: ca6c164075d83e6bace2451888f8a2365b769e1a
Part-of: odoo/odoo#79291
2021-11-02 16:59:56 +00:00
Xavier BOL (xbo) c348d596a6 [FIX] sale_timesheet: ensure product is a service one for timesheets
Before this commit, since the adding of new field in `product.template`
model called `detailed_type` to define the detailed type of a product.
We need to update some domains to select a correct timesheet product.
That is, the timesheet product must be a service product and not an
event or event booth product.

This commit updates the domains in those fields:
- `timesheet_product_id` field defined in project (`project.project`).
- `sale_line_id` field defined in the `project.create.sale.order` model.
to be sure we select a service product (or SOL with service product
linked) for timesheets.

task-2642872

closes #79034

X-original-commit: b60bc724c197f101d71109d7b8fcdfe7cdc5b57a
Part-of: odoo/odoo#79291
2021-11-02 16:59:56 +00:00
Xavier BOL (xbo) 448fe8fce1 [FIX] sale_timesheet: change is_so_line_manually_edited only manually
Before this commit, when the user creates a timesheet in task form view,
the `_onchange_so_line` is triggered after the compute method of
`so_line`. This behavior is not expected because it break the employee
rate feature to correctly determine the SOL of a timesheet.

This commit deprecates the onchange method to avoid change the
`is_so_line_manually_edited` when the user has not manually selected an
SOL for the timesheet. Instead of changing the
`is_so_line_manually_edited` field in the onchange method, a new widget
is created to override the `_onFieldChanged` defined many2one widget.
This widget will be linked to the `so_line` field in the list and form
view of timesheet. So, when the user manually changes the `so_line`
field, the `_onFieldChanged` method changes the
`is_so_line_manually_changed` to notify that is the user is manually
changed the `so_line` field on a timesheet.

task-2665899

closes #79034

X-original-commit: 9b1bfe597167d1a849ef3df850300ae8ec673fd3
Part-of: odoo/odoo#79291
2021-11-02 16:59:56 +00:00
Xavier BOL (xbo) eb2ba319a1 [FIX] web: fix formatFloat when the value is null
Before this commit, when the value is null in the pivot view on a float
field, we format the value before displaying it. The problem is the
formatFloat method does not check if the value is null and used the
`toFixed` method to fixed the number of digits to display for the value.

This commit uses the value if it is not value otherwise use 0 to fixed
the number of digits. That is, when the value is null, the formatter
will return "0.00" (if the number of digits expected is 2) instead of
raise an error.

Steps to reproduce:
==================

1) Go to the helpdesk App > Reporting > Tickets Analysis.
2) Go to pivot view of this report.
3) Add the measure called "Rating (/5)"

Expected behaviour:
==================

Show the pivot with empty cells or 0.00 if the average of this measure
has no values.

Actual behaviour:
================

Traceback shown because it cannot read 'toFixed' property of null.

task-2665899

closes #79034

X-original-commit: d142705d9262dfa5fb489611ae0b5a2a04ff6fab
Part-of: odoo/odoo#79291
2021-11-02 16:59:55 +00:00