summaryrefslogtreecommitdiff
path: root/addons/mail/static/src/js/form_renderer.js
AgeCommit message (Collapse)Author
2019-03-06[REF] mail: adapt code after jQuery updateVincent Schippefilt
Part of task 1896658 Co-authored-by: Aaron Bohy <aab@odoo.com> Co-authored-by: Christophe Matthieu <chm@odoo.com> Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com> Co-authored-by: David Monjoie <dmo@odoo.com> Co-authored-by: Martin Geubelle <mge@odoo.com> Co-authored-by: svs-odoo <svs@odoo.com> Co-authored-by: Vincent Schippefilt <vsc@odoo.com>
2018-10-17[FIX] mail: chatter in x2many form viewAaron Bohy
Since rev. 755a8d815a, it crashed when the user tried to open an x2many record in form view (thus in a dialog), if there was a chatter in that form's arch. This was because the wrong viewType was used (for instance, list or kanban instead of form), to look into fieldsInfo, and thus the chatter fields couldn't be found. opw 1891378 opw 1892520 opw 1893100 closes odoo/odoo#27844
2018-09-17[REF] mail: update related_attachment_count field name to match mixin namespace.ThanhDodeurOdoo
Reason: The Attachment count of mail_thread is used by the new attachment button of the chatter, the compute field has been chosen over a search_count JS RPC to keep a synchronous chatter and prevent flickering. This commit refactors those changes to follow the naming conventions of mail_thread and to optimize the count method for eventual reuse follwing TDE's advices. - Changed the name of a mail_thread's related_attachment_count into message_attachment_count. - Changed the count method to a read_group. PR: 26989 Task: 1860031
2018-09-13[IMP] mail: new attachment button in the chatterThanhDodeurOdoo
- Added a new button to the chatter that displays the amount of attachments on the current record and when clicked, all the attachments attached to the current record - added mail.FormView (includes), used by the chatter attachment button to fetch the field value of attachment_count. - added a computed field "attachment_count" to mail.thread that contains the amount of attachment attached to the record. - changed the followers div, it is now sharing a "right side" area with the attachment button. task: 1860031
2018-01-17[IMP] mail: chatter creation message in formviewAlexandre Kühn
Before this commit, when we create a new object (e.g. task, product, ...), the part of the form for the chatter was blank. After this commit, it displays the chatter with a single temporary message 'Creating a new record...' This message is only visible by the user that is creating the task, and goes away when saving the newly created task. Any interaction with the chatter (buttons and widgets at the top of the chatter, including the message itself) are disabled, so that no interaction from the user is possible.
2017-12-01[MERGE] forward port branch 11.0 up to c201cf2b77cChristophe Simonis
2017-11-29[FIX] mail: display chatter inside the sheetMartin Geubelle
Before this revision, it was not possible to display a chatter inside a <sheet>. As the chatter is reused (when switching in edit, records, etc.), it is detached (to keep its handlers) before updating the form $el. The problem here is that the chatter was detached in `_updateView` from `$form.contents()` where the chatter is a root element ; when setting the form view html, the chatter was thus still present. This was thus only working correctly if the chatter was a direct child of <form>. To keep it displayed in all cases, we now detach it at the chatter node rendering. Closes #20032
2017-11-17[REF] mail: create separate files for includesMartin Geubelle
The rev. odoo/odoo@ab900bb fixes an issue in mail which needed an include on BasicModel and FormController. As this rev. has been done in a stable branch, the includes have been done in an existing file. This rev. correctly separates the includes in different files.
2017-11-17[MERGE] forward port branch saas-16 up to 11ff01af9b3Christophe Simonis
2017-11-17[FIX] mail: keep model informed of new messagesMartin Geubelle
Do not forward-port this after 11.0 After sending a message, if one switched in edit mode in the form view, the created message disappeared. This is because the model is not aware of messages (they are created through their own routes, message are not handled as other one2many fields with commands) and the widget was reset with a new datapoint instance when switching in edit mode. In this rev. we keep the model informed of the new messages by directly writing the message ids in the datapoint. Note that the includes on FormController and BasicModel are one in the form_renderer.js file to fix this issue in existing database without adding files. Another revision will be done in master to add the correct files. opw-781353
2017-09-06[FIX] mail: allow identifying the chatter in creation modeqsm-odoo
Before this commit, the chatter was rendered as an empty <div/> without any class while in creation mode. This <div/> was then placed inside the .o_form_view_bg element by mistake, as it did not match the '.oe_chatter' selector.
2017-04-25[FIX] mail: re-bind handlers on chatter buttonsAaron Bohy
When a user opens a record in a form view, the chatter is displayed. Then, if he clicks on 'Create', the chatter is removed from the DOM (there is no chatter in create mode). After saving the newly created record, the chatter is displayed again, but the same widget's instance is kept. However, when being removed from the DOM, the event handlers bound on elements of the chatter (e.g. 'New Message', 'Log a Note'... buttons) are automatically unbound. So before this rev., the buttons didn't work anymore once the form view had switched to create mode. In this commit, we detach the chatter's $el before updating the view, so that its handlers aren't unbound when the old content is replaced by the new one.
2017-04-19[REF] web, *: implement modifiers behaviorsqsm-odoo
* account, mail, sale Since the views refactoring, modifiers were not properly handled anymore (readonly/required not recomputed, use of readonly/required of "python field" instead of "view field", ...). This commit tries to implement a system which allows to handle the modifiers (re)computation the same way for all the basic views. For this to work, many specialized renderers behaviors have been moved to the basic renderer so that more mechanisms are shared (especially by the form renderer and the list editable renderer). The list editable renderer is hugely impacted by this commit. Here is a list of key changes: - The basic renderer now has a `_renderFieldWidget` function which is used without modification by the form and the list renderers. - Modifiers have to be registered thanks to the basic renderer `_registerModifiersData` function (this is done automatically for fields by the `_renderFieldWidget` function for example). - All instantiated widgets are accessible, organized by record, and ordered in a special basic renderer variable. - The code which resets the widgets of the form view and the code which updates the row of a list editable view is now shared in the basic renderer and now also automatically updates the DOM according to the reevaluated modifiers. - The last point has an huge impact on list editable renderer: all the widgets have to be instantiated when editing a row (even readonly and invisible ones) as they can be switched to editable/visible during edition (after a modifiers update). - `replace_element` and `readonly` options of `AbstractField` are useless: widgets are now always replacing the list editable cells in edition and the `readonly` widget mechanism is replaced by the notion of 'focusable' widgets. (see `AbstractField.getFocusableElement`) - The 'tab' navigation mechanism is impacted by the previous point, some code sharing have been done in basic renderer for this too. - `AbstractField` does not care anymore of the 'required' status, this is the view responsability to check that a required field has a set value on save. - Some list editable bug fixing (e.g. it was possible to edit multiple rows at the same time, it was not possible to navigate towards the previous field, crash on o2m add an item click, ...) - The mockserver now properly simulates server modifiers computation. - ... Note: list editable style may be worse than before this commit but a CSS update is coming in a few days.
2017-04-11[REF] web, *: redesign all JS viewsGéry Debongnie
This commit introduce a full redesign of all JS views. We started basically from scratch. The goal was to unify all the various views under a common framework, to make them testable, to make then usable in different conditions (in studio, or in the frontend), and to make our lives easier. Some important points are: - we introduced new coding guidelines (camelCase, 80 chars width, ...) - we have a brand new testing framework (still QUnit based) - kanban view moved to the web addon - calendar view (formerly web_calender) moved to web as well - the tree view was removed - all new code should be documented We hope that this code is the start of a new era for the Odoo web client, we want to have a high quality codebase, well documented, well tested, well designed. Work done by the framework team: mostly aab, ged, chm, dmo, qsm