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
Mainly reorganize them alphabetically so that execution order matches the
definition order. It helps when debugging.
Also clean some tests from odoo/odoo@f9c2716b3e because they either test nothing
either are not understandable by standard humans. Other tests are left
untouched.
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.
SPECIFICATION
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;
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
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;
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Purpose is to try to keep history before splitting frontend templates into
separate files. We first copy the file, then remove extra content in each
of them. Let us see if this works.
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 and split backend views / model. It allows an easier manipulation and
management.
Templates (frontend) files are renamed but not split. It requires a more
in-depth check of their content before splitting into sub-files (to have
tool templates separated from main templates notably). This will be done
in the next few commits.
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
Split data files / model. It is easier to have a global view of a module
organization and content. It also allows to see technical data impacted
by the module installation (like ir_actions, mail_message_subtypes, ...)
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
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.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841
Purpose is to try to keep history before splitting models into separate files.
We first copy a file, then remove extra content in each of them. Let us see
if this works.
Task-3240082 (Forum: Reorganize and lint module)
Part-of: odoo/odoo#114841