Steps to reproduce
==================
- Go to a form view with a binary field, or add one with studio
- Upload a file a.txt to a record
- Upload a file b.txt to another record
- Switch between both records with the pager
- The filename is not updated
opw-3208810
closesodoo/odoo#116323
X-original-commit: 90515916e8adb3edb560d73ec8889ad52319cc1d
Signed-off-by: Luca Vitali <luvi@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
In tests, if we need to interact with dropdowns, we should patch setTimout so that we don't have to wait x ms for the dropdown to open.
closesodoo/odoo#116319
X-original-commit: 008d4faebabbecb88d4ce514650b59cdc21ff85a
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This PR fixes several issues with the unread counter:
- Notifications being considered as unread messages (which is not
the case on the server side which resulted in inconsistencies).
- Counter greater than it should be when the last seen message is
not loaded.
- Messages not marked as read on first thread opening.
task-3239957
closesodoo/odoo#116208
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
Before this commit:
popover collapsed when there is fewer fields available.
After this commit:
Now, the popover will not be collapsed when there are fewer fields available.
Task-3072813
closesodoo/odoo#116194
X-original-commit: 787b9b0b49793598c44aebc20e4a0c5e7850f5af
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
**Notable feature changes**
- PoS app continues to load even if no nomenclature_id is configured.
- When scanning, an error popup is shown to the user mentioning about
the misconfiguration.
- We introduce a default error handler that shows the ErrorBarcodePopup
when there are no registered barcode handlers via the
`useBarcodeReader` hook.
closesodoo/odoo#115906
Related: odoo/enterprise#38444
Signed-off-by: Samuel Degueldre <sad@odoo.com>
Before this commit, the state mode for subtask without any project set
is not the toggle one as it is the case for the private task.
This commit changes the state mode to have the toggle mode when the
task has no project set, that is, the subtask without any project set
or the private task since a subtask without a project set could be see
as a todo task and not a task in a real process as it is the case for a
task linked to a specific project.
task-3230063
closesodoo/odoo#115781
X-original-commit: e2d7ee73222ab3330da9c45570a4a6330d87c016
Related: odoo/enterprise#38378
Related: odoo/upgrade#4448
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
Before this commit, since the display_project_id field has been removed and
the project_id field could be unset on subtasks (default value as the
`display_project_id` field), the widget `project_private_task` consider
a task as private if the task has no project_id set.
This commit changes the widget to check if `is_private` field is true
to display the `Private` on `project_id` field value.
task-3230063
X-original-commit: b0a8a9aedb3b5cfb2acb6ff3b10a77c279bda8fd
Part-of: odoo/odoo#115781
Before this commit, the `display_project_id` field was a bit confusing
for the user to know what is the goal of this field. Also this field is
available when the user wants to import his data into Odoo, if he does not
know the goal of this field then he could be lost to know which field he
should for his data to import (or even export).
This commit removes the display_project_id field and so a task will be
private one if the project and the parent fields are not set. The
project to set to the timesheet will be the one set on the task or the
one set on one of its parent tasks.
task-3230063
X-original-commit: 22eda5a5ddcfcda9fa6597d6fe21eb20f525799f
Part-of: odoo/odoo#115781
Before this commit, the use of multiple <field> with the same name in a
view was not well supported.
Why was this?
Some Field components need to know information related to the <field>
such as context, domain, required and readonly. The solution used before
this commit to access this information is to use the getFieldContext,
getFieldDomain, isReadonly, isRequired functions of the model.
Unfortunately, these only take into account the last occurrence of the
<field> because the model is not aware that the same field is present
several times on the view. The information must therefore not come from
the model. For example, it was not possible to have the same field
twice with 2 different domains. It will use the domain of the last
field for both.
Solution:
We will add the object "dynamicInfo" to the fieldInfo passed to the Fields
extractProps function. This object will contain a getter to get the value
of required, readonly, domain and context for the current <field>.
If a Field needs one of its information, it will just have to get it
from extractProps.
Part of Task: 3179751
closesodoo/odoo#115197
Related: odoo/enterprise#38151
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
The aim of this commit is to allow any tax tag to be set on a journal
item and to allow the user to put tax tag from foreign countries in
which they have a VAT number on any tax.
The end goal is to allow the user to impact tax reports from several
country with the same journal item, avoiding the creation of a whole
journal entry and setting the path for some more automation.
Context:
Our user has a company based in Belgium but has a warehouse in
Netherland. Thus, when the company sells anything from that warehouse, it
needs to fill the Dutch tax report directly.
Moreover, the company needs to fill a grid on the Belgian VAT tax report.
That means that the user would need to gather some journal items on both
the Belgian tax report and the Dutch tax report.
Before this commit:
The user can't set tax tag from another country on its tax nor in the same move.
After this commit:
The user can set tax tags from any country for which its company has a
foreign vat number on any tax and in a move
Task-id: 3196547
opw-2810712
closesodoo/odoo#113027
Related: odoo/enterprise#37247
Signed-off-by: Olivier Colson (oco) <oco@odoo.com>
The current algorithm to match vendor bills with purchase orders was written
while keeping in mind that the vendor bill data came from an OCR scan and was
thus not very detailed or totally reliable.
The current algorithm tries to match in this order:
1. Document reference(s) match(es) one or more purchase orders and the total
amounts of the bill and the purchase order(s) match as well.
2. Document reference(s) match(es) one or more purchase orders and the total
amount of the bill matches a subset of lines in the matched purchase order(s).
3. Document reference(s) match(es) one or more purchase orders but the amounts
do not match.
4. No document reference, but the vendor and total amount of the bill matches
exactly one purchase order.
When we generate a vendor bill from an EDI document (electronic invoice), we do
have very accurate information however and can also match line by line, since
our vendor bill will contain separate lines.
In this commit we add an extra algorithm specifically for EDI documents:
* We find all purchase orders matching the vendor bill reference(s)
* For every vendor bill line (having a unit price), we try looking in our
matched purchase orders' lines for the same unit price and a remaining
quantity higher than or equal to what is in the vendor bill. If multiple matches
are found, we check the name similarity and take the most similar line.
* We replace the vendor bill line with the purchase order line, changing the
quantity to the one on the original vendor bill line.
* Unmatched vendor bill lines remain untouched.
We also remove matching method 2 (see above) for EDI documents, in favor of the
new algorithm.
This approach makes that more purchase order lines will be able to get matched
when using EDI documents.
task-3140712
closesodoo/odoo#112684
Related: odoo/enterprise#37061
Signed-off-by: Laurent Smet <las@odoo.com>
This commit fixes a crash that occured when a message has
no author. The author avatar url was assuming an author
would always be given while it is not the case.
closesodoo/odoo#116306
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When grouping a kanban view by a m2o field, a configuration menu
('cog' menu) is available with actions available on the target
record.
This menu contains the entries 'Fold' and 'Delete' which have very
generic wording, and for some reason 'Edit Stage', which of course only
makes sense if the target record is a stage of some kind. Often, it
might not be - there is no reason to use such restrictive language.
Task-3244415
closesodoo/odoo#116299
Signed-off-by: Bouvy Damien (dbo) <dbo@odoo.com>
Before this commit, the compute method was not returning the value for the
field karma_flag field, and thus it was returning compute method failed to
assign value error.
After this commit, the compute method will return correctly set the value
for karma_flag field from the forum.
closesodoo/odoo#116281
X-original-commit: odoo/odoo@bfa3f2d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
*: web_editor
The table of contents menu entries are generated automatically which
poses a problem in translation mode. The menu translation entries
are not be editable separately, but the users might be trying to.
This commit shows a notification when the user clicks on the menu
entries while in translation mode, explaining that they are generated
from the title entries.
It was initially intended to use a tooltip - but the amount of code
needed to display a tooltip without marking the DOM as modified is
needlessly complex.
To avoid that styles applied on a plain text during translation were
also appearing in the navigation menu, an attempt at adding a span
around them to make sure that their translation was distinct from the
one inside the main content. But this led to the risk of losing
existing translations.
Because of this, and because that situation seems unlikely, any
remaining style in the navigation menu is instead stripped when the
table of content is started to maintain consistency with what is shown
during translation.
An `o_translation_without_style` class has been introduced to indicate
to the synchronization mechanism that only the text must be replicated
for those elements.
For labels that have a different `data-oe-translation-initial-sha` than
their related header, that value is temporarily kept in another
variable, the value is replaced by the one from the header, which make
the synchronization mechanism properly associate them, then on save
the initial value is restored so that the translation is saved for the
right slot.
task-2752391
closesodoo/odoo#116270
X-original-commit: 5776a358e1b42186d2c26c9bc25010a12811f416
Signed-off-by: Outagant Mehdi (mou) <mou@odoo.com>
Before this commit:
The traceback appears after cropping an image and then trying to crop it again.
After this commit:
Cropping an image and then cropping it again won't give us tracebacks anymore.
Task-3134764
closesodoo/odoo#116262
X-original-commit: 83cf218b131c47b711327a224b0a0fd81406e8c3
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Before this commit: if you wanted to refund an order that contains a
promotion line, it did not show the promotion line to refund. The
problem was that, during the initialization of an order from JSON, it
calls `set_partner` and `set_pricelist`. It causes a call to
`_updateRewards()` inside the `pos_loyalty`, which will remove the
promotion line. But it doesn't need to update the rewards when it
creates the order object from JSON.
The solution is to prevent calling `set_partner` and `set_pricelist`
when it creates the order object from the JSON.
opw-3111578
closesodoo/odoo#116236
X-original-commit: a03fa619f1388fb8033128a44eeb5451ef150890
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Pedram Bi Ria (pebr) <pebr@odoo.com>
Reintroduction of the dependency on the state of the account.move for the _compute_amount method.
Some customers are experiencing problems following the migration to version 16. If they had draft 'account.move' before the migration, the 'amount_residual' field is set to 0 during the migration. When they validate the move after the migration, it goes directly to the paid status because the field is not recomputed.
opw-3182437
opw-3196490
opw-3229872
closesodoo/odoo#116180
X-original-commit: 3c7f6c3e39c05d7dfd24dd1b73f7bb3f19230f72
Signed-off-by: Laurent Smet <las@odoo.com>
You cannot validate and expense report having expense_line_ids of
different payment mode.
But so far, it was possible to select these lines, and it would
be blocked upon saving.
We will improve this behavior by extending the domain on the
expense_line_ids field and disallowing to add lines that would lead to
an error later in the process.
It will also correctly handle the creation of new line via the expense
report form view, and add the paid by field as optional hidden in the
view in order to allow to find more easily the expense line that are
causing issues.
task id # 3221780
closesodoo/odoo#116077
X-original-commit: ec18bd414c831a9af67802dcd5d7181ef8d43049
Signed-off-by: Florian Gilbert (flg) <flg@odoo.com>
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
before this commit, in the code it is referenced
to non existing field state in account.bank.statement model
and thus it raise exception.
after this commit, the exception wont be raised and
validation error will be done based on the state field
state in account.bank.statement.line
closesodoo/odoo#115888
X-original-commit: ecdc3cb32bd96ecc859f385d3541eb2f5e4bad4d
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Signed-off-by: Laurent Smet <las@odoo.com>
They make sense when the chat window is unfolded,
as it changes the content. But when folded, the buttons have no
visible affect. Better hide them in that case.
closesodoo/odoo#116242
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
This commit fixes a small issue in the survey invite modal layout.
The label and the associated field for the share link did not have a matching
attrs configuration, leading to an extra label which broke the form visually.
Oversight of 220e0271bf
Task-3203875
closesodoo/odoo#116234
X-original-commit: c68b56254005eb94ad90192e6cf8648866aca55d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Since the discuss refactoring, clicks are not disabled in the message delete dialog.
This commit fixes the issue.
closesodoo/odoo#116215
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
In previous commit, we just copy/move the files.
In this commit, delete the part of each file
that is not related to its model, and some style.
task-3244226
closesodoo/odoo#116165
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
In this commit, we just copy/move the files.
In next commit, delete the part of each file
that is not related to its model.
task-3244226
Part-of: odoo/odoo#116165
The last step of PaymentScreenTotalDueWithOverPayment tour is not
really needed and it randomly breaks in runbot. Better to remove it.
closesodoo/odoo#115802
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
When loading a view, the system will populate the related property field
with the values stored in the datapoint of the record. Currently, the
system does not do any safe check when reading those values. The system
can hence raise an error if the view does not load the record storing
the property definition of the current record.
This commit will fix that issue by adding a safe check when populating
the related property field with the values of the datapoint.
task-3218435
closesodoo/odoo#115100
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.
SPECIFICATIONS
Split python files / model. It is easier to have a global view of a module
organization and content when looking at the models directory. Each model
now belongs to a single file.
Do the same with data, views.
Split templates by main usage. Files have been duplicated previously, they
are now cleaned to keep only content relevant to their usage. Split is done
according to
* base file: layouts for main actions not specifically managed in other
sub-files: display a forum, manage tags, post a new question or edit
a question;
* '_forum_all': 'all' page in multi-forum display, displaying the list of
available forum;
* '_layout': layouting templates. Modifications to global layout and forum
specific page header used through all main templates;
* '_moderation': moderation tools;
* '_post': display a forum post;
* '_tools': tooling and utility blocks, used as black boxes in various
main templates;
Rename other files according to guidelines.
Reorganize main content of python code
* group compute fields on top, order them following fields definition;
* add section separators, to separate compute methods / CRUD methods /
business methods / Mail methods / Tooling in file and have a way to
sort a bit the code out;
* rename compute methods to start with '_compute', to match guidelines
and be coherent with global odoo naming;
* perform some relining in fields definition, don't enforce any char
length but try to stay aligned with Odoo apps;
Finally, provide some fixes or code improvements (batch, performance,
poorly written or named code) that are quick-wins.
LINKS
Task-3240082 (Forum: Reorganize and lint module)
closesodoo/odoo#114841
Related: odoo/upgrade#4456
Related: odoo/enterprise#38469
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently 'forums_count' field on website is not correctly updated. Test
introduced recently show that
* at website create, counter is not computed;
* at forum create, counter is not computed;
Only updating a forum active flag, website value, or unlinking it recomputes
the counters.
Note that manually updating counters is required as forum with False website
are global forum, valid for all websites.
Finally rename 'forums_count' into 'forum_count'. Fields in Odoo are rarely
plural (more like 'forum_ids' / 'forum_count' for example, even if in our
case the 2many does not exist due to shared behavior).
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Add tests for website.forums_count field that should be synchronized manually
with the actual number of forum. Seems it is not working as expected, as
the manual update is not done at forum creation, and the default seems not
correctly computed.
Those tests are therefore red without the upcoming fix.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Gamification data used in some emails to add links and shortcuts is not
correctly translated. Let us fix it.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Instead of doing 1 search_count / user in the loop, use read_group to fetch
data in batch.
Also remove an unnecessary import.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
PURPOSE
Reorganize website_forum module. This allows to better locate code, understand
organization, and prepare future changes.
SPECIFICATIONS
Rename main views and actions according to guidelines. Having standardized
names eases process of finding and updating views.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Default value is currently not translated, which is sad. We therefore move
it into its own default method, use translation marks, and Markupize the
whole result.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Better have a correctly formatted content looking like all other HTML fields.
This is achieved by using sanitize parameter which cleans up html content
according to our standards.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
A strange manipulation is performed when trying to create tags. In this
commit we simply make styling happy by trying to first prepare data
(strip, content) then use it. Feature is untouched currently.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841