Commit Graph
152817 Commits
Author SHA1 Message Date
Eteil Djoumatchoua (etdj) 9429107d95 [FIX] l10n_fi: Default account payable for Finland localization
Issue:
In finnish localization, partners have by default account payable "2700 Velat saman konsernin yrityksille, pitkäaikaiset" which is incorrect
Expected behaviour: The default account payable for finnich localization should be "2870 Ostovelat"

Solution:
In l1On_fi/data/l10n_fi_chart_post_data.xml, the "property_account_payable_id" is set to "account_2700". Just change  it to "account_2870"

closes odoo/odoo#97212

X-original-commit: 4efb8928a4f000dab0b62f84d3a01ee2632f8b19
Signed-off-by: Josse Colpaert <jco@odoo.com>
2022-08-08 14:17:14 +02:00
Aaron Bohy 36612a342b [FIX] web,barcodes: tests: cleanup after tests
In the QUnit test suite, we have cleanup code that runs after each
test to ensure that event listeners, setTimeouts... registered
during a test are removed. This is particularly useful for services,
as they do not have a "destroy" function to cleanup those handlers
they would have registered at startup. Side note: they don't
because it would only be useful for tests, as a service lives
forever in the prod environment.

Before this commit, that cleanup code didn't remove callbacks
registered with a setInterval. Moreover, we didn't remove event
handlers bound on document.body either. As a consequence, there
were memory leaks in the test suite (e.g. callbacks of the tooltip
service), and some crashes could occur if the user interacted with
the window after test completion.

closes odoo/odoo#97100

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 14:17:11 +02:00
aliya 7406ec13d3 [FIX] account: fix account type computation
There can be many accounts in self and the "search_read" is currently breaking because of self.company_id in the domain.
This commit addresses two problems:
- Creating accounts in a multi-company environment
- Setting a default account_type when there is no parent found.
Account codes should however be still limited to the current company even though for performance reason we batch the searching part.

closes odoo/odoo#96832

Signed-off-by: William André (wan) <wan@odoo.com>
2022-08-08 14:17:08 +02:00
Antoine Guenet 51722cf993 [ADD] web_editor: add tests for Powerbox
This adds a series of tests for the editor's Powerbox and its
integration with the editor.

closes odoo/odoo#96287

Related: odoo/enterprise#29649
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-08 14:17:01 +02:00
Antoine Guenet b58606f705 [FIX] web_editor: ensure the Powerbox displays above a modal
The upgrade from Bootstrap 4 to 5 broke the display of the Powerbox when
the editor is in a modal. This adapts the Powerbox's z-index to make
sure it always displays above a modal.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:01 +02:00
Antoine Guenet f9cbcccdfe [REF] web_editor: convert editor styles to scss
Odoo Editor's styles were defined in CSS when it was all still part of
a separate repository. They can now be converted to SCSS, which will
allow us to use Odoo's SCSS variables in the future, and allows us now
to refactor the styles in the more readable SCSS format.

Part-of: odoo/odoo#96287
2022-08-08 14:17:01 +02:00
Antoine Guenet 8e1f9fffc8 [IMP] web_editor, mass_mailing, website: reorganize Powerbox items
This reorganizes the Powerbox items under different category names, in a
more preferable order.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:00 +02:00
Antoine Guenet 9154e707df [ADD] web_editor, website: new API to organize Powerbox
This introduces a new API for the Powerbox, which allows to order its
commands and categories. The order is based on the priority assigned to
the category or command. If two items have the same priority, they are
ordered alphabetically.
To order categories, pass said categories in the Powerbox's params, each
with its own priority. If a command declares itself as part of a
category that was not itself declared, said category will be added
automatically, with the lowest priority.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:00 +02:00
Antoine Guenet ef1fe4a700 [REF] web_editor: refactor the Powerbox
This refactors the Powerbox for maintainability and efficiency, and
removes unused code from it.

task-2901697

Part-of: odoo/odoo#96287
2022-08-08 14:17:00 +02:00
Rémy Voet (ryv) 9584f80a48 [IMP] product: merge and simplify api.contraints for performance
- Merge `_check_barcode_unique` and `_check_barcode_uniqueness`.
- Simplify the code and avoid costly read_group
- Add missing index on barcode of `product.product` (before there was an
unique constraint)

(Note that the constraints isn't transactional safe because it is not an
SQL contraints)

closes odoo/odoo#96043

Signed-off-by: William Henrotin (whe) <whe@odoo.com>
2022-08-08 14:16:52 +02:00
Nikunj Ladava ab7795c1b8 [IMP] crm: update helper in team member action
This commit improves the helper message in team member action

task- 2583755

closes odoo/odoo#92616

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-08-08 14:16:49 +02:00
Nikunj Ladava b8bb700364 [IMP] sales_team: display empty sales teams on members' kanban view
When we open the 'CRM > Configuration > Team Members' menu, if there are no
members in any of the teams, we see the empty screen(no dummy data, no
action helper), which looks a bit ugly.

This commit improves the behavior by displaying all the (accessible) sales
teams, even if they are empty. So, even if there are no members available,
we will get to see the dummy data and action helper.

Note that in the data, we already have one sales team available, so this
should be okay. But if someone intentionally removes all the teams, it
will still lead to an empty ugly screen. Since this is a rare case, we
haven't considered it for now.

task-2583755

Part-of: odoo/odoo#92616
2022-08-08 14:16:48 +02:00
Swapnesh Shah 4722dc8f7e [IMP] website_blog: display no of views field on form
Before this commit field `visits` was not displayed on form view.

With this commit, Field is now readonly at model level and
added on form view.

closes odoo/odoo#74336

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-08-08 14:16:45 +02:00
Géry Debongnie 9434969d5d [REF] website: reimplement redirect field in owl
The redirect field in website does not work properly in the new views.
With this commit, we just reimplement it to make it work with the new
code.

closes odoo/odoo#96865

Related: odoo/enterprise#30178
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2022-08-08 12:33:12 +02:00
Géry Debongnie f88a1e9e7e [FIX] web: make css rules applying to oe_stat_button less specific
Before this commit, the rules on oe_stat_button only applied if the stat
button was a direct child of the button box.  However, this is a problem
with the way fields are now wrapped in a div, so it is no longer
possible for a field to be styled like a stat button.

With this commit, we simply make the rule less restrictive.

Part-of: odoo/odoo#96865
2022-08-08 12:33:11 +02:00
Géry Debongnie fb0bebc6cf [FIX] web: add display:contents to wrapper div in fields
With the new views in owl, we wrapped every field in a div with the
class o_field_widget. This is a good thing in general, but it has the
issue that before this commit, the display property was set to
inline-block, in all cases.

With this commit, we set it to 'contents', which means that it will
simply get the correct display value from its content.

Part-of: odoo/odoo#96865
2022-08-08 12:33:11 +02:00
Géry Debongnie 130a7d9ee1 [IMP] web, web_tour: improve isVisible helper
Before this commit, the isVisible helper would most of the time work as
expected, except if an element has display: contents.  In that case, it
has no bounding box, but it may still be visible if one of its child
is visible.

This is particularly important since we want to set the display property
of all field components to "contents".

Part-of: odoo/odoo#96865
2022-08-08 12:33:11 +02:00
Odoo's Mergebot b3831d9892 [MERGE][REF] product, sale: tests
* Clean tests setups
  * Use setUpClass instead of setUp
  * remove useless test data or move it to the place(s) of use
    * when possible, use existing test data instead of creating another custom setup for the current test
  * remove unnecessary dependencies on accounting common
  * make tests work without demo data (when not relying on accounting common)
  * run base product/sale tests without triggering mail logic
  * create records in batch to improve performance (reduced queries, batched operations, ...)
* Create the base of a clean test architecture for those modules (with dedicated commons in the right modules)
* Improve some tests (mainly prices/pricelist tests in sale)
* Add `mute_logger` contexts in some tests to reduce useless test logs
* Try to improve tests consistency (fixed test currency, archiving existing demo data to avoid side-effects, ...)
* Move most `product` tests `post_install` to benefit from the split of `post_install` tests on runbot.

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

closes odoo/odoo#96791

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-08 12:33:05 +02:00
Victor Feyens f4a85cb86b [REF] sale_management: test infrastructure
* New common with a unique dumb empty SO template
* clean tests to rely on the new sale commo data

Part-of: odoo/odoo#96791
2022-08-08 12:33:04 +02:00
Victor Feyens 3b8113891b [REF] sale: test infrastructure
New common based on new common infrastructure (base, uom, product, sales
team).

* Conversion of existing tests to use the common
* Remove invoicing tests common dependency when not needed (overkill
setup for most tests)
* Move tests to the correct test file.
* Rename test_sale_pricelist into test_sale_prices and add tests to
improve coverage of price computation.
* new file test_controllers to regroup all tests covering the routes.
* Speed up tests setup by creating records in batch
* Reduce tests setups and use more the common tests data.

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens f753fce0b7 [MOV] sale -> sales_team: extract new test common
Also move crm.team access rights test from sale to sales_team where it 
should be tested.

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens 546721e441 [REF] product: test infrastructure
* commons & setup refactoring:
  * convert setUp to setUpClass
  * move setups where needed (stock/mrp commons or specific test
classes)
  * create test data in batch (faster, less sql queries & batched
operations)
* move most tests post-install to allow runbot splits
* by default, run tests without mail logic
* by default, run tests in a consistent environment (fixed currency
imposed in the BaseCommon)
* refactor existing tests to use new commons data (while trying to keep
diff reduced)
* add dedicated test file to test the common data
* use mute_logger to reduce useless test logs (less spam to scroll in
logs, less data on runbot builds, ...)

Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens 3525f8a855 [IMP] uom: extract new test common
Part-of: odoo/odoo#96791
2022-08-08 12:33:03 +02:00
Victor Feyens cfe9172884 [ADD] base: standard test commons
* Consistent currency used for tests
* Consistent base data (partner & users)

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Victor Feyens e32bf2384a [IMP] base: setUpClass instead of setUp
Do the setup once by test class.

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Victor Feyens 0d2e18e5ac [FIX] sale_management: wrong constraint error message
The unit price isn't supported/specified on sale order template line 
anymore, no need to mention it in the constraint message (the check on 
the field was removed along with the field)

Part-of: odoo/odoo#96791
2022-08-08 12:33:02 +02:00
Younn Olivier e2e65790a5 [FIX] web_editor: fix nearest dropzone when moving a snippet
Before this commit, when a snippet was moved, and dropped outside of a
dropzone, the nearest dropzone was not found and the snippet would
return to its initial position.

This commit fixes it by using the editable document instead of the
global one.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

closes odoo/odoo#96401

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 12:32:52 +02:00
Younn Olivier 29dcb119f5 [FIX] website: copy frontend link when using the anchor option
Before this commit, clicking on the "anchor" icon from a snippet editor
would copy the client action's url (introduced in [1]).

This commit changes the snippet's path computation to use the target's
ownerDocument location instead of the global one.

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

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier b0108e1876 [FIX] website: fix editor keyboard shortcuts
Before this commit, the editor shortcuts would not work.
Example: "alt+1", or "alt+2" switch tab of the editor.

This commit registers the editor as the active element, so that keyboard
shortcuts registered on that element are given priority at the hotkey
service level. The "escape" shortcut to go fullscreen is adapted with
the global option to be independent from the active element.

This commit also adds the "alt+p" keyboard shortcut on the publish
systray item.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 83501e38a3 [FIX] website: ignore context params when client action is restored
Before this commit, the website context was configured with the params
of the client action, at all times. This was leading to weird
behaviours:
- Go to the website client action
- Install the "Blogs" module from the new content systray item
- Navigate on a blog post from the client action
- Click on the "Settings" systray item (last one from the right)
- Click on the "Website Preview" breadcrumb item
=> The "New Content" modal is displayed, again, when it should not.

Another flow, on enterprise:
- Start the client action with /@/?enable_editor=1
- Click on the top left icon to go back to the home screen
- Click on the top left icon to go back to the website
=> The editor is launched when it should not.

To prevent that, the action jsId key is registered at the website
service level. If the action is restored, the jsId will be the same, and
the params used to configure the context will be ignored.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier d4bf7c4b46 [FIX] web_editor: fix snippets overlay buttons ui
After [1] was merged, the delete/move buttons of the snippets overlay
reduced in size, because of the font-size difference between the backend
and the frontend.

This commit fixes it by setting a fixed font-size of 16px (this restores
the same size as before, as the button was using 1rem on the frontend,
and most browsers use 16px as a default font size).

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

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:51 +02:00
Younn Olivier 9a542f121b [FIX] website: fix theme options background widget state
Before this commit, the Page Layout > Background option's widget of the
Theme section of the SnippetsMenu was not updated correctly after using
the option.
The #wrapwrap was queried in the global document when it should be
queried in the target's ownerDocument.

Related to https://github.com/odoo/odoo/commit/31cc10b91dc7762e23b4bde9b945be0c4ce3fe3b

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Younn Olivier e8112e2865 [FIX] website: keep focus on text when using snippet options
Before [1] was merged, for this flow:
- Drop a snippet in the page
- Click on some paragraph
- Click on a snippet option's widget
=> The text selection was lost on Chrome, but kept on Firefox.

With [1] instantiating the SnippetsMenu on a different document than the
snippets one, it was possible to keep the text selection (the snippets
document selection) when clicking on the snippets options (on the global
document).
Some code was added to preserve the Chrome behaviour and lose the text
selection. This code is reverted to keep the Firefox behaviour.

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

task-2687506

Part-of: odoo/odoo#96401
2022-08-08 12:32:50 +02:00
Romain Derie 7f1653a1de [IMP] website: remove the iframefallback in test mode
This commit gets rid of the iframefallback in test mode. It is not
helpful there and slows down the tests as it involves some HTTP
requests.
Its purpose is only for the end users to have a smoother UX during page
transition. It is irrelevant in tests. Note that it means the tests
wouldn't break if that iframe fallback was to be breaking something in
real use cases.

task-2687506

closes odoo/odoo#96229

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2022-08-08 10:50:56 +02:00
Horacio Tellez bf3942b553 [IMP] sale: progressbar js logic migration to owl framework
This PR is part of the whole migration of the sale javascript
code and related code to the owl framework.
Why: better developmet framework for javascript code in odoo.

This PR in particular targets the progressbar of sales team
appearing on the CRM app.

Task - 2918635

closes odoo/odoo#95565

Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-08-08 10:50:54 +02:00
Manisha Tulsiyani 038bfa2ca1 [IMP] project,sale_timesheet: generic improvement for the project
Purpose of the commit is to do the generic improvements for project.

So in this commit did the following changes:
 - the 'upsell opportunity' activity should be generated even
   if the service has already been invoiced
 - project.task hide the 'create' button if the project in the
   context is archived
 - project.task portal form view: only the ref of the invoice
   should be underlined on hover, not the empty space.

task-2857924

closes odoo/odoo#94776

Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:50 +02:00
stefanorigano (SRI) a75530c323 [IMP] hr: review and optimize SCSS
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

closes odoo/odoo#93049

Signed-off-by: Pierre Paridans (app) <app@odoo.com>
2022-08-08 10:50:48 +02:00
stefanorigano (SRI) d198ebbaf2 [FIX] web: 'text-muted' links, remove opacity-changes on hover
Remove exception initially introduced for 'o-btn-link-variant' mixin
when handling 'text-muted' links.

The opacity-change wasn't really needed and introduced inconsistencies
with other links designs and with the mixin logic.

In case of complex/custom scenarios that requires opacity-changes,
'o-opacity-x' utility-classes can be used to achieve the desired design.

Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

Part-of: odoo/odoo#93049
2022-08-08 10:50:47 +02:00
stefanorigano (SRI) 819d6f3171 [IMP] web: create a variable defining the form separator color
Part of the overall v16 SCSS optimization/restyle, task-2704984.

task-2865713

Part-of: odoo/odoo#93049
2022-08-08 10:50:47 +02:00
hiroh-odoo 543f36d9e4 [IMP] project: add ancestor_id field in task analysis report
This commit add a ancestor_id field in task analysis report.

task-2824000

closes odoo/odoo#91023

Related: odoo/enterprise#27166
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:33 +02:00
Kartik Chavda 27488b11b2 [IMP] (hr,sale)_timesheet: improve timesheets report in SOs and invoices
In this commit done following change:
- Add 'Timesheets' report in sale order and invoice.
- Rename 'Timesheet Entries' report into 'Timesheets'.-

task-2826265

closes odoo/odoo#90744

Related: odoo/enterprise#27047
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-08-08 10:50:23 +02:00
Kartik Chavda ec1c65812b [REM] hr_timesheet: remove unused method from timesheet
This commit remove unused method added by commit: https://github.com/odoo/odoo/commit/2f20b9437a80d71a6184ab83b9c1db3dd04f9cb3

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:23 +02:00
Kartik Chavda 25cd0cf3fc [IMP] project_timesheet_holiday: improve feature timesheet created by time off
This commit prevent user write on time off timesheets and create timesheet
on time off tasks and add test for this feature.

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:22 +02:00
Kartik Chavda aef440b38e [IMP] sale_timesheet: set default project in action
This commit add first project as default project of timesheet
in 'Hours Recorded' stat button's action.

task-2826265

Part-of: odoo/odoo#90744
2022-08-08 10:50:22 +02:00
Jacky (trj) a520745230 [IMP] point_of_sale: visual improvement
Small visual changes that should improve the user experience.
The loading demo data popup has been moved to the backend.
Created an Alert Popup that is less aggressive than an Error Popup

closes odoo/odoo#83780

Task-id: 2485062
Related: odoo/enterprise#26104
Signed-off-by: Masereel Pierre <pim@odoo.com>
2022-08-08 10:50:14 +02:00
Antoine Guenet 00b9a0fcbe [FIX] web_editor: properly convert link-wrapped card-images
The e-mail conversion process for Bootstrap cards stripped card-images
from their link when they had one. This corrects the process to preserve
the link.

task-2937123

closes odoo/odoo#97199

X-original-commit: 947ee6756b9e9d9ddf7380ecaf0beb27c271b231
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-05 19:06:53 +02:00
tsm-odoo d998c54feb [FIX] mail, bus: fix mock sendone/many crash during tests
The mock of sendone/many was relying on the bus_service. Since owl.Component.env
is changing during tests setup, the bus_service was not always defined. In order
to make this more reliable, the longpolling/poll route is now mocked, returning a
promise that can be resolved by the sendone/many methods.

closes odoo/odoo#97298

Related: odoo/enterprise#30059
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-08-05 16:35:45 +02:00
Ipsita Borisagar 19fa3c35a3 [FIX] web_editor: traceback while removing the link
Before this commit:

After inserting the 'calendar' or 'appointment' link in an article through the
'/appointment ' or '/calendar' command, removing the link shows the error.

After this commit:

Removing the link through the link editor will remove the link and only keep the
text.

Task-2894489

closes odoo/odoo#97210

X-original-commit: 8eda489a26a3d138c2e4c601e42b531e6bc719b6
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
2022-08-05 15:09:16 +02:00
Odoo's Mergebot a81cc415ae [MERGE][IMP] web: allow commands to be middle-clickable
Purpose
=======
Allow commands in the command palette to be opened in a new tab by
either CTRL+clicking on the command, CTRL+ENTER or right clicking and
copying the link/opening in new tab.

Specifications
=============
Add new slot `focusMessage` that displays the message (if device is not
a mobile device). The `href` value has then to be defined in the
registry.

Task-2710445

closes odoo/odoo#94241

Related: odoo/enterprise#29715
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-08-05 12:09:55 +02:00
Adrien Schoffeniels 9c5b5a9dfd [IMP] web: allow commands to be middle-clickable
Purpose
=======
Allow commands in the command palette to be opened in a new tab by
either CTRL+clicking on the command, CTRL+ENTER or right clicking and
copying the link/opening in new tab.

Specifications
=============
Add new slot `focusMessage` that displays the message (if device is not
a mobile device). The `href` value has then to be defined in the
registry.

Task-2710445

Part-of: odoo/odoo#94241
2022-08-05 12:09:54 +02:00