With this commit, the functions float_compare, float_round and
float_is_zero are available from the fields.Float class as static
methods.
This allows the usage of these helper methods without the need to import
them from odoo.tools.
closesodoo/odoo#39695
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
In editable list view, moving to next cell using TAB key crash when the
following field is read-only (i.e non-focusable) and an onchange() event
is triggered.
Consider an editable tree view like this:
<form>
<field name="o2m" onchange="1">
<tree>
<field name="description"/>
<field name="date" readonly="1"/>
<field name="type"/>
</tree>
</field>
</form>
1. Adding a new line will give focus to `description` field widget
(currentFieldIndex is 0)
2. issuing a TAB keypress, will call _onNavigationMove which calls
_selectCell() with fieldIndex of 1
3. The _selectCell() method set widget currentFieldIndex to the new value
(currentFieldIndex is 1) add call _activateFieldWidget() to activate
on the corresponding widget.
4. _activateFieldWidget() will fail to activate the `date` field as it's
readonly, then try for next ones and succeed to activate the `type` field
cell
5. When focus is given a `type`, the `description` field is blurred which
trigger an onchange() and the controller apply those changes to the
editable list rendererd using the confirmUpdate() method.
The confirmUpdate() will try to get the current selection, but that
field is actually set to the `date` field (currentFieldIndex = 1),
which is readonly and so has no focusedElement - triggering the crash.
This commit ensure we don't try to call getSelectionRange() it current widget
has no focusable element.
OPW-2075229
closesodoo/odoo#39976
X-original-commit: 93c7ae9ba5309810c41c58fc8f2fafb3c3dac76e
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
PURPOSE
Upgrade the "mass_mailing" and "mass_mailing_sms" modules with a dynamic
placeholder generator as it already exists in "mail module" as depicted in
https://www.screencast.com/t/cnFA0gIY.
SPECIFICATIONS
As duplicated code already exists for that and that a third version of this
code has to be added, instead create a mixin for this dynamic placeholder
generator to avoid code duplication.
Thereby
* a mail.render mixin for the dynamic placeholder generator must be
created in mail;
* dynamic placeholder generator code present in mail.template.py must be
moved to that mixin and replaced by a simple inherit;
* use the mixin in
* mail templates: mail.template.py (mail module);
* mass mailings: mailing.py (mass_mailing module);
* sms templates: sms.template (mass_mailing_sms module);
In a near future, some code will be added in this mixin, notably the template
rendering that could be moved outside of mail.template core model and moved
in that rendering mixin.
LINKS
Task ID 2070612
PR #36722
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Fixes https://github.com/odoo/odoo/pull/39583
This commit adds a default value for event_count
Assigning default value for non-stored compute fields is required in 13.0
closesodoo/odoo#39974
X-original-commit: 9ca72b98f54d7686c0e6019870b40f14dbdd2881
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
When computing time statistics, we need to look for
archived website visitors also to avoid a KeyError
if we use the default 'Archived' filter.
closesodoo/odoo#39970
X-original-commit: fe4d9bd25de45f1748ea010c51c8871bb3d14b9a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
From Sale create a new (or edit) SO. Add a note to the order with a log
line without dash or whitespace (i.e. a url). Click on "Preview".
The sale portal will try to display the long line which will overflow
the standard size of the column creating an ugly overflow with a very
long horizontal scrollbar.
Adding a "break-all" rule to fix the sale portal case.
opw-2088589
closesodoo/odoo#39968
X-original-commit: 28afbaf502db88204bacbb6be96c490ce777208b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Reproduce the issue:
- In the CRM app, create a lead/opportunity.
- Schedule a meeting for this opportunity via
the chatter and click on create.
- Go back, the "Meeting" stat button is now at 1
- Schedule a meeting for this opportunity via
the chatter and click on edit then create.
- Go back, the "Meeting" stat button is still at 1
Cause:
When we click directly on create, the opportunity ID is in the defaults
option but when we click on edit, there is no opportunity ID.
So, this commit use the context to retrieve the concerned opportunity
and set it if it is not already set.
I splitted the solution into a private method for a better readability.
OPW-2092920
closesodoo/odoo#39964
X-original-commit: 59d154dcc1524c8f08c6a1e7aee18c722ab2e0ad
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
This completes a commit that was made for the version saas-11.3 (12.0):
https://github.com/odoo/odoo/commit/1440c8be0337c89e3d67d6d93e614c269c8689f1
Indeed, the logic was implemented for the appendTo, prependTo, etc
methods but not for the attachTo...
This could solve unknown problems in stable versions as well but was
judged too risky to merge there. Indeed, if a real problem occurs in a
stable version because of this, the condition can be added to the
related widget individually.
The problem was found in master: during website edition, the public
widgets can be restarted if an element is edited... but sometimes the
public widgets may be restarted in the same JS stack execution. The
willStart method being async, the destroy method was called before
the start method. This does not lead not any known problem with our
current widgets but will create one for a new snippet being implemented.
closesodoo/odoo#39949
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Without hr_recruitment it was not possible to import/export the hr.job
as they were not visible.
closes#22069closesodoo/odoo#39948
Taskid: 2088277
X-original-commit: e4de2b2e56ba188e45c5c18e4f25cca515fcb306
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
These sentences weren't correct:
Why aren't you interested by this lead? => Why aren't you interested IN this
lead?
Do you have contacted the customer? => I have contacted the customer (present
twice in code)
Task ID 1838187
closesodoo/odoo#39925
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Somehow having views could be necessary. Previously the only way to see
notifications was embedded inside mail.message views (notification_ids).
Task 2118599
PR #39460
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to lessen size of technical "Email" menu and move some
discuss menu entries in their own menu. It will be the new first menu
entry in technical, before Emails that is more technical.
Some menu items are moved in this new menu, notably followers, messages
or mail blacklist.
Emails menu is also reordered, to have notably all channels related
entries together, ...
Task 2118599
PR #39460
In this commit, we remove the lazy loading currently used by the mobile
kanban view to avoid the poor user experience. We had to wait each time
we swiped between kanban columns.
Now all data are fetched like in desktop. Note that it might still have
loading during the swipe for folded columns.
Task ID: 1896614
closesodoo/odoo#28142
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
When you have a lot of pos order to synchronize with Odoo, it may take a
lot of time because it has to create a picking for each order. So we've
added an option in the settings that will create the picking at the end
of the session.
So the new option by default is creating the picking at session closure,
and if you need a real time stock you can enable the creation of picking
for each order.
closesodoo/odoo#39584
Task-id: 2082064
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Reproduce this bug:
- Create 2 companies: Indian and Belgian for example
- Install accounting & l10n_in
- Create an invoice & print it
The `<td>` dedicated to the HSN is always present so there is a
cosmetic issue for the not indian companies: the table is a *little*
bit too large. This issue is caused by a missing conditional statement
on the `<td>` who is present on the HSN `<th>`.
OPW-2090663
closesodoo/odoo#39930
X-original-commit: 8d421c703796c0d47233ba0bb0318c829b2f0159
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Add new move reversal line in wizard model, those new_move_ids are
usefull for the override in helpdesk.
Currently, we return a form or a list view according to the
number of generated reversed moves.
Now, we link the generated moves on the wizard, so that we can
link the invoice lines correctly to the helpdesk tickets. Now,
the invoice lines are correctly linked only if there is 1 reversed
line.
id=2017554
closesodoo/odoo#39576
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Adapt website for 13.0 9996d04fd2 change of LinkDialog constructor
arguments (to get back to same arguments as in 12.0).
opw-2086444
closes#39888closesodoo/odoo#39910
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
When you deploy Odoo for the first time, it is not explicit that you
must enter a value in bytes for these specific parameters.
closesodoo/odoo#39831
Signed-off-by: Richard Mathot (rim) <rim@openerp.com>
Before this revision, any m2o with an ir.* model as inverse could have
the ondelete policy as 'restrict', either by default if it was required
or by setting it explicitly in the field declaration.
This is problematic because ir.* models are reflection models and they
*MUST* be deleted during an uninstall of the module that introduces
them, otherwise tables, fields, constraints, etc. are left in the
database, this is why 'restrict' doesn't make sense UNLESS the unlink is
being performed by an user and not by the system (uninstall).
As a solution, this revision sets the default to cascade if the field is
required, otherwise null.
If the programmer explicitly sets a required m2o field with an ir.*
model as an inverse to ondelete='restrict', it is considered an
unsupported use-case and the registry will crash during loading with a
clear error explaining that it is not supported.
closesodoo/odoo#39739
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
Purpose
=======
When you create a task independently and link it to a Parent task later on,
several changes are applied: the person assigned on the sub-task switches
to the one set on the parent task, same for the customer, and so on.
This creates frustration because the user most likely set specific data on the
sub task for a reason. In addition, the changes are made implicitely, so the
user might not notice it or get confused as to what changed from the original
task.
Specification
=============
Values for fields `partner_id`, `email_from`, `project_id`, `sale_line_id` should be
transfered from parent task to children task, only if the value is not already set
on the child.
This was already partially implemented by 749810a and 45396f7.
But to achieve it, similar code was duplicated in several methods:
default_get, onchanges, write, create.
Since the new ORM, the same behavior can be achieved with only computed fields
with store=True and readonly=False. This commit changes the previous implementation
to take advantage of this which greatly improves code readability and maintainability.
Tests by Maximilen Larue
Business code by Lucas Lefèvre
closesodoo/odoo#39369
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: MaxLarue <mla@odoo.com>
This commit takes advantages of the features added in the parent commit
to have better/cleaner tests.
closesodoo/odoo#39368
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
This commit partially backports bpo-24412, which allows the definition of
class cleanups (addClassCleanup) and module cleanups (omitted),
similar to instance cleanups (addCleanup).
This is useful for tests that override unittest's setUpClass and
could crash during its execution: If this happens, it is possible that a
bunch of crap is left in the database or even worse, the cursor becomes
completely fucked; Thanks to the addClassCleanup, we can undo the damage
done by the setUpClass.
Another benefit is that it is called unconditionally after tearDownClass
is called, so it can also be called as a replacement and/or safer
tearDownClass.
Note: the form builder will be refactored in a deeper way in a next update.
See sub-commits for details.
task-1874350
Thanks to @dbh-odoo @pna-odoo and @dja-odoo for the work on this task.
closesodoo/odoo#30595
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when an event have multiples notifications, if the
first notification is not ack when the second notification is shown, not
only two are visualized but multiples notifications are raised.
Now, only the correct number of notifications are shown.
opw-2070852
closesodoo/odoo#39909
X-original-commit: 8ab0bfeaa7b6c3e1642064d123197b1cba74355d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Lucas Perais <lpe@odoo.com>
This commit copies design of the last form-field and automatically applies
it on the newly added field to ease the designing.
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
If user changes the form-parameters (like targetted model), it removes
all the existing fields without any warning and re-renders a new form
according to changed parameters.
This commit improves above behavior to prevent accidental loss of a well
designed form. Now when user changes form parameters, a warging will be
shown to user before re-rendering the form if the model is not same.
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
This commit implements following changes:
- aligns radio / checkboxes with their label
- adds an option on radio buttons and checkboxes to
display them horizontally or vertically
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
This commit focuses the first form input on the opened modal (or footer
button in case there's no form input).
This behavior will enable users to navigate through the modal using
keyboard right away (without having to click on input).
Part of https://github.com/odoo/odoo/pull/30595
task-1874350
Co-authored-by: Dharmraj Jhala <dja@odoo.com>
Purpose of the task is be able to cancel an order if the products have
been delivered or if an invoice has already been confirmed
-the remaining pickings (back orders) should be cancelled.
-the draft invoices should be cancelled too.
[IMP] product_expiry: compute method should iterate on self
task-1919761
Closes#29920
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Co-authored-by: Hiral Bhavsar <hbh@odoo.com>
Purpose
=======
This is the first huge step to improve the test suite in several ways:
- Make them demo data independent, allowing to modify the demo data without having to adapt the tests depending on it. It also allows to have a beautiful + convenient demo dataset to make a demonstration, and to configure complex data in the tests to manage the corner cases.
- Improve the test performances by converting them into SavepointCase. Each test will be rollbacked to it's initial state, after the setUpClass call. That way the different data are not re-created at each test for nothing.
- Introduce several test classes in base/tests/common.py to launch a TransactionCase, HttpCase or SavepointCase test with an available demo user, portal user or a large set of partners.
- This is the first step to tend to a rolling release process, allowing to execute the tests (or a subset of the tests) on a migrated base, for example.
closesodoo/odoo#39868
Taskid: 2075739
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In f29699231 (12.3) part of the code of the editor `Link Dialog` was
moved to a web_editor/static/src/js/wysiwyg/plugin/link.js file/class.
In 13.0 the 12.3 editor changes were mostly reverted in 35b61822a but
part of the change of `Link Dialog` that was moved to another file/class
was not moved back, thus: it does not work as expected => eg. if we add
a link over an image, the image is removed.
In this commit we get back the missing part as it was in 12.0 version.
opw-2086444
closes#39858closesodoo/odoo#39881
X-original-commit: 9996d04fd2ec8329cd5561a4bc94ccc35d529d93
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The list comes from the selection values on the field license of
ir.module.module
closesodoo/odoo#39912
X-original-commit: 23f89363b4d9fecb12e3fe1024a36cf9f34ef5d2
Signed-off-by: Nathan Perry <servel333@users.noreply.github.com>
-By this commit, 'Buy credits' link should only be visible whenever
'Lead Enrichment' feature is enable in settings of CRM.
task-2116040
closesodoo/odoo#39905
X-original-commit: 6a8e5f636be87596012be9ef96792a9b1881ff4a
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit fixes the "quiz finish" modal display by correctly hiding it when the user clicks on
the "Next" button in the modal.
Without this fix, the user could run into an issue where the "modal backdrop" would stay on the
screen, locking all actions and forcing a manual refresh.
Task#2118532
closesodoo/odoo#39899
X-original-commit: 84603c6d928e5ba9b19c4ed3e8b6edbab42a8a5b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit: https://github.com/odoo/odoo/commit/0eba50dd1c33a08f8862a5718149e61b822e1b5a
introduced a 'return' in the survey.js script: return load_chart(chartConfig, '#scoring_results_chart');
This makes the rest of the script completely skipped and bypasses all the filter features.
task-2116078
closesodoo/odoo#39898
X-original-commit: b7baaf4846ba9208aeba8ba4db7de4f142e147cc
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Fix a bug where you get a traceback when trying to join a course on a quiz
preview not in fullscreen mode.
A variable was badly named in JS (id -> channelId), leading to the ID not
being forwarded to the "Join Course" sub-widget.
LINKS
Task ID 2079476
PR #38051closesodoo/odoo#39891
X-original-commit: b32d30b8cde85ba37f9cef975838874a08ea7c07
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When a pos order is sent to the server, the field 'to_invoice' is never
sent to the server which lead to always having a value to 'false'.
We are now sending correctly this value to the server, and we can also
base the fact to create an invoice on the value of each order.
Because beeing offline could lead to create an order that should be
invoiced as one that should not be.
closesodoo/odoo#39880
X-original-commit: c8d5b4a0cfc070c05c3f86ae6cc2b7395532c353
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Let's assume the following order of bank statement:
1 - 2 - 3 - 4
and now we change the date of statement 2 to be at the end
1 - 3 - 4 - 2
Changing the date triggers the recompute on record 2, that will correctly change it's
previous_statement_id to 4, however we also have to change to value of record 3 so that
it points towards record 1. This was previously done inside the recompute function by use
of a simple search and an assignation on record 3. However this caused some random issues
as if we try to access the record 3 value just after having change record 2 value, the ORM
might not have yet call the method to recompute record 2 (this is called when we try to
access record 2 value but we didn't do it in this case). Therefore the value in record 3
might not have changed yet. Hence the error spotted. The reason why this error only
happen some of the time is probably due to some method inside the ORM where we read the value
on record and those value are in a set meaning that it is not ordered and sometimes when
we were lucky the recompute happened before we tried to read the value of the other record.
The solution to this problem is to move the logic of other statements to recompute (in the
example record 3) inside the create/write method. And instead of assigning the value directly
only mark those record as needing to be recompute. That way whenever we try to access the value
of such record (record 3 in this case), if it was not yet recomputed, it will be done at that time
closesodoo/odoo#39867
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Before this commit, the user could not edit the lead phone field
when a customer was assigned. The phone field was related to the
phone of that customer.
Now, the field related to the phone of the customer is removed.
We can edit the phone field of the lead without modifying the customer
one.
task-2083470
closesodoo/odoo#38350
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
If a user levels up after passing a quiz, we want to clearly show him in the success modal that he
actually passed a level instead of just showing his new rank and xp gauge.
This commit introduces an animation with the progress bar when the user is levelling up.
After reaching the upper bound of the next level:
- The progress bar goes back to 0 ;
- The lower/upper bounds change to reflect the new reached level bounds ;
- The message "Amazing!" becomes "Level Up!" ;
- The motivational phrase changes with a fade out/fade in animation.
LINKS
PR : #39870
Task ID : 2032649
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aurélien Warnon <awa@odoo.com>
This commit adds a SQL constraint to force the min_karma of the gamification.karma.rank model to be
above 0.
A karma_min set to 0 (or lower) could create some frontend issues when displaying required karma.
PR #39870
Task#2032649
The return type of the _get_next_rank method on the 'res.users' model was inconsistent.
It sometimes returned a recordset, sometimes False.
This commit adapts the method to always return a recordset (which is empty for the previously
'False' case).
This is a preliminary work for the level up animation on website_slides task.
PR #39870
Task#2032649