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.
m2m_tags inlist editable view try to get color on validation, the field is invalid because the mutex is pending.
Fix: don't re-render the fields
Issue: steps to reproduce:
- Create a new instance, install "sale"
- Create a product "prepayment", service, invoice on ordered qties
- Create aproduct "project phase", service, invoice on delivered qties, manually track delivered qties
- Create a SO with once prepayment, and twice a line with "project phase". ( the name (description) of the lines should be "phase 1" and "phase 2" )
- Create invoice => The prepayment is invoiced
- Go back to the SO, try to change the delivered qties of the first phase to 1
- Save => error, odoo doesn't let you save.
1. To change the page title, you now have to call
`set_title` from `require('web.web_client')`
2. Without the `type="button"`, the `Change Password`
button is regarded as a `type="submit"`, therefore
submitting the form, on `web` on click,
and `web` doesn't expect this POST request.
The POST request must be done on
`/web/session/change_password` only.
opw-660567
in `view_pivot.js`,
the method `view_loading` must wait the `self.fields` variable
to be defined before working properly.
This `self.fields` variable is filled in the `prepare_fields` method,
which is called in the `start` method, through a deferred named
`load_fields`.
`view_loading` is called in `start`, in `views.js`.
Therefore, in the overriden method `start` of `view_pivot.js`,
the call to `_super`, calling the `start` of `views.js`, must wait for
the `load_fields` deferred to be resolved.
Otherwise, the `self.fields` variable, mentioned above, won't be
filled in time.
opw-660153
Currently, the m2m tags widget would only display the name present in
the "name" field. This prevent them from being used with custom
fields/models and other niceties.
opw-658490
Reverted because it causes issue #10083 when serializing
nexted x2many values, and produces invalid x2many commands,
such as:
`[[6, false, [[5, false, false], [6, false, [8]]]]]`
Pending a proper fix for the oririginal issue.
This reverts commit 7e2628aeb2.
Closes#10083