diff options
| author | Martin Geubelle <mge@odoo.com> | 2017-11-17 15:26:49 +0100 |
|---|---|---|
| committer | Martin Geubelle <mge@odoo.com> | 2017-11-17 16:26:45 +0100 |
| commit | afc0df5b0cddf9ff6381cfa886b40ff08c0d2909 (patch) | |
| tree | af2d5c1b343c57afdc7b393eada28d3d21462bc3 /addons/mail/static/src/js/basic_model.js | |
| parent | 0fdf2913052eecd426be6515d8f77cbd176dcee1 (diff) | |
[REF] mail: create separate files for includes
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.
Diffstat (limited to 'addons/mail/static/src/js/basic_model.js')
| -rw-r--r-- | addons/mail/static/src/js/basic_model.js | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/addons/mail/static/src/js/basic_model.js b/addons/mail/static/src/js/basic_model.js new file mode 100644 index 00000000000..11139819a60 --- /dev/null +++ b/addons/mail/static/src/js/basic_model.js @@ -0,0 +1,33 @@ +odoo.define('mail.basic_model', function (require) { +"use strict"; + +var BasicModel = require('web.BasicModel'); + +/** + * Include the BasicModel to update the datapoint on the model when a + * message is posted. + */ +BasicModel.include({ + + //-------------------------------------------------------------------------- + // Public + //-------------------------------------------------------------------------- + + /** + * Update the message ids on a datapoint. + * + * Note that we directly update the res_ids on the datapoint as the message + * has already been posted ; this change can't be handled 'normally' with + * x2m commands because the change won't be saved as a normal field. + * + * @param {string} id + * @param {integer[]} msgIDs + */ + updateMessageIDs: function (id, msgIDs) { + var element = this.localData[id]; + element.res_ids = msgIDs; + element.count = msgIDs.length; + }, +}); + +}); |
