This is a weird situation, but the python handles it. Let's assume
a many2one field F1 on model M1 with comodel M2, and on M2 the name
field (which is the _rec_name) being itself a many2one, and the
following scenario:
- create a new record for M1
- for field F1, select 'Create and Edit': it opens a form view for
M2 in a dialog
- type something in F2 input, and click 'Quick create'
- save the dialog
Before this rev., the value of F1 was [object Object]. Now, the new
value is properly displayed.
OPW 2091106
closesodoo/odoo#40549
X-original-commit: 5a04ea848abf50b1fb1f9893d1fcd98013bc025d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Reproduce the issue
- Install Projects and Studio
- Edit the projects app's kanban view
- Enable group by stage
- Close studio
- Add several stages
The stages are wrapped to the next line
Cause
I think the problem comes from c5f6802, we apply a wrapping to
all the kanban_dashboard items and in this cases the items are
the stages.
This commits apply the wrap only on non-grouped kanban dashboard.
OPW-2123031
closesodoo/odoo#40449
X-original-commit: f40478d5bacfdc44c76b0aac2f749549bbc58681
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Install accounting and activate a new language. Under
Accounting>Settings>Terms and Conditions input something, save and then
click on the near lanuage button.
A popup will appear with only the possibility to close and save but with
no text.
This is because no row is fetched from the ir.translation table, because
the domain for the search is
```
['&',
['res_id', '=', None],
['name', '=like', 'res.config.settings,%'],
['name', '=', 'undefined']
]
```
* wrong res.id "None" instead of the correct one (1)
* wrong name pointing to somewhat related to 'res.config.settings'
(the field name is "res.company,invoice_terms")
* another wrong condition on name equal "undefined"
The domain is malformed because in
addons/web/static/src/js/views/basic/basic_controller.js
record.res_id is unset while record.res_ids is it. Rewriting res_id to
make sure the id is there fix the issue
Thanks to mart-e
opw-2091779
closesodoo/odoo#40394
X-original-commit: 20e84558de476c17fed73f7ea5a11989401bffaf
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Currently, if the first week day was Saturday the calendar week view
would possibly get the wrong week.
This is because current heuristic would get date of current week from 6
(Saturday) to 12 (Sunday).
Thus if we were:
- on Friday 14th, we would have a week day ranges: 15-21 (wrong)
- on Saturday 15th, we would have a week day ranges: 15-21 (ok)
- on Sunday 16th, we would have a week day ranges: 22-28 (wrong)
So it would only get the right range when getting range from saturday.
If a week:
- start on monday, the week range would only be wrong on sunday.
- start on sunday, the week range would always be alright.
Added test without the fix fail:
- CalendarView: Saturday week start week mode
The domain to search events in should be correct
(domain range 14-20 instead of correct 07-13 whilst the day was 12th)
- CalendarView: Monday week start week mode
The domain to search events in should be correct
(domain range 16-22 instead of correct 09-15 whilst the day was 15th)
opw-2091448
closes#40244closesodoo/odoo#40327
X-original-commit: 6c3d74846581d6c1bfc0c6e3a7104440515ddbc5
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In a view month of calendar, when seen the details of a non-all day
event.
Before this commit, the end hour was always 00h00m.
Now, the end hour is the encoded one.
opw-2093111
closesodoo/odoo#40287
X-original-commit: 92fe5f11c16ee6749c4b0834ec12e5e858b1748d
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
In a view month of calendar, when moving a non-all day event from a date
A to a date B.
Before this commit, the event will be changed to an all day event type.
Now, the event will be staid unchanged, only the date will be updated.
opw-2093111
X-original-commit: df001af5341bf35f36fe455d69bbb46f4b0fa00c
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
After loading the calendar view, making a search with an inactive
domain in the list will trigger a search "partner_ids not in []" which
returns zero result.
The code intention was to initialise the avoidValues, not to send an
empty list.
To reproduce the issue:
1. create an event shared between user 1 and 2
2. as user 2, open the Calendar menu
-> shared event is present
3. click on "week" tab (forcing a refresh)
-> shared event no longer appears
Fixesodoo/odoo#39839closesodoo/odoo#40264
X-original-commit: 299a6dbcb53e583b177079116ada63a1255d1cfa
Signed-off-by: Martin Trigaux (mat) <mat@odoo.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>
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>
Purpose
=======
Allow to add an attribute ``show_unusual_days="True"`` to display
some days in green, according to a linked method ``get_unusual_days``
that should be defined on the related model to return all the
concerned days for a given period.
Before this rev, it crashed when opening the (sale or purchase)
product matrix (e.g. on runbot, go to quotations, create, add a
line, select 'My Company tshirt').
This was due to a recent override of _applyChanges (see 4bf98b47),
which didn't return the value returned by super.
OPW 2116083
closesodoo/odoo#39747
X-original-commit: 49626acbacb87a6f5d37bea22d0b51a506121914
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In form views, there are stat buttons.
When the window size is too small, some buttons are packed into
a "More" dropdown.
Before this commit:
- The form view dropdown's buttons are shifted on Microsoft Edge
and IE 11.
After this commit:
- The form view dropdown's buttons are not shifted anymore on
Microsoft Edge and IE 11.
There was a fixed line-height on the button's icon. On Edge and IE 11,
it makes the icon moving down and this causes the offsetting.
The purpose of the line-height was to fix the button height to 44 pixels
So, I set up the button's height and centered the content.
Also, I removed a useless border-left because there was already one
border on the dropdown container.
OPW-2079694
closesodoo/odoo#39635
X-original-commit: a7d9f2a5a94662602a34f7e68e5cd0c4cd07c7f3
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
In form views, when the window size is too small, a "More" button
appears and it should contain the overflow buttons.
On all browsers, the "More" dropdown doesn't contain the expected
amount of buttons, so it is shifted on the second line.
Before this commit:
- The "More" dropdown doesn't contain the expected amount of
buttons, so it is shifted on the second line.
After this commit:
- The "More" dropdown contains the expected amount of buttons
and it is not shifted on the second line anymore.
OPW-2079694
X-original-commit: 2bda8230fba07a229fcda77a1528694a0e317917
Before this commit, when a dropdown overflew its container
i.e. in the case of a long filter menu in modal
The scrolling of that dropdown to get to Add custom Filter
was impossible
This was because dropdowns react pretty bad when contained in a
relative positioned container
https://github.com/twbs/bootstrap/issues/26512https://github.com/twbs/bootstrap/issues/28513 !!
After this commit, the btn-group that adds the relative positioning
is forced into the default value
This commit corrects what was initially
corrected at https://github.com/odoo/odoo/pull/37594
in v12.0.
The incriminating commit that retriggers the issue
is irrelevant because it is the refactoring of action manager
but here it is: 40dd121938closesodoo/odoo#39541closesodoo/odoo#39636
Original-signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
X-original-commit: 7f72b837473f68a1dcd6a303ac1bf355dddcc2b1
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Be in Right to left
Open a m2o search more, to get onto the list modal
toggle the filters menu
Before this commit, the filters dropdown was almost invisble
and too much on the right anyway
This was because the RTL was not taken into account
After this commit, we anchor the dropdown on the right
(both as in good and as in side) side of its trigger button
Also, when modifying the dropdown, by developping the Custom Filter
we force the repositioning of the dropdown, to take those new elements
into account
It is expected though that after this commit, in RTL, the
dropdown in a modal that has a scrollbar (which is on the left)
will be slightly pushed to the right. It is usable and visible though
Some kind of plumbing using $el.data('offset', fn) from popper.js
is possible, but has been deemed not robust enough
Docs
https://getbootstrap.com/docs/4.0/components/dropdowns/#methods
OPW 2088934
X-original-commit: 105b4affd65ea23e1aa65b53f4595c174c9984ef
Be in RTL mode, on a list view
Click on the button to set up optional fields
Before this commit, the dropdown expanded to the right, and was partly invisible
After this commit, we dynamically set to which direction the dropdown should expand
depending on RTL/LTR
Consequently the dropdown is fully visible in either mode, and expands to the list
rather than away from it
closes#39402closesodoo/odoo#39628
X-original-commit: fb914d176de5a4711f11de32945ebaec0164f62e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In discuss, make a search with some stuff, and try to save
that filter as favorite
Before this commit, there was a crash, because the Discuss action
did not implement what the controllers do to save favorites.
After this commit, it is possible to save a filter as favorite
OPW 2087258
closesodoo/odoo#39519
X-original-commit: 5514a414324675bf5c2cc0360e429a7d2548b16f
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the calendar searched records on the wrong time ranges
which did not take into account the timezone of the user
It obviously resulted in some records not being there
After this commit, all the relevant records are fetched according to the right
time range in UTC, corresponding to start/end of the week/month/day of the calendar
OPW 2076114
closesodoo/odoo#39466
X-original-commit: 0f10927efe490bd82e7c23e0fc646dd6c8de2d27
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
To reproduce the issue, go in the settings of the employee app,
simulate a slow 3G connection, modify the working hours:
* Select the first one, modify it but don't save it,
* Click on some others working hours consecutively
They will be all editable
* Edit them quickly
Before this commit:
- You get an error
After this commit:
- You get no error and the behavior is the same than in V12:
the working hours are updated consecutively
Note: when you stress the relational field quickly, there is a moment
where this.$el is undefined. This is the reason why the error is raised.
OPW-2088558
closesodoo/odoo#39435
X-original-commit: 2acb76ffbb2f1ca2a6af0e316da15ce605f2273a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Remove SignatureDialog from `signature.js` to put it in its own file,
`signature_dialog.js`. The purpose of this change is to be able to
require SignatureDialog in any other file and to separate dialog and
field business.
task-1878607
Before this commit, all the computation of the default widths for column
headers was done before the list was attached to the DOM, meaning that no
column was actually visible. This was a problem since columns that are
meant to stay unseen were taken into account in the calculation of relative
column widths.
Now, the same algorithm runs once the columns are visible so that invisible
columns can be properly excluded.
fixes#38744
Task 2076721
X-original-commit: 4bf98b47898b075049975dfe597f0fb92c7c14d1
Before this commit, the `width` attribute was interpreted by a jQuery node generator
function as a `style="width"` property and gave an incorrect width value to the affected node.
Now, the `width` attribute is automatically plucked in the list renderer in the
specific function used to render buttons.
Task 2076721
X-original-commit: c67b36c00ca263f51e0dd49d6e38702c4d614289
The nightly clickall runbot fail due to a crash of the underlying chrome
browser used to run the test suite. The problem is related to the
resources the browser is using. We leverage the problem by starting one
dedicated browser per app.
closesodoo/odoo#39190
X-original-commit: 228e57d980839bd2b4e9123bf26f8a64de2ae6ab
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Due to commit odoo/odoo@f4031c62f9
it was not more possible to scroll in a grouped kanban.
Steps to reproduce:
* Go to project app
* Select a project with a few numbers of task
* Create as need new task to have more task than visible on the screen
* Try to scroll (BUG)
Note: we also fix the swipe in empty column
opw-2080491
closesodoo/odoo#39168
X-original-commit: 023941e25cae34e60eaabcc54841b3d908a59414
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Go on a kanban view with a scroll bar
scroll all the way down
Open a record in form view
Use the breadcrumb to go back to the kanban
Before this commit, the kanban was re-opened
but the position were we were before opening the record was lost
This was due to 40dd121938
which refactors the dom, puting the action manager on top of controllers
After this commit, when re-opening the kanban, we end up at the same position
we left it at
OPW 2074077
closesodoo/odoo#39120
X-original-commit: c0d48878c452b256859f067186567c126d8de27e
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Before this commit, the search bar auto focus was already disable
on mobile based on media queries.
But "isMobile" equals false since we force the desktop mode.
To fix this, we use isMobileDevice which doesn't depend on the
resolution.
Task ID: 2090202
In this commit, we introduce "isMobileDevice".
Do not confuse with isMobile.
isMobile:
A frequent use case is to have a different render in 'mobile' mode,
meaning when the screen is small. This flag (boolean) is true when
the size is XS/VSM/SM. It is also updated dynamically.
isMobileDevice:
Mobile device detection using userAgent.
This flag doesn't depend on the size/resolution of the screen.
It targets mobile devices which suggests that there is a virtual keyboard.
Task ID: 2090202
Description of the issue/feature this PR addresses:
In pivot, when we click on '+', it must open the selection box at
the point where we click.
Current behavior before PR:
The box opens at the top of the page
Desired behavior after PR is merged:
The box opens at the point where we click
id=2066675
closesodoo/odoo#39034
X-original-commit: 989df08fd8bbfa4a1f05784b599b1657a9b28fe5
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, the trash icons and "OR" indicator of each filter
was too far and couldn't be seen
Now, both of them are closer to the filter and can be seen in any circumstance.
Task 2073707
closesodoo/odoo#39026
X-original-commit: 87a91c78fb15ee941e72023e02e539de64f0486d
Signed-off-by: Julien Mougenot (JUM) <Arcasias@users.noreply.github.com>
On a list view, Add a custom filter on a date
Change the operator to "in between"
Change it back to "equal"
Apply the search
Before this commit, the label of the filter still was in between
Whereas it should have been "equal to ..."
After this commit, the label of the filter is correct
OPW 2085951
closesodoo/odoo#38705closesodoo/odoo#38869closesodoo/odoo#38936
Original-signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Original-signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
X-original-commit: bb775152b79f1212258ff47daac387eaf11f64e2
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In a list view, create a custom filter involving a date or datetime field
Before this commit, the domain that was sent to the server
contained the date or datetime as the pure string
representation that Moment.js constructs
that is a ISO compliant one, containing info on timezone
After this commit, the format is the one of the server, in UTC
and NOT ISO compliant. Also, the format for date is dealt with
OPW 2085936
X-original-commit: 1f1fa173c38dae105637edeb3a1e856e9748a14f
Purpose
=======
We want to add an option on the widgets
- many2many_binary,
- binary,
- image
This option specifies what file extensions the user can pick from the file input dialog box.
Examples
========
```xml
<field widget="many2many_binary" options="{'accepted_file_extensions': 'image/*'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="many2many_binary" options="{'accepted_file_extensions': 'application/pdf'}"/>
<field widget="image" options="{'accepted_file_extensions': '.png,.jpeg'}"/>
<field widget="binary" options="{'accepted_file_extensions': '.pdf,.svg'}"/>
```
How
===
Add an option (accepted_file_extensions) in the template ``HiddenInputFile`` (the widget many2many_binary is using this template)
So, we can also use this new option in others widgets using ``HiddenInputFile``
In the many2many_binary, read the ``nodeOptions`` and set the widget attribute ``accepted_file_extensions``
We also have to fix some other widget, because an property ``image_only`` was already existing in the template ``HiddenInputFile``
(we just need to replace ``image_only=True`` to ``accepted_file_extensions='image/*'``
The widget ``FieldPdfViewer`` (pdf_viewer) now use the new option to filtrate PDF
(instead of removing the <input/> and adding <input accept='.pdf'/>).
Tests
=====
We also test if the option is correctly set on the <input/>
- binary
- image
- many2many_binary
Impacted widgets
===============
- many2many_binary
- image: this widget use ``options="{accepted_file_extensions='image/*'}"`` instead of ``image_only=True``
- tablet_image: same as ``image``
Task #2082815closesodoo/odoo#38351
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Before this commit:
When there few elements in kanban and a search panel, all kanban
cards try to take a maximum of height and become deformed.
After this commit:
The behaviour of dimensions of kanban cards must be the same with
or without searchpanel.
closes#38556closesodoo/odoo#38871
X-original-commit: a95cbbd631a2fa9be62eb42cba43e853fdf4b789
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
The fieldbinary widget has an internal max upload limit set to 25mo.
This was set a long time ago, probably more than 5 years ago. Since
then, a lot of things have changed and it may be more frequent for users
to hit the limit. And it happens for some users, we had to increase
locally their limit.
Also, nginx is configured to accept files up to 64 mo, so it makes sense
that the web client also uses that same limit.
closesodoo/odoo#38856
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This option, if set to True, prevents the user from modifying the
color of the tags.
Part of task 2070454
closesodoo/odoo#38848
X-original-commit: a62b65a8f9114493064d4efae92825814a880c04
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
- The copy CopyClipboardChar widget is not nicely rendered for very long strings (e.g. URL).
- This commit modify the behavior of the CopyClipboardChar widget to display it nicely win such cases.
TaskID: 2059972
Before this commit, it was not possible to show a message using a client
action. (e.g. show a success message only with core in Python)
Now, it's possible using a client action. This client action call
displayNotification and so we can use the same options also.
A test is added to be sure that this action do not change the current action
Note: in the future a custom registry may be created in a refactoring
to specific function action registry.
X-original-commit: 8775fd670b6b3ec19a77fc0eab72d2223baa36c8
Before this commit, if we use some client action like: reload, logout, ...
in the console a warning is show, because the action are function and not
AbstractAction.
After this commit, if the client action is not an function and not
a AbstractAction the warning is show.
X-original-commit: 122b76594aeb2c5d923d13c040c2da2048133aac
Before this commit, when we have a list (editable top) in a form
with some mandatory fields and some existing rows. If we click on
'add a line', a new empty line appear on the top, then we click on
the last row, the empty row will disappear and we will have a
traceback.
After this commit, if we repeat this scenario, we click on the last
row, we will be able to edit this last row.
closesodoo/odoo#38471
X-original-commit: 996f77b03eaf6dd646b1816e7f70209d5ee6f8df
Signed-off-by: jbm-odoo <jbm-odoo@users.noreply.github.com>
-Import a subscription with end date beyond 200 in the future (ex: 2500-01-01).
-Open the subscription and click the Edit button.
Before this commit:
A stacktrace appears indicating that a date is not valid. It's not possible to
edit the subscription.
After this commit:
The maxDate of the date picker has been increased to 31/12/9999, allowing the
user to edit subscriptions whose end date is that far in the future.
A test `toggle datepicker far in the future` for this case has been created.
closesodoo/odoo#38527
Opw: 2079696
X-original-commit: 32b6131c04fef7a542a0ccbdb924d177627bfe38
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this rev., if the week_start param (the first day of week)
of the user language was changed, it wasn't reflected on datepickers
(however, it worked fine in the calendar view). This rev. makes this
work by updating the moment locale with the corresponding param.
Fixes#36450Closes#36532closesodoo/odoo#38472
X-original-commit: eeb518316f25d652bea3ec6d387db6ad93284fb2
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When there are many events at the same moment in a calendar,
events are thin and on mouse hover the event take all the width.
Before this commit, when we drag or we resize a event in calendar,
the event returns to the state thin.
After this commit, the width event stay width during resizing and
draging.
closesodoo/odoo#38384
X-original-commit: 405294602070590083a2b438f631615f72000292
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This controller never really worked in the last 3 versions.
It was fixed in 11.3 with e9350993ca but broken with refactoring in 12.0 at a
higher level with 19eacf7d23.
It was even worse in 13.0 as it was leading to a traceback: `view_type` field
got removed with 3cd7ed07a2 but this controller was still reading that
field.
closesodoo/odoo#38355
X-original-commit: a5c4e262449fef03d05d5250e4523832db5fbf00
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- fix condition to correctly display company logo placeholder
- use avatar_grey on the "Contacts & Addresses" as white on white is not visible
- use `cover` to avoid excessive zoom on mobile
closes#38001closesodoo/odoo#38319
X-original-commit: 1210cb70bec421936c9d332b1347797bc83845cf
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Allows the quick create on m2o in list views
Before this commit, when entering a new value in a many2one in a list and
exiting the cell through a click, the quick-create modal appeared for the
duration of the mousedown.
Now, the modal remains and allow to edit the new many2one value
Task 2076380
closesodoo/odoo#38289
X-original-commit: c00f84eb0a176b8d23927080078eb02dc2e5d806
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
We don't want the browser to fill inputs in the backend.
Most of the time this is useless but sometimes it is
even problematic. For example, focusing an input in a
modal can trigger autofill not only in the modal but
also in the whole page. If there is an input outside
the modal and it is recognized by the browser as a
candidate to fill, bad things occur.
For that reason, we set the attribute autocomplete to
"none" by default for input elements.
Note that "off" does not work all the time because
the browsers sometimes decide to ignore it.
Task ID: 2076730
closesodoo/odoo#38039
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
This reverts commit 08108486d5.
+ Fix the url that add a useless ending / and so a useless redirection.
There are no problem of mixed content or anything else, if you configure nginx
and launch your server in proxy-mode as specified into the documentation.
closesodoo/odoo#38196
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>