The main purpose of this commit is to be consistent with the enterprise edition,
in which the event 'DOM_updated' is triggered when new content is inserted in
the DOM. This way, addons that need to know when a view has been attached in the DOM
(e.g. web_tip) can listen to this event and will work fine with both editions
of the web addon.
With the actual structure of the webclient (action_manager, view_manager),
there is no easy way to decide whether or not a view is attached in the DOM,
because every rendering is performed in a detached element. For instance,
when a view_manager instantiates a new view, it appends it in its $el once
the view is ready, but it can't know if its $el is attached in the DOM (it is
only the case if the view_manager is the current action of the action manager).
This rev. introduces utility functions to centralize the appending/prepending of
content, so that an event can be triggered (at a unique place) when the content
is really in the DOM. These functions are used by the the action_manager and the
view_manager.
Another change is that the action_manager keeps the view_manager informed when
they are attached in/detached from the DOM, through the variable is_in_DOM.
Adapt the Favorites menu so that addons appending stuff in it are compliant with
the enterprise edition.
Mainly, creation of dashboard.less from of dashboard.sass so that we can use mixins
defined in the web addon.
Some changes as well in the dashboard view to make it compliant with the enterprise
edition.
Use correct naming convention: classnames with underscores, less mixins with hyphens.
* select2 was linked in both backend and frontend (by web and website)
* select2-bootstrap was in website and linked only in frontend but it
is in fact needed in backend too
+ Remove useless link of the lib by other modules
Adds the option clear so that, if set to false, only some elements of the
control panel can be updated while keeping the other ones unchanged.
The breadcrumbs can then be updated by simply calling update_control_panel(),
instead of triggering a specific event to do it.
A bit of documentation and refactoring as well, mainly for the
breadcrumbs to be handled as other control panel's elements.
In edit mode, if this field is readonly and empty, its main div has
height 0 but its border is displayed. This rev. simply hides the field
in this case.
The set_value() function of x2many fields is asynchronous. When a record is
loaded, the invisibility changers (IC) are evaluated once set_value() has been
performed on every fields. As set_value() didn't return its deferred, the IC where
evaluated with wrong values. It produced in particular the following bug:
Go to Customers > Agrolait (the Contacts tab is displayed), switch to next record,
which is the first contact of Agrolait. The Contacts tab is still displayed,
whereas it should not (the invisible condition being is_company == false and
child_ids == [], i.e. there is no contact).
Also call this._super() in set_value() of AbstractManyField instead of
duplicating the function of its parent.
Before this rev., the multi_select option wasn't enabled even by setting
disable_multiple_selection to false in the options, when the res_id key
wasn't defined in options (null != undefined). It was the case for every
X2Many views, except for the Many2ManyKanban view as we explicitely set
the disable_multiple_selection to false AND res_id to null. However, all
X2Many views should enable this option.
This rev. generalizes the notions of FieldOne2Many to FieldX2Many and of One2ManyViewManager
to X2ManyViewManager. The same logic is now applied both for One2Many and Many2Many fields.
This allows Many2Many list and kanban views to have a pager, as the pager is instanciated
by the view, on demand of the ViewManager.
Apply the same style to many2many form_field as for one2many ones.
Make the sales_team cards for team members clickable.
Add "position: relative" to sales_team cards for the cross to be correctly
positionned. Inline style is not the right way to do it, but for the sake
of consistency, it is ok. A better commit should come to remove this inline
style from all x2many kanban templates.
this is not necessary anymore, with the new kanban view. It also
paves the way for further changes (soon to be done): using a viewmanager
to instantiate the many2many kanban view
To distinguish two ir.attachment 'File Content', we base it on the file
size (this I imagine is for efficiency).
This is done by setting bin_size in the context. Doing this, the
returned db_datas field will be the file size of the converted to base64
content (if no filestore).
But this size is returned in string format, so "get_nice_size" (in
openerp/osv/fields.py) which gets this size calculates the length of the
string. e.g: if the size is '2142' get_nice_size will return 4.
This fix solves this by converting the string to an integer, thus
unifying it with the filestore case (where we use os.path.getsize which
return an integer).
Also, the field presenting the issue (FieldBinaryFile) has been changed
so it is always updated even if the size is the same (as it was already
done by 3632949 for FieldBinaryImage widget).
closes#7223
opw-643071
This decision comes from the following bug:
- Go to Sales -> Quotations, and open any existing quotation in form view (the
partner must have an address defined)
- Click on the partner
- Click on the stat button "Claims"
- You notice that the address of the partner is included in the search
This is due to the context property show_address which is set to 1 when a
quotation is open. Therefore, it is necessary to filter out this keyword.
Since the prefix "show_" is used for only few context variables, it was decided
to define this pattern as a standard pattern to filter out.
opw-642893