Remove 'TestMailCommon' and 'TestSMSCommont' test classes. Use MailCommon
or SMSCommon when possible to ease move of test addons and inheritance.
'TestMailCommon' was useless and is replaced by the 'MailCommon' class defined
directly in Mail addon, easing inheritance and imports.
'TestSMSCommon' was useless and is replaced by the 'SMSCommon' class defined
directly in SMS addon, easing inheritance and imports. See community PR for
more details.
Task-3263512
closesodoo/odoo#117606
Related: odoo/enterprise#39291
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
'TestSMSCommon' was useless and is replaced by the 'SMSCommon' class defined
directly in SMS addon, easing inheritance and imports. See community PR for
more details.
Task-3263512
Part-of: odoo/odoo#117606
'TestMailCommon' was useless and is replaced by the 'MailCommon' class defined
directly in Mail addon, easing inheritance and imports.
Task-3263512
Part-of: odoo/odoo#117606
TestMailCommon was an empty class in test_mail kept for backward compatibility
while MailCommon is in mail. This is needed as we plan to move test_mail in
another addons path in order to isolate test addons.
Task-3263512
Part-of: odoo/odoo#117606
When a new tax is created and click on Reload button of fiscal Localization it
will generate traceback.
Steps to Produce:-
- Create a new Tax.
- Then open the setting of invoicing and Click on reload Button which is located
inside fiscal Localization.
- IndexError will be generated.
Cause:-
- When a user creates a tax from UI `get_external_id` return an empty string and
we try to `spilt` an empty string and get 1 index value and because of that
it gives traceback.
Fix:-
- Check xml_id is not null before trying to spilt and get the value from xml_id.
Sentry-4042986115
closesodoo/odoo#117709
X-original-commit: 3b86115d5f989c3b35579e75c67d94d120ef6be2
Signed-off-by: William André (wan) <wan@odoo.com>
There is a very nice and clear system that helps the user to figure
what are the available area to drop content inside, and what will they
do: are they shared between products, or product specific etc.
The issue is that once you have dropped a snippet inside, that helper
message is not shown anymore, but it's still not obvious which area is
used for what, actually you have no clue which one is which, especially
if you come back on the page later: at best remember there were 2
separate zones but you don't especially remember which one is which.
Keeping the message helps in that regard without any negative impact.
Note that making the message appear when there are already a snippet
will work out of the box in the sense that the message will be
duplicated and shown twice: one at the very bottom of the area and one
at the very top.
Note that there is 5 cases to consider here:
- Empty website.page in edit mode (no drag & drop)
- Empty website.page with drag & drop
- Non empty website.page with drag & drop
- Empty product description with drag & drop
- Non empty product description with drag & drop
This commit also takes care of fixing the text color issue where the
"editor message" could not be read because of text color too close to
bg color.
task-3160416
closesodoo/odoo#117705
X-original-commit: 9236628b0d037a0a9444d13a30d813f4a8413377
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
It takes a too long to load project task kanban view.
And ~85% of this time is spent in `ProjectTask._get_all_subtasks`,
which is a recursive method returning the children of the children,
while any, of the task, for each task, just to display their count.
We replaced this recursive method with a SQL request,
which is way faster. Also, it can be called in batch.
It will return a dict {id: subtask_ids}.
task-3246085
closesodoo/odoo#117624
X-original-commit: 3b55936fed9ebdcfb8190437ad66c3e42c26b01c
Related: odoo/enterprise#39295
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Incorporate Rolando Duarte (rolandojduartem) as Vauxoo's contributor.
I confirm I have signed the CLA and read the PR guidelines at:
www.odoo.com/submit-pr
closesodoo/odoo#117655
X-original-commit: 4c633bbec60ac9dcbbe2c3364f95d15f8a3ab0f5
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
On a calendar event, the 'free' option does not hide the element.
So that the user doesn't expect this behavior,
you have to modify its description.
opw-3047999
closesodoo/odoo#117654
X-original-commit: ecc850f4df1151a793d36fdd58621665a6e1a414
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
In some themes, RGBA colors were used to define the colors of shapes.
However, adding this color in the parameters of the background image URL
of a "shape" element was not valid. This caused several bugs, such as
the colorpicker not finding the colors of the shape used, as well as the
colors of the shape being lost after the application of a "flip".
Steps to reproduce the bug:
- In website edit mode, open the homepage page of the Nano theme.
- Drag and drop a Banner snippet onto the page.
- Bug: The colorpicker does not recognize the four colors used by the
shape.
- Click on one of the two "Flip" buttons.
- Bug: The colors of the shape are lost.
task-2824607
closesodoo/odoo#117652
X-original-commit: 0661aa0bbb4751866cfcc9a320a8eff473ba0442
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
With `generic_coa` now installed by default, the default pos.config are
automatically assigned a sale and an invoice journal, and trying to install
afterward a country specific chart template result in the following error:
2023-04-03 16:29:27,642 9344 ERROR _testdb-162820-testdb-162820-point-of-sale odoo.sql_db: bad query: DELETE FROM "account_journal" WHERE id IN (1, 2, 3, 8, 4, 6, 9, 7, 5, 10)
ERROR: update or delete on table "account_journal" violates foreign key constraint "pos_config_journal_id_fkey" on table "pos_config"
DETAIL: Key (id)=(10) is still referenced from table "pos_config".
Traceback (most recent call last):
...
File "/home/odoo/src/odoo/saas-16.2/odoo/modules/loading.py", line 481, in load_modules
processed_modules += load_marked_modules(env, graph,
File "/home/odoo/src/odoo/saas-16.2/odoo/modules/loading.py", line 365, in load_marked_modules
loaded, processed = load_module_graph(
File "/home/odoo/src/odoo/saas-16.2/odoo/modules/loading.py", line 297, in load_module_graph
module.write({'state': 'installed', 'latest_version': ver})
File "/home/odoo/src/odoo/saas-16.2/addons/account/models/ir_module.py", line 67, in write
self.env['account.chart.template'].try_loading(
File "/home/odoo/src/odoo/saas-16.2/addons/account/models/chart_template.py", line 141, in try_loading
return self._load(template_code, company, install_demo)
File "/home/odoo/src/odoo/saas-16.2/addons/point_of_sale/models/chart_template.py", line 16, in _load
result = super()._load(template_code, company, install_demo)
File "/home/odoo/src/odoo/saas-16.2/addons/account/models/chart_template.py", line 176, in _load
self.env[model].search([('company_id', '=', company.id)]).with_context({MODULE_UNINSTALL_FLAG: True}).unlink()
File "/home/odoo/src/odoo/saas-16.2/addons/account/models/account_journal.py", line 524, in unlink
ret = super(AccountJournal, self).unlink()
File "/home/odoo/src/odoo/saas-16.2/addons/mail/models/mail_thread.py", line 326, in unlink
res = super(MailThread, self).unlink()
File "/home/odoo/src/odoo/saas-16.2/addons/mail/models/mail_activity_mixin.py", line 246, in unlink
result = super(MailActivityMixin, self).unlink()
File "/home/odoo/src/odoo/saas-16.2/odoo/models.py", line 3635, in unlink
cr.execute(query, (sub_ids,))
File "/home/odoo/src/odoo/saas-16.2/odoo/sql_db.py", line 311, in execute
res = self._obj.execute(query, params)
psycopg2.errors.ForeignKeyViolation: update or delete on table "account_journal" violates foreign key constraint "pos_config_journal_id_fkey" on table "pos_config"
DETAIL: Key (id)=(10) is still referenced from table "pos_config".
This commit also reset the journals on the existing pos.config so that
`post_install_pos_localisation()` assign the right ones once the new
chart template is loaded.
We also only reset payment methods and journals in case we load a new
chart of accounts (this fix the "reload" of the CoA when PoS is
installed)
closesodoo/odoo#117651
X-original-commit: 7a91c57f6bb47e40f0486ca06f0e1916b98db1f4
Signed-off-by: Joseph Caburnay (jcb) <jcb@odoo.com>
Signed-off-by: Xavier Alt (xal) <xal@odoo.com>
Prior to this all of the context of the action called in the list
action was overriden. We now combine the action context with the
environment context.
This allows keeping the context from the XML action that defines the modal sizing.
task-3235932
closesodoo/odoo#116287
Related: odoo/upgrade#4493
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Some code in handle notification wrongly assumes `store.user`
is set, as it reads `user.id`. This is correct when the user
is authenticated as an internal user, but for guests this is
incorrect.
This commit adapt code of handling notifications so that
`store.user` can be undefined for guests.
Fix runbot issue 19978
closesodoo/odoo#117647
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This happens intentionally on tours that finishes successfully
before the emojis are fully loaded. Notably short tours like
public discuss page show this case.
The console.warn still trigger unhappy runbot. Functionally
the emoji picker shows "Failed to load emoji", so this warning
becomes useless.
Fix runbot issue 20081
closesodoo/odoo#117642
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
This may happen when receiving a new message without setting
the self persona yet.
Fix runbot issue 19975
closesodoo/odoo#117633
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit: the `product.display_name` field could contain
line breaks, which prevented it from being matched correctly by
regular expressions. This commit fixes the issue by modifying the
`_product_search_string()` function to remove line breaks.
opw-3239830
closesodoo/odoo#117626
X-original-commit: f598903fe06e44a03dc0ea1a20ef2667b42eed08
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Since saas 16.1, we added a more visible error information box when the
module system cannot find some dependencies, or if there is an error in
the JS code. This error box is very useful to understand a lot of
typical devlopment issues. However, it was occasionally displayed in
production code.
However, we sometimes observe that the error information box was
displayed, because the request to load an assets failed with a 404.
It is unclear in which circumstance this can happen, but it seems that
the following elements are involved:
- the user has an open tab with odoo, kept open for a while
- some js code is changed on the server, which causes the previous
assets to be deleted
- the user reload its open tabs, so the browser will load the /web page
from disk, which points to the old assets files
- then it will try to load all assets, with a 404 on one of the script
- the error information box is displayed
This commit intercepts the loading error and stop displaying the error
information box, which is basically the same behaviour as 16.0 and
before. We could force a reload in that case, but it seems dangerous,
since in case of errors, it could easily lead to an infinite loop.
closesodoo/odoo#117625
X-original-commit: 0a44b5b1e008b591a716efd26217c7db7360c37b
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before revision 5bf1207c8c
a new environment was created for each call
at `xml_import` or `convert_file`,
with `odoo.api.Environment(cr, SUPERUSER_ID, {})`
meaning the context was empty, meaning the lang was never set
Now that we pass from end to end the environment,
the caller of `xml_import` or `convert_file`
passes his own environment, therefore propagating
his `context` variables, therefore potentially passing
a lang in the context.
Therefore, since this change, the lang of the user
is taken into account when calling `xml_import`/`convert_file`,
and it updates the translation term rather than the source term
for translated fields.
This could be an actual/intended valid behavior,
this needs to be discussed,
but currently the places where `xml_import`/`convert_file`
is called expects to update the source term,
not the translated term.
See for reference
https://github.com/odoo/odoo/pull/116780#issuecomment-1486506663
Therefore, as this is an unexpected/unintended change of behavior
of the refactor 5bf1207c8c,
and as code blocks calling `xml_import`/`convert_file` have not
been adapted, we prefer to play it safe
and revert the behavior to what is was.
This is very possible other context keys will need to be dropped,
but one of the desired change of the refactor was to be
able to pass keys in the context, currently we prefer
to not wipe the environment context and just blacklist the one we
do not want to propagate, such as the lang.
If other related issues arise, we will then re-consider.
closesodoo/odoo#117621
X-original-commit: 44fa57e52fbc853b7756a96c73c94baa469c99ca
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Steps to reproduce the error:
1. Open a Pos
2. Without any orderline, click on `+-` button
3. You will see an error
issue https://github.com/odoo/odoo/issues/115642closesodoo/odoo#117620
X-original-commit: a588bb7fbe9ad6accaa12ebf1ce59767284c4f12
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
This commit converts almost all odoo module by native module.
The goal is to deprecate odoo.define in favor of native module and then
simplify boot.js by removing the regexp that finds module dependencies.
task id: 3162300
closesodoo/odoo#117456
Signed-off-by: Géry Debongnie <ged@odoo.com>
Before this revision, a date/datetime field was displayed in UTC instead
of in the user timezone.
This revision fixes this issue.
opw 3127742
closesodoo/odoo#117623
X-original-commit: c07b450594f7e3e1f093d0b5a5a083f915f75310
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Other modules (i.e. `hr_payroll_account`) might also be creating demo
accounts, do not prevent that.
closesodoo/odoo#117551
Related: odoo/enterprise#39256
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
In the previous state of the point_of_sale module, when the l10n_fr_pos_cert
module was used, we were too restrictive leading to an unusable flow by some
clients. We adapt the modules here so that the FR module is more usable
by the clients while still respecting the law.
closesodoo/odoo#113754
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Steps to reproduce
==================
- Go to elearning
- On the "Trees, Wood and Gardens" card, click on "view course"
- Click on Main Trees Categories
The slide name is outside the view
Also, the XP badge is cropped
opw-3225999
closesodoo/odoo#117595
X-original-commit: 1d5a92a04ba8e52099715cf782cecbb2c73feb14
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
Before this commit:
- A portal user cannot access the project if he's not a
follower but a public user can do that and it doesn't
make sense for portal users to have less access than public users.
- Technically the problem was that we call _check_project_sharing_access
with the portal user instead of sudo, so when trying to access
self.collaborator_ids, an exception is raised saying that
the portal user cannot access to project fields.
After this commit:
- Portal users can access the project in read-only when they are not
followers.
- Technically, we preferred searching over just adding self.sudo()
to get the result directly in one query for a better performance.
task-3205644
closesodoo/odoo#117549
X-original-commit: f51685213c2c10a54e4d31f42d20a4bc7f4b17cc
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
This commit improves ux/ui by adding the slide
description on top of a quiz and offering links to additional
resources if the user gets questions wrong.
task-3246366
closesodoo/odoo#117530
X-original-commit: a551f956f05bf7b6782e04a95351bf2d0a0a6610
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes the problem of invisible borders when pivots and lists are
inserted. Now around headers and the total row, black borders are added.
task 3103403
closesodoo/odoo#117493
Related: odoo/enterprise#39218
Signed-off-by: Lucas Lefèvre (lul) <lul@odoo.com>
This commit fixes the totp tours which fail on a step in
the profile dialog. The step searches for an element
".o_dialog_container" that is removed since commit
e51112e0df7f5e05d3cdf2c01d236c6bbbf123a6
closesodoo/odoo#117451
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
The aim of this commit is to simplify the RelationalModel by moving
Kanban's specific quick create record functions to the Kanban View.
Before this commit, when asking to create a new record using the quick
create on a kanban view, a new virtual record was created by the
DynamicRecordList and added to the DynamicGroupList on the
RelationalModel. A complex mechanism was used to be sure that only one
virtual record is created between all DynamicGroupLists. When the record
was save, the new record (in form view style) was modified to a kanban
style (to do this, the record's activeFields were modified to be
compatible with the kanban card).
Now, the virtual record is created on the Kanban View, in a more simple
way, the kanban renderer knows in which group there is a quick create,
and only in that one the form renderer of the quick create record card
is shown (not need of complex mechanism to have only one quick create
between all groups). After the save, we simply call an existing function
to add the new record to the group using the record's ID (not need of a
complex mechanism to modify the record to a kanban style).
part-of task-id 3179751
closesodoo/odoo#117449
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Problem:
The email created by _send_availability_email is not translated correctly.
The body is always sent in English
and the subject will always use the current language of the database.
Example:
Partner A's language = Spanish
Current database language = "French"
The body of the email sent to Partner A will be in English and
the subject of the email sent will be in French and
the field attributes of the products will be in English.
Solution:
Pass in the partner's language into the self's context and the product's context.
This fix will translate the entire email uniformly according to the context's language.
opw-3207979
closesodoo/odoo#117375
X-original-commit: 8777f86adc3ad382b6948461781fb72b1b068944
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
*: l10n_fr_pos_cert, pos_sale_product_configurator
This is a continuation of the effort of making pos addons independent
from legacy web modules. In this commit, the popups are now completely
independent from the legacy environment. `env.pos` inside each popup
is no longer pointing to the instance of `PosGlobalState` (`globalState`).
To access the `globalState` inside each popup, we have to read it from
the `pos` service (via the `usePos` hook) which is done in this commit.
closesodoo/odoo#116307
Related: odoo/enterprise#39271
Signed-off-by: Samuel Degueldre <sad@odoo.com>
The first problem when multiple analytics accounts exist is the
sql query, it is generated with less placeholders than the actual
parameters.
The second problem is the getter from the collected data dict, it
is assuming there is only a single account.
closesodoo/odoo#115189
X-original-commit: 8da76614c58ea1989694a5af3ee623640db126dd
Related: odoo/enterprise#38146
Signed-off-by: William André (wan) <wan@odoo.com>
Before this commit, in the website profile frontend, if we filter the users
using 'This week' or 'This month' filters we always get a '+' displayed before
the karma gain.
If user gained negative karma, lets say -500, currently it displays as follows
--> +-500 , instead of -500.
After this commit, if the gained karma during the period is it will show
-500 instead of +-500.
closesodoo/odoo#117548
X-original-commit: 53b406bcf92e50e62329f1b128742bd851d22cb0
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
- Create an account of type current asset
- Add him a Sales Tax and a Purchase Tax
- Create invoice
- Add a line
- Remove the taxes from this line
- Change the account to the one you created
=> A purchase tax is applied to the line.
It should not happen, so we prevent it.
closesodoo/odoo#117539
X-original-commit: 85d89a986b6adcf9d0ac0ce57599d4b2678b59a3
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Wala Gauthier (gawa) <gawa@odoo.com>
The test tour `time_off_request_calendar_view` would fail once the first
Thursday of the year was not visible to the user (e.g. on the 1st April)
as the MouseEvents would not be fired.
closesodoo/odoo#117512
X-original-commit: 70f840999b67515bc7d7220321c8e39bec2adefc
Signed-off-by: Kevin Baptiste <kba@odoo.com>
As the upload service (js) only uses iteration, index based access and length
on the files parameter, it is compatible as well with an array of File as files
parameter (instead of a FileList). So, we have updated the files parameter
docstring to accept as well array of File. With this change we can easily pass
a modified list of files (ListFile being hard to create on some browser).
Example of use-case, only send to the upload service the files smaller than a
given threshold by transforming a FileList to an array and then by filtering
it.
Task-3179130
closesodoo/odoo#117385
Related: odoo/enterprise#38490
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Purpose of the commit is to do the generic improvements for project.
So in this commit did the following changes:
- adding a label 'last update' to the stat button in project form view.
- indicate 'my project' in the tab instead of 'project sharing view in portal' in project sharing.
- set the first non-folded stage of the project as default on newly created tasks.
- remove user confirming the SO as the default project manager.
- hide fields service_tracking, service_upsell_threshold if sale_ok is false.
- set purchase_method to purchase by default if product is of service type.
- remove the : next to the totals labels and decrease the font-size for values of 'total hours'
and 'remaining hours' in timesheets notebook in project task form view.
task-2897867
closesodoo/odoo#96548
Related: odoo/enterprise#29774
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Co-authored-by: Manisha Tulsiyani <matu@odoo.com>
Current behaviour:
You can see the `Sales Order Item` field in the project's `Settings`
sheet page when the project is not `Billable`.
Expected behaviour:
If the project is not `Billable`, we hide the field `Sales Order Item`.
Steps to reproduce:
- Install `sale_timesheet`.
- Project > kebab-menu on project > Settings
- Click on the Settings tab of the project's form view
- Observe there is a `Sales Order Item` field, even if the project
is not Billable.
Reason for the problem:
Before, `Sales Order Item` was in the Invoicing tab, which is
visible only when the project is billable and a partner is set.
Due to a recent refactoring (b77f60b155),
the field was moved to the `Settings`, but the visibility condition
that was on the invoicing tab was not.
Fix:
Add the missing visibility condition on the field `sale_line_id`.
Affected versions:
- saas-16.1
- saas-16.2
- master
opw-3250937
closesodoo/odoo#117546
X-original-commit: ea97fb5be0ae3d40940f7befac6a2bc19c89b084
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Steps to reproduce:
Make a sale order with a product and quantity > 1, add
FedEx international shipping and validate the delivery
In the document you will see that the unit cost is equal
to subtotal which is wrong.
There is a discrepancy between `_get_commodities_from_order` and
`_get_commodities_from_stock_move_lines`, that the former makes
commodities with `monetary_value` equal to the unit price, while
the latter uses subtotal. in the method `commodities` in
`delivery_fedex`, `monetary_value` is treated as unit price, so
the right way to fix it is to do it in
`_get_commodities_from_stock_move_lines`.
Note that when rating a delivery, commodities are made in
`_get_commodities_from_order` and then passed to `commodities`,
while for sending the shipping, commodities are made in
`_get_commodities_from_stock_move_lines`.
opw-3233369
closesodoo/odoo#117521
X-original-commit: 3beddbdd18937e1c69ec4fa6f523296c7c55528b
Related: odoo/enterprise#39234
Signed-off-by: Tiffany Chang <tic@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
Steps to reproduce:
- install any edi l10n
- create an invoice with edi xml
- try to print the invoice (this adds a pdf attachment)
- the attachment viewer shows whichever attachment added first
- it shows only the xml file name
Bug:
`_message_set_main_attachment_id` only works if there are no
`message_main_attachment_id` set.
Fix:
Override `_message_set_main_attachment_id` in the `account.move` module to
alter this behavior
OPW-3147811
closesodoo/odoo#117510
X-original-commit: 383834b11bf6b7a80848e5d238b12fa237b9edf3
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Mohamed Megahed Abbas Megahed SALLAM (mome) <mome@odoo.com>