Commit Graph
154090 Commits
Author SHA1 Message Date
Yolann Sabaux 04a352ea76 [FIX] purchase: update analytic account on change of the line
Steps to reproduce:
- create two products
- create two analytic accounts
- create two new analytic rules by assigning an account to a product
- Create a new PO and select on of the product
- On the same line, change the product to the other one

Issue:
- The analytic account won't be updated

Cause:
Bypass of the `account_analytic_id` whenever there is already on defined

Solution:
For the `Sale` fix, I added the `line.state == 'draft'`.
The reason? Because the compute is triggered after confirmation of the order due to:
https://github.com/odoo/odoo/blob/14.0/addons/sale/models/sale.py#L931-L935
Therefore, the compute won't also be triggered after confirmation of the SO.

opw-2948950

closes odoo/odoo#99858

X-original-commit: 61604e18128c1cfd0e6d4e510852f780491d6e4e
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-13 10:30:17 +02:00
Rob Coekaerts 3c6060b7bb [FIX] hr_contract_salary: Fix email in simulation link.
Change the default recipient of the simulation link to be the employee's
work email address, instead of the private email address.

Currently the private email of employees is used for this but this doesn't
work because mail.compose.message does not allow allow private partners
to be configured as recipients. Secondly, it also just makes sense to send
work-related email to the work email address.

In addition, since a partner is automatically created when sending an
email to this work email address (which is currently a string field, a new
field is created to keep track of this partner, in addition to other
partners that might be linked to employee.

task-2790044

closes odoo/odoo#95655

Related: odoo/enterprise#27808
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-13 10:30:07 +02:00
William Henrotin 2a3ff43ff1 [ADD] mrp_workorder_hr_account: analytic accounting for employee in MRP
Create analytic accounting entries for employee times logs on workorder.
Compute BoM costs based on employee hourly cost and employee number
required on mrp operations.

closes odoo/odoo#91565

Task: 2427466
Related: odoo/enterprise#23032
Related: odoo/upgrade#3556
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-09-13 10:30:00 +02:00
Arnold Moyaux d2158f8789 [IMP] mrp: clean productivity timer + hook button start
Part-of: odoo/odoo#91565
2022-09-13 10:30:00 +02:00
William Henrotin 2c65e916fc [IMP] mrp: workorders redesign
This patch is part of a complete rework of the workorder tablet view and general
work order processing experience. It's mainly done in the Enterprise
repo. In community: the changes are the follows:

 - The workorder kanban view remodeled
 - Prepare workorder productivity timer to work with employee

Task: 2427466
Part-of: odoo/odoo#91565
2022-09-13 10:30:00 +02:00
Damien Bouvy 1f8e265e43 [IMP] hr_expense: allow default for the company journal
Revision 26a5653f48 introduced
the possibility to set up a default journal for accounting
entries created by "employee-paid" expenses

This commit adds the same possibility for the "company-paid"
expenses (because why allow it for one and not the other?).

closes odoo/odoo#99993

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-13 09:31:30 +02:00
Eleftherios Kritsotakis ff7637f189 [REM] website_slides: legacy field_float_rating widget
We remove the `field_float_rating` widget in this commit
as is was not used anymore. Its use was dropped at an
earlier PR, however without deleting it.

For reference, we mention here the PRs in which the widget
was firstly introduced and when in was made redundant.
- introduced: #33255
- removed: #55698

closes odoo/odoo#99983

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-13 09:31:26 +02:00
Arnaud Baes 84d17e57e8 [FIX] website_slides: Ensure viewed_slides is a set
Since 5b375d6 `viewed_slides` are now
stored in a set. This is causing issues post migrations because people
still had the list format in their sessions, and this results in a crash
when `.add()` is called on the list.

While deleting the sessions would likely solve the issues, this fix will
spare some troubles for people migrating in the future.

via p/feedback

closes odoo/odoo#99954

Signed-off-by: Florian Charlier (flch) <flch@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-09-13 09:31:23 +02:00
Kevin Baptiste 7a8b88edaf [IMP] hr_recruitment: properly show job creation dialog
The job creation wizard was not properly displayed.

task-2968897

closes odoo/odoo#99802

Related: odoo/enterprise#31151
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-09-13 09:31:17 +02:00
Xavier BOL (xbo) 347f66bc22 [FIX] project: redirect /my/task/<task_id>
Before this commit, the commit [1] renames the routes to keep the url
and add the id when the user selects a task id.
However, the redirection is missing for `/my/task/<task_id>` due to
an issue in the routes selected for the redirection.

This commit redirects the `/my/task/<task_id>` to `/my/tasks/<task_id>`
to keep the old route accessible.

[1] b517fdc19d

closes odoo/odoo#99713

X-original-commit: db379b6838b8883ae8fef2659912854dd08cf31c
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-13 09:31:14 +02:00
Viktors Lipskis (vili) bbf3dedb7a [FIX] mail: fix activity Mark as Done panels
Clicking on kanban activity Mark as Done button now works as expected, either displaying one empty panel or displaying no panels at all.
Before this commit, repeating a click on the button did not reset the panel, so the next click added another form to the panel.
Also, clicking on the button left other panels open.

task-2961943

closes odoo/odoo#98832

Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-09-13 09:31:11 +02:00
Aaron Bohy f42110cbcd [FIX] account: settings view: set invisible on correct node
Before this commit, the title of the container "Fiscal Localization"
was always displayed, even though it has an invisible modifier. The
reason is that the container was never hidden (it always contained
at least an empty div), because the corresponding modifier was set
on a child in the container (its unique child). This commit fixes
the issue by moving the modifier to the container itself. Note
that it also prevents from having an empty div in the DOM.

closes odoo/odoo#100031

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-13 08:34:58 +02:00
Audric Onockx (auon) 0cc8e582ca [IMP] website_slides: create hook to update slides values
With the integration slides-knowledge,
slides can be set on the team, so that the user can be redirected
to them when searching for help.
We want to use the same view as for all slides,
but limit the records presented to the user.

With this commit, we create two distinct methods:
one that prepares the values
one that renders them.
This way, we can hook into the first one to replace the records
before rendering them, when the `/helpdesk/<team_id>/slides`
route is used.

task-2890043

closes odoo/odoo#97739

Related: odoo/enterprise#29283
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-09-13 07:37:56 +02:00
Audric Onockx (auon) 927ec413c5 [IMP] web: allow Record override
With this fix, it will be possible to override Record.

Part-of: odoo/odoo#97739
2022-09-13 07:37:56 +02:00
Benjamin Vray 3036c7dc47 [IMP] website, *: review mobile view layout
*: web_editor, website_blog

This commit improves the mobile preview of websites. A mobile phone
image has been added around the iframe during the mobile preview. This
image was already used for the themes mobile preview, this is why the
css code has been unified to be used in these 2 mobile previews.
Parallel to this commit, we have modified the websites displayed in the
iframe of the preview of the themes so that the scrollbar of these is
visible (before it was hidden behind the image of the phone) but with a
smaller width in mobile mode.

This commit also improves the button to switch to mobile preview by
coloring it green when mobile preview is active.

task-2890050

closes odoo/odoo#98061

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-12 21:07:16 +02:00
Denis Ledoux 26b1c3846d [IMP] base: move TestViews assert methods to ViewCase
The goal is to easily re-use these 3 common methods
for unit tests in module implementing new type of views,
such as `web_cohort`

closes odoo/odoo#100021

Related: odoo/enterprise#31239
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2022-09-12 20:03:18 +02:00
Samuel Degueldre 01aaca36b7 [FIX] web: log source of QUnit test failures in info instead of error
This allows easier parsing of the logs for indeterministic errors, so
that when the same error happens in different build, it has the same
error message, as the stack trace contains the file name of the assets
which get generated with a different hash every time, while also
preserving the existence of potentially useful tracebacks to debug
indeterministic issues.

closes odoo/odoo#100028

Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
2022-09-12 17:33:48 +02:00
qsm-odoo accb4b3245 [IMP] website, *: review website tour utils
*: test_website, website_blog, website_crm, website_event,
   website_forum, website_hr_recruitment, website_mass_mailing,
   website_sale, website_sale_wishlist, website_slides

- Make sure that all website tours reaching the website preview before
  their first step use the related website util to register their tour.

- Rename the website util to register a tour starting on the website
  preview from `registerEditionTour` to `registerWebsitePreviewTour`.
  Having a method using "Edition" in its name and having a boolean
  parameter named `edition` was a bit... strange.

- For both non edit mode and edit mode as a first step, ensure the util
  sets a high timeout for the first step. Indeed loading both the
  backend and the frontend (in the iframe) and potentially starting the
  edit mode can take a long time in automatic tests. We'll try and
  decrease the need for this high timeout of course.

- Review the implementation of those utils to be more consistent and
  also fix one or two mistakes in them.

closes odoo/odoo#100024

Related: odoo/design-themes#588
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-12 17:33:39 +02:00
Aaron Bohy 91e242e1c7 [FIX] web: kanban grouped by date: display None if not set
Before this commit, `false` was displayed as column title in kanban
views grouped by date(time) fields, for the column containing
records with unset value. When grouped by relational and date(time)
fields, we expect `None` to be displayed. This commit restores the
legacy behavior.

closes odoo/odoo#100020

Signed-off-by: Géry Debongnie <ged@odoo.com>
2022-09-12 17:33:35 +02:00
Victor Feyens 2307773338 [FIX] sale: correct display for credit warning
closes odoo/odoo#100019

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-09-12 17:33:32 +02:00
Aaron Bohy 1fb3882cd4 [FIX] web: kanban: display no content helper
The no content helper logic (determining when it is displayed) in
kanban is quite complicated. Apparently, in a kanban view grouped
on a field that isn't a many2one, with no groups (and thus no
records), and where we don't have the "group_create" permission,
we want the no content helper to be displayed. At least, this is
how it used to work in the legacy kanban view. This commit restores
the previous behavior and encodes this situation in a test. In the
future, it would probably be a good idea to sit down and challenge
the corner cases of this feature.

closes odoo/odoo#99914

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-12 17:33:26 +02:00
William Braeckman 44cfa03587 [IMP] mrp: migrate mrp_documents_kanban to wowl2
This views has multiple custom features such as file upload, attachment
viewer and download.
A lot of files have been rendered obsolete and have been deleted,
notably `file_upload_mixin` which has been replaced by the
file_upload service and hooks.

closes odoo/odoo#99769

Related: odoo/enterprise#31145
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-12 17:33:14 +02:00
Younn Olivier 78c59afd13 [FIX] website, *: fix the website custom systray and menus in mobile
*: website_event, website_links

This commit fixes the navbar on the enterprise mobile mode. With the
enterprise modules, in mobile mode, the navbar menus are removed and
displayed in an an additional systray item, the BurgerMenu.

This behavior was not adapted to the website systray and contextual
custom menus, introduced in [1].

For the website systray, some elements are hidden in mobile:
- the "edit" and "translate" buttons,
- the mobile preview,
- the "+ new" new content button,

The logic for displaying the contextual custom menus is moved from the
navbar patch to a service, so that we can define a patch for the
BurgerMenu that uses that logic and has the same behavior as the
navbar.
For now, the "Menu Editor" and the "HTML/CSS Editor" menus are hidden in
mobile.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#99605

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-09-12 17:33:11 +02:00
Younn Olivier a8361c8fcd [MOV] website, *: move navbar patch to website custom menus service
*: website_event, website_links

This commit moves the current navbar patch, defined with [1], to a
service. This service will be implemented in the next commit and used by
both the navbar and the burger menu patches.

[1]: https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#99605
2022-09-12 17:33:11 +02:00
Nicolas Bayet 3f5ae2400e [FIX] web_editor: properly set _powerboxBeforeStepIndex
Before this commit, `beforeStepIndex` (now `_powerboxBeforeStepIndex`),
was set at the wrong time.

The callback `onOpen` was called after opening the powerbox from the
`_onInput`. The calculation of `beforeStepIndex` presuposed the step
that add `/` happened. Thefore the calculation
`this._historySteps.length - 2` was made rather than
`this._historySteps.length - 1`.
But that presuposition is wrong.

The best time to know until which step index to revert is before any
possible step occurs.

task-2980550

closes odoo/odoo#100009

Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-09-12 16:31:05 +02:00
Nicolas Bayet 3bd7eb1442 [FIX] mass_mailing: reset the content on switchThemes and commitChanges
In switchThemes and commitChanges, the editor was reset by directly
setting the html in the editable. This caused a mutation to potentially
set a truthy value for `odooEditor._toRollback`. As we reset the editor
content, we now use `odooEditor.resetContent` to ensure
`odooEditor._toRollback` be falsy.

task-2980550

Part-of: odoo/odoo#100009
2022-09-12 16:31:05 +02:00
pedrambiria d142a0c687 [FIX] point_of_sale: prevent saving a finalized order to unpaid orders
Before this commit: it was possible to use the pos reference of a validated
order for another order. It causes the order to miss because the server
wouldn't save a new order if there is an existing order with the same pos
reference.

Steps to reproduce the issue on the runbot:

	Open a PoS session
	Throttling the network
	Create an order by selecting some items
	Pay the order
	Validate the order and just before it finishes the job, go back
	Now it's not possible to add an item or change the quantity
	Now click on one of the order lines

	The order will save to unpaid order, and if you reload the page, it will
be possible to modify the order and use it for a new PoS order.

Solution

	The solution is to prevent it from saving it again.

opw-2951938

closes odoo/odoo#99946

X-original-commit: a8bd9f8bd2191469471d740052821233359b324a
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-09-12 16:31:01 +02:00
Denis Vermylen f2d5af0277 [FIX] bus: wrong type in update_bus_presence route
´inactivity_period´ is expected to be an int.

closes odoo/odoo#99874

Signed-off-by: Julien Castiaux <juc@odoo.com>
2022-09-12 16:30:58 +02:00
Yannick Tivisse 40d9249f90 [FIX] hr_work_entry_contract: Fix multi-company work entries generation
closes odoo/odoo#99760

X-original-commit: f32cb46f18a5ea28b39b29c3c7934656d6af72a0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-12 15:30:48 +02:00
stefanorigano (SRI) f9a0d656a3 [REF] website_sale: improve overall navigation
task-2907955

closes odoo/odoo#98558

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-12 15:30:45 +02:00
stefanorigano (SRI) 072144c353 [IMP] website_sale: add categories images
task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:45 +02:00
stefanorigano (SRI) 93f1607091 [IMP] website_sale: sticky sidebar
task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:45 +02:00
stefanorigano (SRI) 9fbae35099 [FIX] website_sale: allow products to match the grid
task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:44 +02:00
stefanorigano (SRI) e3aae30cc0 [IMP] website_sale: provide a visual feedback changing filters
Prior to this commit no visual feedback was provided when, clicking a
filter or category, the page loads and redirect.

This commit reduces the products grid's opacity after clicking, proving
the user that his click triggered an action.

task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:44 +02:00
stefanorigano (SRI) af3330bad8 [IMP] sale, website_sale: sidebar select fields design
task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:44 +02:00
stefanorigano (SRI) 46e5387974 [REF] website: multirange input
This commit improve the design and simplify the implementation.
Popovers have been removed and the overall integration with boostrap is
increased allowing customization with the default boostrap variables.

Variables for (multi-)range input have been exposed at "theme-level"
allowing to customize these components when creating a new theme.

task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:44 +02:00
stefanorigano (SRI) ef10da0a36 [IMP] website_sale, website: ecommerce sidebar, improve design
This commit improves the overall 'website_sale' sidebar design and solve
minor usability issues.

Design overrides has been removed in order to allow customization
thought SCSS variables and ensure consistency between components.

task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:43 +02:00
stefanorigano (SRI) d16693b927 [IMP] web, website, website_sale, sale: checkbox/radio design
Improve checkbox/radio design and the overall consistency, removing
'website_sales' overrides and defining `:hover` behaviors globally.

The odoo 'css_attribute_color' field has been adapted too in order to
match user's fields customization.

task-2907955

Part-of: odoo/odoo#98558
2022-09-12 15:30:43 +02:00
Victor Feyens 74aec75de9 [FIX] web: legacy fields
If the source field widget emitting a field_changed event is a m2o,
the field changes of the event will all be considered
as changes targeting a m2o and converted accordingly, resulting in
server errors because the `onchange` call received a [None, None] value
for a standard field (e.g. float).

closes odoo/odoo#100007

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-12 13:49:49 +02:00
William Braeckman 98df7cdb41 [FIX] website_sale_autocomplete: fix styling
Bootstrap 5 changed the display of `dropdown-menu` to be absolute,
meaning w-100 would take the whole screen.
We set it as relative to take the width of the input.

closes odoo/odoo#100005

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-12 13:49:46 +02:00
William Braeckman f129fd3e57 [FIX] website_sale_picking: fix access error as public user
When selecting on site picking and/or onsite payment the public user was
presented with an access error while it shouldn't.

closes odoo/odoo#100001

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-12 13:49:43 +02:00
Yolann Sabaux 5d5ff83a07 [FIX] account: fix double display of invoice
Steps to reproduce:
- Create a vendor bill with payment terms "30% Now, Balance 60 Days"
- register a partial payment and select "Mark as fully paid"
- open the payment and print the payment receipt

Issue:
the lines are printed twice

Addendum:
In Master (post saas-15.3), the `_get_reconciled_invoices_partials` returns a tuple:
https://github.com/odoo/odoo/blob/45e540b624268e65060f6b1aeaf2d87d7220b620/addons/account/models/account_move.py#L2475-L2493

opw-2964480

closes odoo/odoo#99997

X-original-commit: 9525c112e4048583e9b347b5703a416563085421
Signed-off-by: William André (wan) <wan@odoo.com>
2022-09-12 13:49:40 +02:00
Aaron Bohy 5f499d170e [FIX] web: apply default favorite even if active_id(s)
Before this commit, we didn't apply the default favorite (if any),
when there was an active_id or active_ids in the context. This was
a mistake. Note that it only impacted owl views.

closes odoo/odoo#99989

X-original-commit: 1e13e6cd073e57b3744caefc4b8f3795c35a4c10
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-12 13:49:37 +02:00
Florian Damhaut b3489af4c1 [FIX] web: basic_model: save a paged nested o2m
In a form view, have a o2m field (A), with a nested o2m field (B).
The A field should have multiple pages, with each record having at least one record
in their B field.

Have a (C) field that will modify a record in the nested o2m when changed.

Change the C field, and save.

Before this commit, the record's nested o2m from the other page had a wrong value
(a mere 4 command).

After this commit, their value is a command 4 and a command 1, with the right values.

closes odoo/odoo#99986

X-original-commit: e45e3b83f0f3116cc983c6bd8a9212e815b4d4f5
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-09-12 13:49:31 +02:00
Aaron Bohy e9aac69e6b [FIX] web: adapt views to invisible attr removal in archs
PR [1] removes some `<field/>` node attributes from view archs that
were transfered into the `modifiers` attribute (e.g. `invisible`).
However, the `invisible` attribute was still used in some views
(e.g. graph, pivot, search and cohort). This issue hasn't been
spotted by the tests as the MockServer was still sending archs
with both `invisible` and `modifiers` attributes.

This commit adapts the MockServer to make it behave like the real
server, which makes some tests fail, and adapts the impacted
views to make them look into the `modifiers` attribute, which fixes
the failing tests.

Closes odoo/odoo#99920

[1] odoo/odoo#99619

closes odoo/odoo#99948

Related: odoo/enterprise#31220
Signed-off-by: Mathieu Duckerts-Antoine <dam@odoo.com>
2022-09-12 13:49:25 +02:00
Arnold Moyaux c38965e457 [FIX] stock_account: small typo in action_open_reference
move_id doesn't exist, it should be stock_move_id

closes odoo/odoo#99411

Related: odoo/upgrade#3878
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-09-12 13:49:17 +02:00
Arnold Moyaux 9f046d538f [IMP] purchase_stock, stock_account: handle invoice before receipt
In some buisness case when the invoice is done before the receipt, the
`stock.valuation.layer` price unit will be taken on the invoice rather
than the `purchase.order.line`

Part-of: odoo/odoo#99411
2022-09-12 13:49:17 +02:00
Arnold Moyaux ccc1fa5d37 [IMP] purchase_mrp: cost share for kit
Be able to define a cost share on kit's components. The purpose, define
a cost repartition closer to the reality.

If the cost share is not define, it will split by the number of lines.

Part-of: odoo/odoo#99411
2022-09-12 13:49:16 +02:00
Arnold Moyaux 35d6c58f86 [REF] purchase_stock, stock_account: remove price difference account
Invoice a different amount than on the purchase order will not
use the price difference account anymore. Instead it will create
a layer with the difference. It means the stock valuation will be
base on real quantity invoiced rather than the purchase order.

Since the price different account does not exists:
- Invoice correction is only done on `account.move.line` linked to a
  `purchase.order.line`. It means that additional lines won't be
 corrected and will debit the stock_input instead (that should be empty
 manually)

Part-of: odoo/odoo#99411
2022-09-12 13:49:16 +02:00
Arnold Moyaux 7016337331 [IMP] stock_account: Add partner on account entries
Add the partner references on account entries created from
a purchase order receipt or a customer invoice

Part-of: odoo/odoo#99411
2022-09-12 13:49:16 +02:00