Steps to reproduce:
- Activate Debug mode
- Go to Settings -> Companies
- Create company A and B and set a different favicon for each company
- Refresh the page or switch company
Issue:
The favicon is not the right one.
Cause:
Code (that update favicon) removed when refractoring of owl.
Related commit: https://github.com/odoo/odoo/commit/0573acae2306bf5da2005852da9323ddc59e5431
Solution:
When web client start, update in JS the favicons (desktop and mobiles)
with current company favicon.
opw-2664525
closesodoo/odoo#84571
X-original-commit: fa2cc58ef34382a8b9a8d04a6e54267e39630432
Signed-off-by: Jérémy Kersten <jke@odoo.com>
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Prior to this commit, when a user searches with an upper case search
term of more than 3 characters, the search was considered as a fuzzy
search even if the result was an exact match.
Since the search is always lowered when there are more than 3
characters, the search is considered as fuzzy only when the search and
fuzzy term are case insensitively distinct.
closesodoo/odoo#84593
X-original-commit: 34362a7c07a2868103b24d16a83a97356ad1f60d
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Current behavior:
When trying to open the gift card list you get an access error if one of the cards has been used in another company.
This error appears because you cannot access SO from another company and the used gift cards were linked to a SO.
So shouldn't be able to use a gift card that was created in another company.
Steps to reproduce:
-Create a gift card in company A
-Use it in company B
-Try to access it from company A
opw-2732973
closesodoo/odoo#84584
X-original-commit: 37d2178263d0c3875c603c5e6c53118f7a518b32
Signed-off-by: Masereel Pierre <pim@odoo.com>
When a pos launched by a user having no access rights on sales order
lines is launched. It cannot have access to the coupon program because
it tries to get the computed field order_count that needs to read the
sale order lines.
closesodoo/odoo#84583
Task-id: 2742528
X-original-commit: 15a896f4c0a98472dfab26fa9a18ededdd6f1a56
Signed-off-by: Masereel Pierre <pim@odoo.com>
When a coupon is generated from POS order, you get a traceback saying
you don't have access rights on "coupon.coupon" when you are only a pos
user.
So when we need to create the coupons and write on it, we are doing it
in sudo, to let the pos process generate the coupon.
Task-id: 2742528
X-original-commit: 2faefd5d6e69170a49c2cc5aca000f791f40f448
Part-of: odoo/odoo#84583
The function `arrayToString` did not properly support domains containing
arrays of booleans, for instance `[["val", "in", [true, false]]]`. The
array containing the boolean was directly JSON stringified without being
converted to its python equivalent.
closesodoo/odoo#84592
X-original-commit: 62f996e43098dc0f671f1e2cbb36f977ef6a36c9
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
Co-authored-by: Lucas Lefèvre <lul@odoo.com>
While calling `_stock_account_prepare_anglo_saxon_out_lines_vals`, the line
`credit_expense_account = accounts['expense'] or self.journal_id.default_account_id`
can cause a 'Expected singleton' error. During upgrades from v13 and earlier,
the value used for `accounts['expense']` is always `None`.
If the recordset in `self` contains more than one record, the error will happen.
By replacing `self` with the iteration object `move`, this error is averted.
The error happened during an upgrade from v13. Since the value assigned to
`accounts['expense']` doesn't exist in that version, it goes to
`self.journal_id.default_account_id` to grab it.
If `self` has more than one record, the error happens.
Traceback:
```
Traceback (most recent call last):
File "/home/odoo/src/odoo/14.0/odoo/service/server.py", line 1199, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/home/odoo/src/odoo/14.0/odoo/modules/registry.py", line 89, in new
odoo.modules.load_modules(registry._db, force_demo, status, update_module)
File "/home/odoo/src/odoo/14.0/odoo/modules/loading.py", line 475, in load_modules
migrations.migrate_module(package, 'end')
File "/home/odoo/src/odoo/14.0/odoo/modules/migration.py", line 180, in migrate_module
migrate(self.cr, installed_version)
File "/tmp/tmpae3wx5o6/migrations/account/saas~13.4.1.1/end-09-payment-refactoring.py", line 618, in migrate
util.iter_browse(env["account.move"].with_context(**ctx), ids, chunk_size=1024).action_post()
File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in caller
return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
File "/tmp/tmpae3wx5o6/migrations/util/orm.py", line 197, in <listcomp>
return [getattr(chnk, attr)(*args, **kwargs) for chnk in chain(it, self._end())]
File "/home/odoo/src/odoo/14.0/addons/sale/models/account_move.py", line 14, in action_post
res = super(AccountMove, self).action_post()
File "/home/odoo/src/odoo/14.0/addons/account/models/account_move.py", line 2715, in action_post
self._post(soft=False)
File "/home/odoo/src/enterprise/14.0/l10n_mx_edi_landing/models/account_move.py", line 26, in _post
return super()._post(soft)
File "/home/odoo/src/enterprise/14.0/l10n_mx_edi/models/account_move.py", line 456, in _post
return super()._post(soft=soft)
File "/home/odoo/src/odoo/14.0/addons/sale/models/account_invoice.py", line 75, in _post
posted = super()._post(soft)
File "/home/odoo/src/odoo/14.0/addons/purchase_stock/models/account_invoice.py", line 171, in _post
return super()._post(soft)
File "/home/odoo/src/enterprise/14.0/account_reports/models/account_activity.py", line 75, in _post
return super()._post(soft)
File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 49, in _post
self.env['account.move.line'].create(self._stock_account_prepare_anglo_saxon_out_lines_vals())
File "/home/odoo/src/odoo/14.0/addons/stock_account/models/account_move.py", line 158, in _stock_account_prepare_anglo_saxon_out_lines_vals
'account_id': credit_expense_account.id,
File "/home/odoo/src/odoo/14.0/odoo/fields.py", line 3821, in __get__
raise ValueError("Expected singleton: %s" % record)
ValueError: Expected singleton: account.account(1383, 38, 30)
```
closesodoo/odoo#84129
X-original-commit: acda26fd71eac3c6bac1ad81886cd8885bc69c5a
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
When a test fails and asks for a screenshot, it seems that in some
conditions, the browser has already navigated to the blank page when
capturing the screenshot, resulting in a useless blank screenshot.
With this commit, all the futures are awaited to avoid this race
condition.
closesodoo/odoo#84566
X-original-commit: 37a7b81c28a7ad7c4f225e1463df96bbaf2d5c8f
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
The aim of this commit is to set partner on anglosaxon
aml in order to help our client in their stock
reconciliation process in case it hasn't been done automatically.
Before this commit:
anglosaxon line were created without partner
After this commit:
A partner is set when anglosaxon line are created
closesodoo/odoo#84547
Ticket: 2692308
Community-pr: https://github.com/odoo/odoo/pull/84468
X-original-commit: abfe37fcea5b20f77799d9331d4d011530880669
Signed-off-by: William André (wan) <wan@odoo.com>
Icons converted to images were improperly aligned because as inline
elements their vertical-align style property used their first block
ancestor as reference.
closesodoo/odoo#84513
X-original-commit: eb0fa518b563206afcc214a81f89cea45820b34c
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Antoine Guenet <age@odoo.com>
The final mail to be sent will have to use a mail-safe font everywhere
so we can't allow other fonts to be applied in some elements. Because of
the way the css was declared, we still had other fonts on some elements,
like .btn. As a result, we had a different look between readonly and
edit modes.
X-original-commit: bde0dbe9a4ade4ec0fe1a5b44fc64e5d484ac49e
Part-of: odoo/odoo#84513
The conversion of the comparison snippet for mail compatibility involves
heavy changes in the html. In order to preserve the style, some style
changes were needed as well. This change to the style of cards allows us
to restore the border around the snippet.
X-original-commit: fae07f2dcd74ed3ce85d37cc7ea0180b40994ff1
Part-of: odoo/odoo#84513
jQuery was used extensively in `convert_inline`, slowing it down by a
factor of more than 2. This replaces all use of jQuery with vanilla
javascript so as to improve performance significantly.
X-original-commit: 8573a4ebbfe951c9ce0d3ef753174f4f0a6c829b
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Rules used to be applied in the DOM sequencially, in traversal order.
This is slow and confusing to debug. Meanwhile, most functions had been
adapted to process the rules in a simple loop on the concerned nodes.
This commit does that for `classToStyle`, the last remaining function
that wasn't doing it yet, and removes the utility function
`_applyOverDescendants` altogether.
X-original-commit: 70253a98bd9d6752c29cfe61debf4567d0a872e8
Part-of: odoo/odoo#84513
This improves performance of `classToStyle` by first selecting which
nodes and which rules will be concerned.
When parsing the css rules, we computed their specificity and normalized
their styles one by one. This applies these processes only on the
concerned rules, all at once.
X-original-commit: bb28624dcd69efe1aff546b37e66c05c001a5927
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Since some css was loaded twice, when parsing rules, we grouped similar
rules in order to minimize the amount of rules on which to iterate
during conversion, so as to improve performance. This is not needed
anymore now css is loaded only once, so we can remove this extra
processing.
X-original-commit: 3db6f4a345015adf99c2a744066dcdf8f076a657
Part-of: odoo/odoo#84513
Co-authored-by: Antoine Guenet <age@odoo.com>
Co-authored-by: Nicolas Bayet <nby@odoo.com>
This batches all writes in the `formatTables` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.
X-original-commit: f3c0f0c62b9f31e47ef8644c79e1b9751d0ba746
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
This batches all writes in the `classToStyle` method of `convert_inline`
so as to minimize layout thrashing and therefore improve performance.
X-original-commit: addf3e8fa37f4f2cc212a55a332ec61090655232
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
`web.assets_frontend` was called in `wysiwyg_iframe_editor_assets` _and_
in `iframe_css_assets_edit`. As a result, they were loaded twice in edit
mode.
X-original-commit: 4bea292681039c1954c6c9038742fa6e2cc2c31e
Part-of: odoo/odoo#84513
Co-authored-by: Nicolas Bayet <nby@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
`__extraAssetsForIframe` had been kept in `mass_mailing` and
`web_editor` for historical reasons but was not used anymore. This
removes it.
X-original-commit: 88b91df3ff75bb0be9a84761cb251d0b7b3c976d
Part-of: odoo/odoo#84513
Some tests depended on a variable to be defined, which was only defined
in other tests.
X-original-commit: d3e30a532526e7be54d6153a3ed375ff30d8f8e3
Part-of: odoo/odoo#84513
Follow up of tasks 2379518 and 2633229 (#73341 and #77156).
Purpose
=======
The main goal is to allow the portal user to click on some stat button shown in the task form view in the project sharing feature. Those stat button will redirect to a portal view if the portal user has access to the document(s).
Then, some refactoring is made to easily use the existing code for one route to another one and review the code for the project sharing tour.
Finally, the `/my/project` and `/my/task` routes have been renamed to follow the same *naming* in the another routes. That is, those routes will be named `/my/projects` and `/my/tasks`.
## Details of the implementation
- Allow the portal user to click on the sale order stat button in task form view. This stat button will be clickable if the user has access to the sale order of the current task shown in the form view, otherwise the stat button will be invisible. If a portal user clicks on this button, then he will be redirect to `/my/orders/<id of the sale order>`.
- Allow to show the parent task from another project than the one shown in project sharing. If the portal user has access to the other project than there is no reason to not allow him to see the parent task.
- Rename the `/my/project` route into `/my/projects`.
- Rename the `/my/task` route into `/my/tasks`.
- Create hook methods to avoid duplicating code when we want to use this code to another route. It will be the case for a new route used in the project sharing feature.
- Create hook method in controller of account module to easily reuse the existing code for another route for project sharing feature.
- Refactor tour js for project sharing feature to remove the duplicating code.
- Revert the disable click on avatar. This changes was initially done for project sharing feature. However, this changes is made `web` module instead of the `project`. Since this changes is no longer used in project sharing feature and no used in backend code, the changes is reverted.
- Move the `invoice_count` field from `sale_project` module to `industry_fsm_sale` one because it seems this field is only used in that module and not anywhere before installing that module.
task-2648955
--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr
closesodoo/odoo#82379
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Currently, User/validation errors are sometimes not correct in English
and/or quite obscure and don't help the user understand/solve the issue.
So in this commit, done some copywriting to make the experience better.
task-2615469
closesodoo/odoo#81711
Related: odoo/enterprise#23013
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
- Create a sale.order with a product with an optional product
- Confirm order A
- Copy this order A, a new order B is created
--> Issue: the new line of order B are linked with an line of order A
closesodoo/odoo#84523
X-original-commit: 3d987fb55c74ea726a984f3091ff8ac565550172
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the "Sub-tasks" has been added in the basic form
view of project.task in backend.
This commit adds this stat button in the project sharing form view to
have the same button than the one in backend.
task-2648955
Closes#82379
This commit moves some code used in methods for `/my/quotes` and
`/my/orders` because the code was duplicated for the both routes.
So, with this commit, we can now call those hooks when we need this code
in another routes.
task-2648955
Closes#82379
This reverts commit 0e1961b1dd because the
`no_open_chat` option is removed, this commit becomes useless, that's
why the commit is revert.
task-2633229
Closes#82379
Before this commit, we duplicate some steps of the tour js launched
with internal user to the tour js launched with portal user.
This commit avoid duplicating the steps. To do this, a list variable
stores the common steps of both tours and use this list in both tour
js to avoid duplicating the steps in both tour js.
task-2648955
Closes#82379
Before this commit, the values dict given to the template of
'/my/invoices' is built in the main method of the '/my/invoices' route.
This commit moves the building of the values dict in a separate method
to easily use in another route/method.
task-2648955
Closes#82379
Before this commit, the `invoice_count` field is defined in
`project.task` in `sale_project` but it is not used in this module.
This commit moves this field in enterprise version, because we use
this field in Field Service app.
task-2648955
Closes#82379
Before this commit, we recently change the content of this route. The
content is the list of tasks to the project instead of the form view of
the project. The problem is we don't have a route to manage the page in
the case where we have more than the value stored in `_items_per_page`.
This commit adds a route in the method for '/my/projects/:project_id'
route. The new route is called '/my/projects/:project_id/page/:page' to
manage the page of the tasks linked to the project.
task-2648955
Closes#82379
Before this commit, we recently added a new route in project portal
called '/my/projects/:project_id/tasks' to get the tasks related to the
project. The problem is most of the code in this route is duplicated
from the original route to see all tasks in portal view. That is, the
route called '/my/tasks'.
This commit refactors the code to have the common code in a common
method and changes the result in both routes to have the `values`
dictionary expected in those routes.
task-2648955
Closes#82379
Before this commit, when the current user is in the '/my/projects'
route and selects a project the route becomes '/my/project/<id of
project>'. There is no reason to change the route and then adding the id
of the project. In sales order route, we keep the route and we add the
id of the SO to see the portal form view of the SO selected.
This commit renames the route of project and task form view to keep the
same route and the same logic of SO and quotations routes for instance.
task-2648955
Closes#82379
Before this commit, the portal user can see the parent stat button in
project sharing form view of task if the parent is in the same project.
This button can be clicked and it redirects the user to the parent task
form view in the project sharing.
This commit improves this button and its visibility in project sharing
feature. The button is visible only if the current user has access to
the project of the parent task. That is the privacy visibility of the
project should be set to 'portal'. If the portal user has access to the
project of the parent task and he is not a collaborator of this project,
then the current user will be redirected to the classic portal view of
the parent task. If it is a collaborator then we display the parent task
in the project sharing feature.
task-2648955
Closes#82379
Before this commit, in project sharing feature, when the portal user is
in task form view, he can see the sale order stat button if a sale order
is defined in the task but this button is disabled.
This commit allows the portal user to click on this stat button if he
has access to the sale order of task. If he cannot access then the stat
button will be invisible.
And if the portal user clicks on this button, he will be redirect to
`/my/orders/<id of the sale order>`.
task-2633229
Closes#82379
Before this commit: a coupon's start and end dates were compared with
the order date. When a customer adds a product to the cart, it creates
an order on the website. If the customer makes an order, it will remain
active until he completes it, even when the coupon is expired.
To reproduce the problem, add a product to the cart, create a coupon,
and set its end date to present time. Now you can use the coupon after
the end date has passed. So it's better to check the date with the
current time.
opw-2711987
closesodoo/odoo#84422
X-original-commit: e0b9fa49c4887ea4e6d1525e99eacf7c35e469a0
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit ensures that changes are applied in the same order as the
events are triggered on the we-matrix. This was not the case because of
another bug we had to consider and which is not there anymore, this is
why this fix is done in 15.0 and not before.
This commit is the continuation of [1] which applied the same change for
we-input.
[1]: https://github.com/odoo/odoo/commit/db62a5fac123fc72e37e94709b1a0c80f32a8a29
task-2761187
closesodoo/odoo#84486
X-original-commit: 703e1ec69c2cbdbdbafeef9ac359db9f0f3b7021
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Commit 57701b2 resulted in another bug as links could not longer be
edited. This refines it so it fixes the bug it solved without the
nefarious side effect.
closesodoo/odoo#84464
X-original-commit: 84fd0b0a1bc1d874e7d6d6ff10b4fb6351f5a1af
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Co-authored-by: David Monjoie <dmo@odoo.com>
Co-authored-by: Antoine Guenet <age@odoo.com>
Steps to Reproduce:
- Install 'account' module
- Go to Settings and set a token for Google Drive
- Activate Google Spreadsheet
- Go to Invoicing -> Invoices
- Under Search bar, click on Favorites -> Add to Google Spreadsheet
Issue:
A spreadsheet does open but with no data (no formula or config).
Cause:
The V3 API we were using was turned down in August 2021 and therefore
not able to use the api to write on the spreadsheet.
https://cloud.google.com/blog/products/g-suite/migrate-your-apps-use-latest-sheets-api)
Note: In case that the system parameters `google_drive_client_id` and
`google_drive_client_secret` has been changed (and therefore also the
default templates), it must be ensured that the `client` has the
Google Sheet API (v4) activated and the scope
`https://www.googleapis.com/auth/spreadsheets` set.
API activation and configuration available here :
https://console.developers.google.com/apis/dashboard?project=[PROJECT]https://console.developers.google.com/apis/credentials/consent/edit?project=[PROJECT]
**[PROJECT]** : Google project that will be linked to `google_drive_client_id`.
opw-2633951
closesodoo/odoo#84488
X-original-commit: 3268530a071d9351ca86776fe85289ee5feece3d
Signed-off-by: Nasreddin Boulif (bon) <bon@odoo.com>
Chart.js did badly compute the graph canvas container height (width) by
using clientHeight (resp. clientWidth) that may be rounded up by the
browser. This leads to the appearence of a useless scrollbar in the
graph view and makes it flicker on some update.
closesodoo/odoo#84476
X-original-commit: 6bceae94619da9f4943cbc1e58844fdbe0215802
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The es-check help specify that the `--module` optional argument as to be
given at the end of the cli. After an update to version `6.2.1` it led
to errors on runbot's where the Dockerfile was updated. The error was
like if the `--module` cli argument was not given at all. e.g.: `error:
SyntaxError: 'import' and 'export' may appear only with 'sourceType:
module'`
With this commit, the argument is given at the end of the cli as
expected.
closesodoo/odoo#84416
X-original-commit: dc74fd866d63003d987fc365a8137ff0e1c2d017
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
In big databases, the number of tags becomes rapidly huge. This makes
it very hard to find revelant tags. In practice, the same few tags are
usually used in a given project.
This commit:
- Limits the search of tags to the project's tags of the task as well
as to the tasks' tags of the task's project.
- Prevents creating case sensitive variants of existing tags.
- Reuse existing tags from other projects and other projects' tasks
when the user `creates` (or at least thinks creating as the
_name_search would not return the searched tag) a new tag in his project.
task-2735833
closesodoo/odoo#82925
Related: odoo/enterprise#23814
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Reduces load_menus answer size by 32% (between 20kb and 200kb savings
for the initial loading of the backend, depending on the number of apps
installed). Support for SVG icons in the web client for menus/apps.
Reduced PNG icons for apps list (8 bits PNG instead of 24 as our icons
don't need more colors as they are flat designs)
closesodoo/odoo#84280
Related: odoo/enterprise#24200
Signed-off-by: Fabien Pinckaers <fp@odoo.com>