foreign_currency_id & currency_id must always be different on a statement line.
However, this happens sometimes when importing statement lines in csv.
closesodoo/odoo#109574
X-original-commit: 0b2cb4c82fa38ca1242c2344546768e481841116
Related: odoo/enterprise#35630
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: William André (wan) <wan@odoo.com>
The tree view `view_module_category_tree` was unused, remove it.
The form view (`view_module_category_form`) of `ir.module.category` is
still used in the `view_groups_form` view.
Part-of: odoo/odoo#109420
Since https://github.com/odoo/odoo/pull/87522 (landed in v16),
`fields_view_get`, `_fields_view_get` and `load_views` are deprecated.
Remove it for maintenance (and it is the last usage of
the useless field `field_parent`).
Part-of: odoo/odoo#109420
Before this commit, when the user creates a task in the (quick create)
form view of task, he can select the internal project. The goal of this
project is to contain the timesheets representing the time offs of each
employee.
This commit filter the projects available for the task creation/edition
to be sure the user cannot select internal project.
closesodoo/odoo#109002
Related: odoo/enterprise#35377
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
The PR improves user experience and database consistency for triggered questions.
* Deleting questions/answers used in triggers will clean those triggers to avoid corrupt
trigger configurations.
* Questions and Survey are saved during edition allowing to add questions with score,
validation parameters (checked against SQL constraints), and triggers on the fly
without having to save the survey and reenter edit mode. This required to modify the
basic_relational_model `Record` `save` method to be able to display a notification
instead of another modal in case of `ValidationError`.
* Questions that are moved and placed before their trigger will show the icon in
`text-danger` with a warning message on hover, because other forms of feedback
would be too strong to be given when users are busy reordering.
Tests are included to ensure the specific behavior and needs of this module in case
some JS framework implementations change later on.
See details on each commit.
Task-2623482
See odoo/upgrade#3613closesodoo/odoo#78705
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
## Survey
Due to the behavior of X2Many fields, the questions created when editing
a survey were not usable immediately after creation to be conditional
triggers for new questions. The whole survey had to be saved first, which
wasn't a smooth experience for the user.
This commit will save the survey and question at several times:
### For each new question added
Similarly to what was implemented for chatbot scripts, enables the
immediate computation of allowed question/answer triggers, permitting their
use when chaining question creation.
This also enables to check the answers "validation" fields immediately, and
activating scoring and add scores to question/answers without requiring the
extra steps of saving and re-entering edit mode for the survey.
### When rows are deleted
This will trigger the immediate removal of the triggers icons on
questions that were triggered by an answer to the deleted question.
### NOT when questions are moved
As there is no convenient way to ensure questions are properly ordered with
respect to their triggers (order dependency) without popping error messages
at every step when reordering questions, we chose to mark the misplaced lines,
missing trigger records or triggers that will be ignored (with the new
`trigger` widget).
This could have been done entirely with 'server' logic, but that would have
required additional saves and cleaning fields even more often, even during a
temporary reordering step, which isn't convenient.
### Misc
Finally, note the extra fields added on the question_and_page_ids field of the
survey form view, required to trigger these fields' update consistently
(required after reordering or removing records which sometimes doesn't occur
without these).
Tests ensuring the behavior of the X2Many (saving parent on open/edit and show
notifications on error) and the trigger widget are included.
## web
To support the functionality described above, we need to allow the caller of
'save' to catch errors to prevent default handling (here to use a notification
instead of an additional Dialog).
Task-2623482
Part of odoo#78705
Part-of: odoo/odoo#78705
Before this commit, the state of a question triggering fields could be
inconsistent/corrupted:
* If a question used as trigger for another question was deleted,
`is_conditional` would stay `True` even as `triggering_question_id` would be
`False`, which would eg. prevent saving the question edit form unless this
is not manually fixed.
* If an answer used as trigger was deleted, the triggered question
would never show on a survey session, but still appear as "triggered" and
causing the same trouble on form edition.
In this commit, we
* update `unlink` methods to remove the triggering fields on triggering
question/answer deletion
* add SQL constraint to ensure DB consistency (also improving the survey
cloning/copying behavior robustness)
* add a python test checking this
Task-2623482
Part of odoo#78705
See odoo/upgrade#3613
Part-of: odoo/odoo#78705
Purpose: Showing validation parameters with an arrow on one line (when
possible) is prettier.
Additionally, we now
- Improve data consistency by preventing saving `validation_required` without
setting validation parameters (also allows to keep arrow invisible when no
value is set)
- Explicitly add required flags to float values as they cannot be not set (see
c5ae9b38).
Task-2623482
Part of odoo#78705
Part-of: odoo/odoo#78705
Issue: `node.data` is an unescaped text content and used as an escaped
content just after (set `innerHTML`) which remove some of the escaping.
Without the fix, the 2 new first assertions would fail:
- first one with 'https://example.com/?¤cy_id' instead of
'https://example.com/?&currency_id' in the text node
- second one with `&` replaced by & and `>` replaced by >
other assertions ensure that use case before the fix (special char and
URL regex, smileys, ...) still work the same after the fix.
opw-2525028
Fixes#70485closesodoo/odoo#109357
X-original-commit: 4938af5dd8bfb4ea0722e3de8340ff6437329b48
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
After https://github.com/odoo/odoo/pull/99386, clicking on the email button in
calendar.event form view would give a traceback as it tried accessing event_id
on a calendar.event record. This commit fixes this error as the object in the
template already is an instance of calendar.event.
task-3127534
closesodoo/odoo#109549
Signed-off-by: Arnaud Joset <arj@odoo.com>
Steps to reproduce:
- go to "Link Tracker" app;
- go to "Campaigns" tab (UTMs);
- create a new campaign;
- leave and return in this record.
Issue:
A traceback appears.
Error message:
`Invalid props for component 'Notebook': 'defaultPage' is not a string`
Cause:
The `defaultPage` prop must be a string.
When the record is new, it will be `undefined`,
so it will pass props validation because this prop is optional.
But when we try to calculate it and it does not return a value,
the `defaultPage` is null.
The variable is therefore declared but it is empty
(and therefore not a string).
`null` value does not pass the props validation test.
The problem appears in the "Campaigns" tab
because there is a notebook without content.
Solution:
Test if it is possible to have a value.
If not, set the `defaultPage` prop to be `undefined`.
opw-3109327
closesodoo/odoo#109533
X-original-commit: 402b1a822c3983af33aa1d3a3c7e93d8836c60d8
Signed-off-by: Dardenne Florent (dafl) <dafl@odoo.com>
Since the rewriting of the views in OWL2, it is not possible to clear a
set many2one field.
In this commit, we restore the clear button.
Steps to reproduce:
* Go to Sales (on Mobile)
* Create a new Quotation
* Select a customer
* Try to remove the selected customer => BUG
closesodoo/odoo#109531
X-original-commit: 57cb2a34c8211352baa439ee784dc370cc6abb1b
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Detailed Reason in Employee Departure wizard now has a placeholder, and an
unnecessary visual separator is removed.
task-3046435
closesodoo/odoo#108314
Related: odoo/enterprise#34288
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Steps to reproduce:
* Go on `res.partner` form view
* Add field `sale_order_ids` visible in the view
* Try to open one of the partner SO's by clicking on it
* Traceback, unable to read 'modifiers' on undefined
Unexpectedly, the field `order_line` is not available in the Sale Order
`activeFields` on the client side when opening the SO form view that
way, which leads to a traceback when trying to know whether that field
is readonly.
This commit makes sure the field is in the SO `activeFields` before
checking whether it is readonly.
opw-3097134
closesodoo/odoo#109541
X-original-commit: b37a2cf45e1f5b1422cd19269cd2b85085d75558
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
## Steps to reproduce
- install l10n_gcc_invoice module
- switch to a company in Saudi Arabia (SA company)
- create and print an invoice that has a payment term with a translated
note
We expect the payment term's note to be displayed both in English and
Arabic. But instead, the note is displayed twice in the customer's
preferred language.
## Cause
`t-field` does not use the context defined on the field itself. It uses
the rendering context.
opw-3101387
closesodoo/odoo#109330
X-original-commit: 8a3049a63c7e9b13892278784781a793f8e0ab4f
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
This commit adds default groupBy for task list view
to represent data properly menu vise.
- add default groupBy stage for tasks from project action.
- add default groupBy personal stage for `My Task` menu.
- add default groupBy project for `All Tasks` menu.
task-3084850
closesodoo/odoo#109281
Related: odoo/documentation#3311
Related: odoo/enterprise#35504
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit when user creates a private task user
still able to customer and sol field which no use for
private task.
This commit hide customer and sol field for private task
and reset customer field when user make non private task
to private task.
task-3084850
Part-of: odoo/odoo#109281
Before this commit it is not possible to add default
groupBy in list if users want default groupBy a list
then they have to pass default groupBy in action and
passing default groupBy in action groupBy other views
in action, so priorer to this commit users cannot add
default groupBy in list view without impacting other
view.
In, this commit add default_group_by in list view
attribute so users can add default groupBy in list
view without impacting other views in action.
task-3084850
Part-of: odoo/odoo#109281
Purpose:
User should be abled to delete him time off (time off that needs to be
validated by both, manager and time off officer), if it has not been validated
by officer yet.
The manager that validated the time off, should be notified
if/when the time off is canceled by the user.
Both manager and user should be notified if officer refused time off,
validated by manager.
This commit also fixes traceback on time off form in development mode.
If there is
<field name="A"/>
<label for="A"/>
we get traceback in dev mode.
Instread it should be
<label for="A"/>
<field name="A"/>
task - 2857233
closesodoo/odoo#94533
Related: odoo/upgrade#3809
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Some additional changes in mail composer tests before going into some rewriting
and improvements
* some improved messages in asserts;
* additional tests for attachments in mass mailing mode, using sub tests;
* additional tests for configuration (auto_delete_* fields, email fields,
subtype, ...);
* removed some wrong tests not failing due to current code: when testing
template values, do not give a creation value at the same time as it
will fail when moving to editable stored fields;
Task-2710804 (Mail: Clean MailThread Posting API)
closesodoo/odoo#109522
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Current behavior
In the recruitment module, if you set an email template for the first step of
a job recruitment process you cannot send any other email using the full
composer. This happen because the partner type goes from 'contact' to 'private'
and this type cannot be set as recipient in the full composer.
Steps to reproduce
- Go to any job recruitement and set an email template for the first
step
- Go on the website and apply for this job
- Go back to the job application and send an email using the full
composer, the email is not sent to the applicant. And the applicant
is not added to the followers.
Fix is to somehow improve support by adding asked partners from default in
context.
Note that this does not change anything from ACLs point of view, as trying
to access private partners without the necessary group or ACLs will raise an
access error anyway.
Also note that private partners defined on a template are still stripped
as they do not respect the new (nor the old) domain. That would be tricky
to solve, better not use private partners in templates.
opw-3010308
closesodoo/odoo#109451
X-original-commit: 12b25f21216b11511d5fed22fb3564d9dc297559
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
Add tests showing current behavior of partner_ids fields on composer when
dealing with private partners. Some use cases are added as unit tests
* default_partner_ids: coming notably from suggested recipients;
* template usage adding a partner (e.g. partner_to);
* when not having the rights to see private partners, access error should
be raised;
* mail gateway when a private partner sends an email;
X-original-commit: 2153eec790b730761fe50d6bea5cd4bacedce97a
Part-of: odoo/odoo#109522
Co-authored-by: Robin Engels <roen@odoo.com>
Before this commit, the ´.ace_gutter´ overlapped the beginning
of the ace widget text content.
It only happens in read-only mode if it's a one-liner content.
Note that ´aria-hidden´ attribute is not set on BS modal. So,
it seems useless to remove it. Maybe a relicate of Bootstrap 3.
Steps to reproduce:
In debug mode,
- Open Settings
- Technical
- Scheduled Actions
- Open any
closesodoo/odoo#109519
X-original-commit: dc65d3de3a02a8f196eb22348bdfe41ede23f5d1
Signed-off-by: Romeo Fragomeli (rfr) <rfr@odoo.com>
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
**Issue:**
- Try resizing a column.
- Bug: After releasing the resize, the column being resized is also reordered.
- This results to automatic resizing of the columns, not respecting
the current resize made by the user.
**Solution:**
1. Keep the size of the columns after reordering. Better UX because any resize
made by the user won't change when reordering the list (accidentally or purposely).
2. During resize, we track state variables - `resizing` and `preventReorder`.
- When resize starts, `resizing` is set to `true`.
- When the mouse pointer is released (mouseup), and before the `mouseup` event
reaches the `window`'s `mouseup` listener, the column title handles the `mouseup`
first, setting another state variable `preventReorder` to `true`.
- `mouseup` will eventually reached `window` which stops the resize, setting
`resizing` to false.
- Then, click event happens on the column header. And since the `preventSort` is
true, it will return early but resets the `preventReorder` to `false`.
- If the click event happened to be in the resizer span element, we should not
prevent it from bubbling so that `preventReorder` is properly reset.
**TASK-ID:** 3109501
closesodoo/odoo#109518
X-original-commit: 7a71a0974164277ac7fd382391684b078b71bf7d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Before this commit, the behavior disabling the unused snippet assets
performed two checks:
1. It was looking for occurrences for its use in the snippet template
2. It was looking for occurrences for its use in the HTML fields
3. Checked on the occurrences of step 1 and 2 and return result.
In many cases there are already coincidences in the first step, making
the second step unnecessary since this second one is the slowest.
Matches are now checked between steps 1 and 2 to skip the second if
matches are already found.
closesodoo/odoo#109488
X-original-commit: 56100532dbcbdeb5487662d0cbf35ba6d62b15b5
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The placeholder may be too long and not fit the screen. In this
situation it would not been shown at all. Using the `text-trauncate`
bootstrap class, the end of the text is truncated with an ellipsis in
case it doesn't fit on screen.
task-id-3098157
closesodoo/odoo#109424
X-original-commit: dc7e4c90c9c28c456c1dfbdd503a4cb9095a1292
Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is to convert the client actions in misc.js into the new
architecture.
We remove the client actions login and logout because they are no
longer used in the code base.
closesodoo/odoo#109332
Task-id: 3099992
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- Add link to see rescue session on each `pos_config`
- Change error popup by a alert popup when closing a pos.
Before the user wasn't notified when a rescue session isn't closed.
The popup isn't an error but a notification that inform the user that the session is already closed and a rescue session was created.
closesodoo/odoo#107000
Taskid: 2817110
Related: odoo/upgrade#4111
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
In the PR 104415, we add the possibility to abort the name_search rpcs
which will be ignored.
Unfortunately, we forgot that xhr.abort performs a reject which will be
converted into an "XmlHttpRequestError abort" error. This error will
cause a notification "Connection lost. Trying to reconnect...".
Solution:
We revert the modifications in the abort function and in the m2o
we catch all the errors on the rpc name_search that we are going to
abort because they have no more use.
How to reproduce:
- Go to a form view with a m2o field
- Having a slow network or a lot of records in the m2o
- Enter several char in the m2o search bar
Before this commit:
A notification "Connection lost. Trying to reconnect..." is displayed.
After this commit:
There is no notification.
closesodoo/odoo#109500
X-original-commit: 7bff161ac5e916bf4d4eabe4f9ada9a147893cf2
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Commit [1] added a whitelist of qweb directives that can be used
in qweb-based views (e.g. kanban). We forgot to allow the `t-debug`
directive, which obviously doesn't make sense in production but is
useful for debugging purposes.
This commit adds that directive to the whitelist, s.t. one can now
edit the view in xml or directly from the interface to add a
`t-debug`. Moreover, we add a test to ensure that we don't forget
a `t-debug` in an arch when we commit.
[1] 7fd5cec72bclosesodoo/odoo#109493
Signed-off-by: Samuel Degueldre <sad@odoo.com>
This fixes an extra section that was being shown from the account module in Chilean localization invoices
because of changes in the account template in 16.0
Now we display delivery address in chilean invoices if it is different than the customer's address.
Also reorganized the header to optimize space. Addresses now don't use extra line breaks, moved the GIRO
to the right, and the Address to the left
closesodoo/odoo#109490
X-original-commit: e76c0f827f7c2b0a054cd1e4572155ece094f2cc
Signed-off-by: Josse Colpaert <jco@odoo.com>
When run on new year, the test fails because the created
currency rate (for the test) conflicts with the one in
the demo data.
closesodoo/odoo#109483
X-original-commit: 5a62eb7a25a05c7e779866824e0c1308d558f64a
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
The vendor delay report only works with basic use cases. Here are
the issues:
- For each SM, we sum up the done qty of all SMLs without
considering the UoMs
- When grouping several lines (for instance, by partner and product),
we sum up the quantities of each line but their UoM can be different
- When grouping several lines, we sum the `qty_total` which are the
quantity of the related POL. This is an issue: suppose a POL with
a quantity Q and suppose there are two SM (backorder), if we group
by product, we will have a total quantity of 2Q, which is
incorrect (and so will be the delivery rate)
To reproduce the issues: See the tests added by this commit.
Note: the last test (`test_vendor_delay_report_without_backorder`)
was not failing before this commit. It is added to simply improve
the tests
OPW-3065065
closesodoo/odoo#109471
X-original-commit: c2e351534b9627b6844effba9943b09d4b0b93f3
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
removing the view from the return action and thus it will take the default tree view.
closesodoo/odoo#107345
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
Followup of b9e80c1403de0341a0c133a254142e53ef8c2842
In the last commit, we make it so when the tour was working as expected, the partner had an email.
But the problem which lead to another partner sometimes chosen instead was still there. We now make
sure to select the correct partner. Additionally, we supress an useless step.
closesodoo/odoo#109459
X-original-commit: 9b31ee81095ccef100c98cb0751b6e96d81f691e
Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
Indian edi does not support line with a negative subtotal
but this use case is common when you want to apply a global discount.
This commit modify the json generated. The negative line are
splitted on same HSN code of the positive line affecting the discount of the positive
line.
The total of the invoice and the taxes remain unchanged.
closesodoo/odoo#109389
X-original-commit: 80701911229af6b9a6a29420796e45fcdbbd13ec
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
Since the refactoring of the activity view, luxon is not in the
rendering context. Resulting in crashing in some activity views
that used luxon in their template.
- Go to Appraisal
- Switch to the activity view
- Create a record in this view -> crash
Now, luxon is in the rendering context.
closesodoo/odoo#109153
Signed-off-by: Luca Vitali <luvi@odoo.com>
Before, in activity view, it was not possible for users to hide
never used columns.
Now it is possible for users to hide and show columns in the
activity view.
task-3039919
Part-of: odoo/odoo#109153
One line of the tax report was still in plain French while the code should always be in English
Translate the data and update pot/po files.
closesodoo/odoo#109480
X-original-commit: bc8ff80b84d650c34224315097742cb878404f5b
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Some translations were lost when we changed to 16.0 since there is no l10n project for 16.0 on Transifex.
Reintroduced lost translations for Arabic, German, French, Italian, Dutch and Chinese.
Task: 3126103
X-original-commit: b2794c76fea71011c92212808bfd2bf2edf42645
Part-of: odoo/odoo#109480
Before this commit, when trying to change the menu from an invalid form
view, you would stay on the form view but the navbar would be modified
to dispaly the menu you had selected.
How to reproduce:
- Go to a form view
- Edit the fields so that the record is invalid
- Change the menu using the menu app or the palette command
Before this commit:
The form view has not changed but the navbar has been modified, it shows
the menu you selected.
After this commit:
The form view and the navbar have not changed.
closesodoo/odoo#109460
X-original-commit: bd7e36edcd2f9d33a72cc25b030f91c20da78387
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Every 90 days the imap auth needs to be done again, because that is the only
way the refresh token is updated. With this commit it is now done also when
a new access token is called.
closesodoo/odoo#109477
X-original-commit: b9ecb538b39e7d5467de141a515ac833ace02973
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Since [1] when the m2m widget was introduced, when the network latency
is high enough, the `_search()` method can be called several times in
parallel. The former list of existing records is removed before doing
the RPC call, then populated with the results received after the RPC
call returns. With the proper timing and race conditions, this could
lead to having the list cleared several times, then populated several
times with the incoming results.
This commit makes sure the list is cleared after the RPC results are
obtained instead of before.
Steps to reproduce:
- Create and save a blog post with several tags.
- Edit blog post.
- Configure network latency to one second in browser's developer tools.
- Remove one tag.
- Remove another tag after 500ms. (Because the search happens after a
`setTimeout`.)
- Open tag suggestions.
=> List contained the concatenation of the two suggestion lists.
[1]: https://github.com/odoo/odoo/commit/be05ac7e2b8d866a72693b761f3bc8576d54e59e
task-2811746
closesodoo/odoo#109479
X-original-commit: 48564abe484f61c09ca98c3cddd5b4b0b55e6497
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Since [1] when the blog tags field option was refactored to use the m2m
widget, the list of existing tags is not cleaned up anymore.
This causes custom tags to remain in that list when they are removed.
This commit adapts the existing condition to exclude custom tags that
have been removed.
Steps to reproduce:
- edit blog
- create custom tag 'test'
- remove custom tag 'test'
- create custom tag 'test'
=> was detecting the tag as already existing
[1]: https://github.com/odoo/odoo/commit/4a603cd59c8a3f33d9515f28d99a0f68c381c5d2
task-2811746
X-original-commit: 7f58519b922264efb6b6180608fd5a461d30b9e8
Part-of: odoo/odoo#109479
Since [1] when the m2m widget was introduced, events that were neither
from the create input text nor the create button did remove the internal
value of the text that was entered in the create input text.
Because of this "Create" had no effect if the user hovered e.g. a
suggested blog tag on its way to pointing to the "Create" button.
This commit replaces this behaviour by restoring the text value of the
create input when the create button is used.
[1]: https://github.com/odoo/odoo/commit/be05ac7e2b8d866a72693b761f3bc8576d54e59e
task-2811746
X-original-commit: 59ecbb96db75a77cdcce11460cdbe8aa04438449
Part-of: odoo/odoo#109479