Commit Graph
147686 Commits
Author SHA1 Message Date
Daniel Reis c4dbd18418 [FIX] purchase: display POs maching same commercial partner
The "Auto-complete" bills field does not show all POs for the Vendor that are waiting for invoices.

To reproduce the issue:

    - Create PO1 Vendor = "Supplier"
    - Create PO2 Vendor = "Supplier, John Doe"
    - Create Invoice for PO2
    - In the PO2 Invoice, "Auto-Complete" field try to select PO1, but it is not shown.

The "Auto-complete" bills field should show all POs for the Vendor that are waiting for invoices.
The problem is that the field's domain filters is using the partner_id
field when it should be using teh commercial_partner_id.

opw-2684409

closes odoo/odoo#79438

X-original-commit: d3002116e665d799ba11b9f94e4b45bc4c39bde5
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-05 16:51:54 +00:00
Aurélien (avd) f74eb30709 [FIX] mrp: restrict _post_process_scheduler search domain
stock.orderpoint._post_process_scheduler confirms
productions after procurements have been run.

This was introduced to avoid conflict between
procurements, conflicts that can happen e.g. in
the purchase_mrp module.

However, currently action_confirm might
also be called on done or cancelled productions.
That can happen if there are already been lots
of procurements for the same product/orderpoint,
i.e. MO with the same values have been created multiple times.

To avoid this, add ('state', '=', 'draft' in the search_domain.

opw-2666960

closes odoo/odoo#79437

X-original-commit: 11c7b92f90804a4d73833e22c071e1665058fbdb
Signed-off-by: Arnold Moyaux <arm@odoo.com>
2021-11-05 16:51:51 +00:00
Xavier BOL (xbo) 708861ed3d [IMP] project: manage column_invisible in project sharing list
Before this commit, it was impossible to to hide a column when the
timesheets or subtasks features are not enabled to the project shared.

This commit manages the column_invisible for the list view in project
sharing to compute the domain in this modifiers. We assume all tasks
displayed in project sharing are linked to a project shared.

task-2633229

closes #77156

X-original-commit: ab2b5d1fd1f09d804ab410bc326cfebf26d5a7c6
2021-11-05 17:16:13 +01:00
Xavier BOL (xbo) fbac7f191d [FIX] project: exclude project sharing assets qweb from web.assets_qweb
Before this commit, we import all xml in project module. The problem is
the ones for project sharing should not be included in `web.assets_qweb`.

This commit excludes the project sharing assets from `web.assets_qweb`.

task-2633229

closes #77156

X-original-commit: 21e21d7956d6de1775f4230060cdff7c39015bbc
2021-11-05 17:16:09 +01:00
Xavier BOL (xbo) d3b8d1fd31 [FIX] project: remove 'Share with all users' checkbox in project sharing
Before this commit, the portal user could see the checkbox in search
view to share his favorite item with all users. This action is not
authorize in project sharing feature and should be removed.

This commit removes this checkbox to avoid the portal user to share his
favorite item with others users.

task-2633229

closes #77156

X-original-commit: 19b38074dd8bfe4d8347db31f946beeb2850d453
2021-11-05 17:16:05 +01:00
Xavier BOL (xbo) c2e8148368 [FIX] hr_timesheet: fix access error when load_views in project sharing
Before this commit, when the user chooses to encode in 'Days', the
timesheets, when a collaborator accesses to the project sharing feature
for a shared project. This collaborator has an access error because he
does not have any access to `uom.uom` of the current company. Indeed, we
use this uom to change the label of `unit_amount` field for
timesheets linked to this project shared.

This commit fetches the name of the encoding for the current company in
sudo to change the label of `unit_amount` field of timesheets during
the load_views of project sharing feature.

task-2633229

closes #77156

X-original-commit: 575315744a31a975208c82f72403ecebf3585f37
2021-11-05 17:16:01 +01:00
Xavier BOL (xbo) f7bcc14d25 [FIX] hr_timesheet: show total_hours and progress if allow_timesheets
Before this commit, those columns are not invisible if the project has
not allow_timesheets enabled (or not allow_subtasks for "Total Hours"
field) in list view of project sharing feature.

This commit changes the attrs of those field to hide the column if the
domain is satisfied.

task-2633229

closes #77156

X-original-commit: 3856024d037a86a07703cc492f7cc41be93169de
2021-11-05 17:15:58 +01:00
Xavier BOL (xbo) 95c0fe5729 [FIX] project: favorite menu in project sharing
Before this commit, when the collaborator clicks on the favorite menu,
he has a traceback because the 'spreadsheet' service is not available.

Since we don't want to use this service and we just want the menu item
to save the current as favorite. This commit override the favorite menu
to remove the registry items to add the menu item and we just add the
one we want.

task-2633229

closes #77156

X-original-commit: d970c13494db2c3e085155b7855b656fbbe26467
2021-11-05 17:15:54 +01:00
Xavier BOL (xbo) 614657d799 [FIX] project: show 'Assign To Me' only if the user is not assigned
Before this commit, when the task has a user assigned to a task and the
current user wants to assign himself to this task. He cannot see the
'Assign To Me' button because this button is only visible if the
`user_ids` field is empty.

This commit changes the visibility of this button to show this button
only if the current user is not yet assigned to the task.

task-2633229

closes #77156

X-original-commit: cfba241bada2b3690b4303b7e01747301925d162
2021-11-05 17:15:47 +01:00
Xavier BOL (xbo) adf3aca403 [FIX] project: use task in sudo for classic portal task view
Before this commit, when the portal user has access to a project and a
task has a customer who is not in the same company than the portal user,
the portal user has a AccessError when he wants to consult this task.

This commit uses the task in sudo to have the same information shown in
/my/task/<id of the task>.

Steps to reproduce:
------------------
1. Share in readonly mode a project to the portal user (with
visibility set to 'portal')
2. Create a task in this project and set a Customer A (a customer who
has not the same company than the portal user).
3. Log in as portal user (Joel Willis).
4. Go to '/my/projects' and select the project shared.
5. Select the task created.

Actual Behaviour:
----------------
AccessError exception is displayed because the portal user has no access
to partner in other company than his yours.

Expected Behaviour:
------------------
Display the task portal form view like the one shown in /my/task/<id of
the task created>.

task-2633229

closes #77156

X-original-commit: 3b0d6d0cef73baa5b5f235c3518c8bd698c81e21
2021-11-05 17:14:46 +01:00
Xavier BOL (xbo) aeac9052b8 [FIX] portal: get all options when we reload the chatter
Before this commit, we use the defaultOptions and the options passed in
parameter of the `_setOptions` method, but we could have any unupdated
options in the `this.options`.

This commit creates a new object with the defaultOptions and the options
containing in `this.options` before update this object with `options`
given in parameter to have the new `this.options`.

task-2633229

closes #77156

X-original-commit: 5d1a36bdd530d4037d4f29dc607907d79d18dcc6
2021-11-05 17:14:42 +01:00
Xavier BOL (xbo) c0c1af4ca2 [FIX] project: see custom kanban state label
Before this commit, the user could only see the default kanban state
label in kanban state label. That is, "Ready", "Blocked" and "Normal".

This commit allows to see the custom kanban state label in project
sharing feature.

task-2633229

closes #77156

X-original-commit: a9a884cfe1f8328ae71edc93832e4c4408d9c581
2021-11-05 17:14:38 +01:00
Xavier BOL (xbo) 9089dfef5e [FIX] project: allow edit priority task in project sharing
Before this commit, the `priority` field in task was in readonly in
project sharing feature.

This commit allows the `priority` field in task be edited by a portal
user in project sharing.

task-2633229

closes #77156

X-original-commit: 62572e17d6cd62f16287d530c247dbe9b8501e0c
2021-11-05 17:14:33 +01:00
Xavier BOL (xbo) 6e53c8e1d5 [FIX] hr_timesheet: display subtask hours in project sharing form view
Before this commit, the portal user cannot see the subtask planned hours
because the portal user has not the group implied by the res config
settings of Project App.

This commit removes the check of this group for project sharing feature
to only use the `allow_subtasks` field.

task-2633229

closes #77156

X-original-commit: 466ac140587811f1ca5c8a5f3960a40710ac635d
2021-11-05 17:14:30 +01:00
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 9320b1b4f1 [FIX] pos_restaurant: submit order lines only once
This commit reverts [1]. Otherwise, the same order lines may be
submitted several times.

To reproduce the issue:
(Use demo data)
1. Point of Sale > Configuration > Order Printers, edit Kitchen Printer:
    - Printed Product Categories: Food
2. Edit the POS Bar:
    - Enable Order Printer
3. Start a session of POS Bar
4. Select table T1
5. Add a Bacon Burger and submit the order
6. Open another table
7. Reopen table T1
8. Add a Cheese Burger and submit the order

Error: The ticket sent to the kitchen has the bacon burger and the
cheese burger. Only the last one should be sent to the kitchen

When selecting a table, a RPC call gets all information about the
current order. In the server response, the orderlines are sent as new
records:
https://github.com/odoo/odoo/blob/629a4f34ea66f10a981f4b25d5d69281f62853b6/addons/pos_restaurant/models/pos_order.py#L88
Therefore, the orderlines will have a new ID. However, since [1], the
lines identifiers are used to know which lines have changed. This
explains why the bacon burger is sent twice.

[1] 8159e5ac93b18d147fc8688f1dc48f75cbd44a9b

OPW-2678701

closes odoo/odoo#79436

X-original-commit: 75fb0aa6e9c314b61b30d49b5c463fa126dfc835
Signed-off-by: Masereel Pierre <pim@odoo.com>
2021-11-05 16:03:07 +00:00
Florian Damhaut df28381992 [FIX] mrp : Auto-fill Number of SN for mass produce
Current Behaviour :
When mass producing with SN, the default number of SN to generate is set to 0.
Behaviour after the PR :
When mass producing with SN, the default number of SN to generate is the number of item to produce.

opw-2680306

closes odoo/odoo#79431

X-original-commit: 38e5d002acc2e516987acc0afe38648473fff708
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
2021-11-05 16:02:59 +00:00
Vincent Larcin d12c747002 [FIX] sale_timesheet: remove empty sections from project updates
With the sale_timesheet module installed, some Project Updates can contain an "Activities" section in the description, despite there being no activities to be shown, and some empty divs.

This commit will remove all of those unnecessary sections, which also spares us an expensive call to `project._get_profitability_common()`.

Task-2675389

closes odoo/odoo#79415

X-original-commit: 0741dde0598186d395a06ab6a9ea7056f0ff00ff
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2021-11-05 14:32:47 +00:00
Tiffany Chang (tic) b57f155075 [IMP] stock: add missing 'res_model' for auto-open reception report
Previously it did not matter that we didn't explictly include the
'res_model' in the action when auto-opening the reception report on
validation. With the barcode OWLification refactoring we now need to
include it otherwise it will never open when a barcode picking is
validated.

Part of Task: 2632884
Related ENT PR: odoo/enterprise#20805

closes odoo/odoo#79408

X-original-commit: a966e9d122b6fa91906260e82eaea1ed720bd076
Related: odoo/enterprise#22122
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2021-11-05 13:48:51 +00:00
Tiffany Chang (tic) a44dda1a90 [IMP] stock: conditionally show "Allocation" (reception report) button
Simplify user workflow by not showing the "Allocation" button in the
(batch) picking form view if there is nothing to allocate (i.e. when
reception report is enabled).

Also:
- fix the location search condition for the outgoing moves that can
  be allocated to (i.e. the same logic used in show_allocation field
  compute logic is also used in reception report generation/auto-opening)
- replace ['stock.location'].search() with ._search() for better
  performance.

Part of Task: 2632884
ENT PR (for barcode equivalent): odoo/enterprise#20805

X-original-commit: 11ffb85fe7398854e4aefa4f9d0cfbc3b88aad8a
Part-of: odoo/odoo#79408
2021-11-05 13:48:51 +00:00
Tiffany Chang (tic) 9a67190e3e [IMP] stock: improve buttons for reception report
When reception report is viewed in a mobile screen, the "Print Label(s)"
buttons do not fit well, therefore we use a print icon instead of text
when in a mobile view. To ensure it looks good, we also update the
buttons to have equal width/height where applicable.

Part of Task: 2632884

X-original-commit: fadc2dddf12521b0f81096b6225d67951584b714
Part-of: odoo/odoo#79408
2021-11-05 13:48:50 +00:00
Tiffany Chang (tic) 1c97b75c97 [IMP] mrp,stock: always show product in reception report labels
Previously the reception report > "print labels" would only print the
picking name (or SO if provided) + delivery address (if provided) when
not for a MO. Label has been updated to include the product name.

During this update a few other related improvements were made:
- make the label based on stock.move (so extending is no longer
  needed in MRP)
- formatting of label is improved so now address will be truncated
  instead of wrapping (and potentially losing lines at end of address)
- line padding is reduced so we can fit more lines in the label
- "Print Labels" button at source level will now be enabled when its
  corresponding "Assign All" button is pushed (previously only the
  "Print Label"s of each moves' line was enabled.

Part of Task: 2632884

X-original-commit: 9774c1ab1d68cf095b64a82b56f100d747fc8a56
Part-of: odoo/odoo#79408
2021-11-05 13:48:50 +00:00
Tiffany Chang (tic) 23ef79f69b [IMP] stock: link to source origin in reception report
Make it so the (sales order) of a picking is also a clickable link in
the reception report. This was done in a flexible way so it should work
in theory for any stock.move._get_source_document() record, but it is
only applicable to sales orders for now.

Part of Task: 2632884

X-original-commit: d8cd091c3b61ac212fe9e92d532af7cefcf315a6
Part-of: odoo/odoo#79408
2021-11-05 13:48:50 +00: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