Test to bind save and discard buttons of an editable tree view are done
only once when initializing it.
But if the view is by default grouped at the beginning, it will be then
"not editable" but only removing the groupby will change this.
So this commit add a case so if the view is grouped when initialized,
the buttons are always bound.
closes#11198
opw-666794
When the user click on save, 'is_valid' is called on each field.
The o2m test all sub-field (apply modifier and check value).
But, if a modifier change the read-only attribute, the field is reinitialized and call 'render_value' without check 'no_rerender' value.
The relational fields call the db in render_value, and the x2m is invalid because a request is pending.
(change X2ManyListView to keep the 'no_rerender' initial value)
opw-653120
The Dialog class destroys the modal (and so removes it from the DOM)
when the dialog closes but leaves the modal-open class on the body
element if there are still other modal(s) in the DOM.
The problem is that (maily on the frontend side) there may be others
modal(s) in the DOM (not handled by the Dialog class) but which are
not shown to the user, and in that case the modal-open class should
be removed.
The copied textarea used in autoresize was a valid target for focus when
using the tab key. This is a major issue in editable list views,
because when the user leaves a textarea, the list view jumps up, with no
visible focused field.
Translated text is stripped of starting and ending spaces on Transifex which
makes the result text look bad (as translators do not put spaces in their
translation either).
Add explicitely a space to be sure it's present in the translation.
Will have no effect on English as it's HTML
When clicking on a pivot view cell, the gotten view were default views.
For example when on the opportunity pivot view, after clicking on a cell
we we would get to the crm.lead default view instead of the opportunity
one.
This commit keep references to current action views when clicking on the
cell.
closes#10768
opw-668472
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id which will get us an xmlid
instead.
But the data about related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.
It is in this data that the /id will be appended for the field, but when
getting a saved export list, this data may not be available.
This commit immediately add the `/id` when a field is put in "Fields to
export" column, so this inconsistency is no more.
closes#10640fixes#10327
opw-665994
When editing a line, leave the buttons visible.
Also remove the 3px gap between fields so that readonly field texts
does not move when entering the edition mode.
* Fix the grid display of images (use the column property)
* Use Dialog class
* Allow removing a cover image
* Add image selection before choosing it (or double click to choose)
+ add less mixins in web for columns property
The module system allow modules to return a deferred. When that
deferred resolves, the module is considered to have succesfully loaded,
and the result value is its value. Then, the boot.js code used a
setTimeout (via _.defer) to load all its dependencies.
This is not wrong per se, but it empties the call stack, which give
other code the opportunity to interfere. In particular, it is an issue
in phantomjs tests, because it causes a window between the
domcontentloaded event (which is a key event in website) and the actual
loading of all dependent modules. This execution window can be used to
start some tours, but the code of those tours is waiting the next tick
to load, so horrible crashes happens.
This commit calls immediately process_jobs to avoid those issues.
The dataset of an x2m could be set as changed on a focus event, but if
the form is currently not in editing, it could stay blocked in this
state.
This commit add a check so blur and focus on x2m are better coupled.
opw-665401
The definition of "total" as a global variable is done too soon in the
JS. Depending on the order in which the JS modules are loaded, it is
very unlikely that the translations are already loaded at that moment.
opw-666577
In most backend views using CTRL+P to use browser printing would only
print an header without the content.
stumbled-uppon-when-checking: opw-659430 opw-660763
The action "Technical Translations" was not retrieving the correct translations.
Since 9.0, the translations names no longer contains the name of the model (in
the form "field:<model>,<name>") but are records on ir.model.fields (in the form
"model:ir.model.fields,field_description:<model>_<name>").
The translations of type selection are style a different type (type 'selection').
Create a method that will find the linked fields and retrieve the correct
translations.
Fixes tw:reis_pt/status/687419541199187969
In most backend views using CTRL+P to use browser printing would only
print an header without the content.
stumbled-uppon-when-checking: opw-659430 opw-660763
The problem occured when the user quickly clicked several times on the view
switcher or the breadcrumbs. The function switch_mode() of the view manager
was called once per click. This function's role is to prepare the requested
view, and once it is ready, to remove the former one from the DOM and insert
the new one instead. It is thus asynchronous as it waits for the
fields_view_get and search_read RPCs' response.
Unfortunately, when those calls to switch_mode() overlapped, the former view
reference was lost and it was thus never removed, producing a weird situation
where two views were displayed one above the other. This may happen when a
view takes a while to load, or simply when the user double-clicks on the
breadcrumbs or view switcher.
This rev. makes sure that calls to switch_mode() can never overlap by refusing
any other call when there is still one processing.
We also added a protection against breadcrumbs and view switcher double-clicks.
opw 658924
When an error occured when switching from a view to another (e.g. switching
to a form view for an id that doesn't exist, by editing the url), active_view
and view_stack were updated even though the switch failed. The view manager
thus lost the reference to the real current active view, which couldn't be
detached anymore. This resulted in two views being displayed at the same time
if the user kept navigating through this view manager.
This is a backport of odoo/enterprise@0b1aafa6b and odoo/enterprise@8e691be.
Issue:
Invoicing -> Vendor bills
Create a record with reference=0 -> Register Payment
Create a second record with reference=0, at least one line with at least one tax -> Save
Edit -> change quantity in the line -> Register Payment -> the register fail
change the quantity again and change reference=1 -> Register Payment
The taxes is include twice
autosize does not work correctly (it moves the screen in all directions
sometimes when the user press enter in the bottom of the screen in some
browser),
So, we decided to have our own version, because of course, we can do it better. A
few horrible hacks later, I proudly present you "autoresize" (it was
almost named "odooresize" but common sense prevailed).
As added benefits, it plays better with our web client, so when you open
a dialog in a modal for example, the autosize fields should have the
correct height automagically (or should I say 'odoomagically')
When you are in form view and came from calendar, a screen refresh
throwed an error from fullcalendar lib. Also when going back to the
calendar view, it would not be loaded.
It is due to fullcalendar not being rendered if it is not visible, and
other part of the Odoo code are dependent on it having been rendered.
This commit hide the calendar after having been rendered.
closes#10253
opw-659314
Commit 704b3cec9f introduced a bug which led to be on page -1 on
empty o2m. So when adding a record to such a o2m, the reload content
function chose to stay on page -1 therefore not displaying the new
added record.
Opening a view (kanban or list) in a dialog thanks to a target=new
action did not work anymore (only in community).
The cause was the 'search_view' action flag which was set to false
in case of a popup (preventing the view to search the records and so
to display them). This commit sets this flag to true if the popup
has to display a list/kanban view.
Backport of aab enterprise work.
Commit b3f3c67eea corrected the o2m view manager template which was
useless in its previous version because of a dead selector. It appeared
that some fonctionnality relied on the fact that this was dead code.
This commit removes the dead code.
Thanks LeartS (see #5711).
when going through different form view records
For example, when being on page 4 of a o2m then switching to next form
view record, if this new record did not have 4 pages for this o2m, the
o2m was shown empty (and if there was no page, the o2m became unusable)
One2many fields bring in the entire viewmanager widget.
When there is only one view though (e.g. only kanban view for contact
tab of partners), we want to hide the viewmanager header because we
don't need it (it's where the view switcher would go).
Odoo had the widget logic to do that, but it was wrongly implemented,
resulting in a always present oe_view_manager_header div with all
its elements (although empty).
The wrong javascript operation should have triggered a client error
when loading the view, but for pure chance it didn't because the
t-jquery selector was wrong too so the javascript was never evaluated.