When opening a dialog using mouse and closing it, form_dialog_discarded is
triggered, which tries to set focus on form while lastActivatedFieldIndex
is -1, as dialog is opened using mouse directly
do not set focus back to form widget if lastActivatedFieldIndex is -1
task-2031706
closesodoo/odoo#34684
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
With BS4 migration, the progressbar 'active' class should have been
renamed 'progress-bar-animated'.
closesodoo/odoo#26868
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Put toogle_button or a favorite widget to handle a boolean field in an editable list
click straight up on the widget's button or link
Before this commit, the widget changed its appearence, but the changes were not
propagated to the model. This is because the controller will not force_save if its mode is edit
(to let changes piling up and save everything when clicking save), which is the case
of the editable list
After this commit, following what has been done at 2f5e44d40b
clicking on a widget in an editable list just activates the row for editing
but doesn't change the widget's value
OPW 2033700
closesodoo/odoo#34878
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Let's assume a one2many field (editable list) in a form view with
a many2many (e.g. many2many_tags), and an onchange on the one2many
such that, when a row is added to the relation, the server returns
update commands for (a subset of) the records being already in the
relation. For thoses updated records, the many2many field needs to
be read (the onchange only returns the ids in the relation).
Before this rev., the many2many field was read independently for
each record in the one2many. This could cause a performance issue
on large relations. For instance, this was the case on
account.invoice records with a lot of lines.
This commit must be forwardported up to 12.2, not further.
Issue 2027356
closesodoo/odoo#34771
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Add the support to be able to specify exlicitely module, class and method name in test_tags
Before this commit, there is no distinction between module tag and test tag. Meaning
that --test-tag module_name will replace the default +standard tag and execute all test
of the module.
This commit tries to keep the initial behaviour, while addind new features, like explicit
modules tag with /module_name, as well as class (:class) and method (.method)
Some usage examples:
--test_tags /module will execute all standard test of module
--test_tags :class will execute all standard test with class name 'class'
--test_tags .method will execute all standard test with method name 'method'
--test_tags external/module will execute all external test of module
--test_tags */module will execute all tests of module,
--test_tags */module,-standard will execute all non standard tests of module,
--test_tags -/website:TestUiTranslate.test_admin_tour_rte_translator will disable only rte translator test
closesodoo/odoo#34756
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Go to the database manager, configure a password either via the
interface either via the `admin_passwd` `.odoorc` config file. Click on
the backup menu, let the `password` field empty and submit the form. The
modal is closed without any warning and no query is sent.
The problem is that even if the field is marked as `required`, there is
a event listener that catch the `onsubmit` event and close the modal
even if it is not valid.
opw-2031461
closesodoo/odoo#34669
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Before this commit, on a device with a "pen" (e.g. Surface Pro, ...),
it was not possible to sign a document on some browsers recently
updated (e.g. Chrome, Firefox, ...) only Internet Explorer was working.
Instead of drawing continuous lines only few dots appeared.
For Chrome and Firefox we have to catch events with "addEventListener".
For Edge we add touch-action property to convert touch events into click.
Steps to reproduce:
1) Go to sales app
2) Then go to quotations (menu Sales)
3) Create a new quotation
4) Click on preview
5) Click on the "Accept" button at the end of the preview
6) Use the "pen" to draw the signature (BUG)
We use a custom version of the jSignature lib (c.f. odoo/odoo@eddcb46),
so we have to patch the file in the Odoo repo with a mix of some
pull request found in the official repo and forks.
Link:
https://github.com/brinley/jSignature/pull/109https://github.com/brinley/jSignature/pull/159https://github.com/willowsystems/jSignature/pull/96
opw-2029684
It's currently possible for binary downloads to be missing an
extension entirely. Generate an extension from the mimetype and use
that. Also ensure the existing extension (if any) matches the
mimetype.
Warning: this may require adding new mimetype/extensions pairs to the
local mimetype database similar to
f413d155df.
Also fix missing or incorrect filenames on records without a filename
field: in some Odoo versions the client would send a filename of
"null", resulting in a download of e.g. "null.pdf" instead of the
attachment or inferred name.
Task 2025716
closesodoo/odoo#34299
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
In case a many2one field (let us say 'foo') is used
simultaneously as a groupby and a measure in the pivot view,
the values returned by a read_group for that many2one are of
the form [id, label] and the aggregated values (always 1) are
missing in the read_group results (datapoints).
Thus typically, a datapoint is of the form
{'foo': [1, 'Bar'], '__count': 4, ...}
and does not contain information on the 'foo:count_distinct'
value (this is a read_group bug).
As a consequence, a special processing of the read_group
datapoints is done in the pivot model to handle that
situation and the value for 'foo:count_distinct' is infered
correctly to be 1.
In the pivot comparison mode, datapoints comming from the
period and the comparison period (data and comparisonData
sets) are identified if they have same values for the groupby
fields and the measure values become small objects containing
information on the the measure values for data and for
comparisonData and on the related variation.
Thus
{foo: [1, 'Bar'], __count: 4, ...}
from data and
{foo: [1, 'Bar'], __count: 3, ...}
from comparisonData should become a single datapoint
{
foo: [1, 'Bar'],
__count: {
data: 4,
comparisonData: 3,
variation: {
magnitude: +33 (%)
}
}
fooAggregate: {
data: 1,
comparisonData: 1,
variation: {
magnitude: 0 (%)
}
}
It turns out that the code responsible for merging the data
and comparison datapoints made a mistake by mixing the keys
'foo' and 'fooAggregate', with the consequence that the
variations were not correctly computed in the situation
described above.
This is fixed in this commit.
closesodoo/odoo#33118
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Configure your system to be in the Mexico timezone, configure your Odoo
profile accordingly. Go to calendar, show daily events, add an event at
the end of the day (like 10pm). The resulting event is not visible on
the daily view although it is on the weekly view. The same problem
occurs on the weekly view if the event was create late the last day.
The problem is the initial `search_read` has a domain to filter the
events using 00:00 UTC to 23:59 UTC boundaries. Those boundaries are not locale
aware, they should be shifted to the MX timezone.
opw-2009877
closesodoo/odoo#34247
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
The months name in momentjs used an arabic translation with the month
then some crap (or the month said a second time) after.
This does not seem expected, and has been solved in moment.js library 2
years ago:
https://github.com/moment/moment/pull/4271
This PR apply this change in moment.js localization included in Odoo.
opw-2006265
closes#34248
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
A pie chart widget aims to instantiate a graph view in mode
'pie', with a measure and a single groupby specified via some
attributes. It turns out that if a pie chart is instantiated
in a context in which the keys 'graph_mode', 'graph_measure',
and 'graph_groupbys' are present, that keys prevail over the
pie chart specification. This can produce a line chart for
instance. This fix corrects that situation.
A test has been added in a corresponding commit in enterprise
(historically, the pie chart widgets are tested in dashboard
views).
closesodoo/odoo#34234
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
- Create a calendar event
- In debug mode, remove the responsible
The 'Avatar Undefined' string is displayed at the botton of the
responsibles' list.
Do no fetch an image for a falsy value (= falsy id)
opw-2010007
closesodoo/odoo#34215
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The search buttons visibility is saved in the local storage. Rev.
6448420 changed the API of the LocalStorage servive (by JSON
parsing the values), and didn't adapt the calls done for the
search buttons.
Closes#33833closesodoo/odoo#34206
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
When uploading a file to a binary file, then clicking on the
"clear" button, then reuploading the same file...
Before this commit:
The actual input of the field was only changed on user input.
This means that the "clear" action didn't reset the actual value
of the input, and the browser's default behaviour when getting
the same path twice is not to change anything. In the use case,
you couldn't upload the same file until you uploaded another one.
After this commit:
The "clear" action now also clears the value, allowing reuploading
the same file over again.
closesodoo/odoo#33843
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.
closesodoo/odoo#33679
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.
We simply reload in all cases.
opw-2002186
closesodoo/odoo#33028
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When an error is raised server-side, the complete traceback is displayed
in the JS console. This traceback can be very useful since it might
contain information not recorded anywhere else by default. For example,
access errors due to record rules or SQL constrains do not have their
traceback displayed in the UI or recorded in the log [1], but it is
logged in the JS console.
However, the information is logged in the JS console as a stringified
version of the `result.error` object. The final result is a long and
non-formatted string which is unreadable.
We replace by a new format more convenient for technical teams. The
error is now formatted as:
Error code
Error message
Error data message
Error data debug
This will hopefully give a better starting point for debugging purposes.
[1] SQL constrains tracebacks are only recorded in the log in debug
mode:
https://github.com/odoo/odoo/blob/ec792da72b92b22349b6f325e53fd37d953c7db3/odoo/service/model.py#L122closesodoo/odoo#33650
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Invisible fields in form view and group reserve space.
This looks bad with many invisible fields in a form.
Fixes: #29505 and #28370closesodoo/odoo#33598
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In an editable view when editing a row, then apply or remove any groupby or
filter the control panel buttons are not updated.
When record is in edit mode in editable listview and applying groupby then
control panel buttons 'Save' and 'Discard' buttons are always displaying, this
issue occurs because when applying or removing filters control panel buttons not
updated i.e. _updateButtons not called.
With this commit button are updated when _update of list controller is called,
_update of list controller is also called from search.
Task-1967278
closesodoo/odoo#33572
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>