Current behaviour:
Cannot add a Work Order to a Manufacturing Order
if the analytic account linked to the MO doesn't
have an associated company.
Expected behaviour:
Should be able to add a WO to a MO even
if the linked analytic account doesn't have
an associated company.
Steps to reproduce:
1. Activate analytic accounts
2. Activate work orders
3. Create an analytic account without company associated
4. Create a Manufacturing Order
5. In miscellaneous, link the analytic account
6. Try to add a WO line
7. Error log
Reason for the problem:
When trying to add a WO line, if the MO has been linked
to an analytic account, it checks for the currency in
the company in the analytic account, which was not
existent, since the company didn't exist.
Fix:
When trying to access currency, if the company in the analytic
account doesn't exist, it defaults to the company in the WO.
opw-3210708
closesodoo/odoo#117708
X-original-commit: f0d8f5e82e62e0bcfc05e25dac2504f8f07537f4
Signed-off-by: Demany Antoine (ande) <ande@odoo.com>
Signed-off-by: Tiffany Chang <tic@odoo.com>
Removing the "Oks" from the "Archive" modals to
clarify what confirming the action will do.
Also fixing a wording error in the form controller
archive modal.
Task-3241064
closesodoo/odoo#117588
X-original-commit: 61c8b51a3d77e913acacead6379cd686693f86ce
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently, website users/visitors are not able to search the events based on
where they happen.
This PR improves the behavior by allowing the users/visitors to type the
city/country name in the search box and returns the events that are happening
in the country or city that matches the search term. To allow this, we have
utilized the `search_extra` search option and searching the matching events with
`sudo` because public users can not access the `address_search` m2o of the event.
This PR also shows the event location name when users search for the event.
Also add the "_getFieldsNames" method to easily override this method to
add a field name from another model.
Note that searching with sudo is just to add event ids in the domain. The final
result will be returned with not sudoed environment and so the record rules are
always respected.
TaskId-2791031
closesodoo/odoo#89796
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Currently, if a user searches for an event based on a location name, the
location name is not displayed.
This commit shows the event location name when users search for the event.
Also add the "_getFieldsNames" method to easily override this method to
add a field name from another model.
task-2791031
Part-of: odoo/odoo#89796
Currently, website users/visitors are not able to search the events based on
where they happen.
This commit improves the behavior by allowing the users/visitors to type the
city/country name in the search box and returns the events that are happening
in the country or city that matches the search term. To allow this, we have
utilized the search_extra search option and searching the matching events
with sudo because public users can not access the address_search m2o of the
event. Apart from that, this commit also adds the ability to address_search
the event based on location (name) of the address on address_search.
Note that searching with sudo is just to add event ids in the domain. The final
result will be returned with non sudoed environment and so the record rules are
always respected.
TaskId-2791031
Part-of: odoo/odoo#89796
This commit is a security reinforcement.
Before this commit:
ir.action.act_url was able to handle and redirect to protocols like
file:, javascript:, date: ... This is unnecessary in the context of
this action. It could potentially be abused by a poorly written custom
module
It also would not isolate the landing page in case of a new tabs.
It means that chrome would still consider the tab to be from the
previous domain in case no url was passed and js was executed.
This would allow the newly open tab to still make query's to the
referrer using the referrer's cookie. While not stricly necessary
if we already prevent url that start with "javascript:", it is a
nice to have.
After this commit:
New tabs are not able to access referrer informations or execute
javascript interacting with the referrer. Also, it is now impossible
to redirect to protocols other than http and https directly from
the ir.action.act_url
Test update:
All new tabs are required to have the "noreferrer" argument
Tested an example of an unsupported protocol.
closesodoo/odoo#117687
X-original-commit: a020072da17e32fca0bbe6ed02b1afaeec8e8a02
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
1. Install [Manufacturing] on Apps
2. On [Settings]>[Manufacturing]
- toggle on [Work Orders], [Quality] & [Quality Worksheet]
3. Go to Manufacturing
- Work Centers (a.k.a WC) Overview should be visible
- if no W.C. by default, add from [Configuration]>[Work Centers]
4. click on the 3 dots at the top right corner of each WC card
Issue: ugly layout
Fix: restore the style
affected branch: saas-16.1 up to master
closesodoo/odoo#117695
X-original-commit: 40a5d29d9b5b4070269175a83866837c7725b8c9
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Lee, Hansun (hale) <hale@odoo.com>
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>