diff --git a/attachment_action/README.rst b/attachment_action/README.rst new file mode 100644 index 00000000..28fdb36c --- /dev/null +++ b/attachment_action/README.rst @@ -0,0 +1,78 @@ +================================ +Container for attachment actions +================================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github + :target: https://github.com/OCA/knowledge/tree/10.0/attachment_action + :alt: OCA/knowledge +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/knowledge-10-0/knowledge-10-0-attachment_action + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/118/10.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module was written to provide a container for other modules to add buttons for actions on attachments. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +This module doesn't do anything useful on its own, it's meant to be used by other developers. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/knowledge `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attachment_action/__init__.py b/attachment_action/__init__.py new file mode 100644 index 00000000..8c501711 --- /dev/null +++ b/attachment_action/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). diff --git a/attachment_action/__manifest__.py b/attachment_action/__manifest__.py new file mode 100644 index 00000000..fbfa3e87 --- /dev/null +++ b/attachment_action/__manifest__.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +{ + "name": "Container for attachment actions", + "version": "10.0.1.0.0", + "author": "Therp BV,Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Hidden/Dependency", + "summary": "Base for addons adding buttons to attachments", + "depends": [ + 'web', + ], + "data": [ + 'views/templates.xml', + ], + "qweb": [ + 'static/src/xml/attachment_action.xml', + ], +} diff --git a/attachment_action/readme/CONTRIBUTORS.rst b/attachment_action/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..b120a956 --- /dev/null +++ b/attachment_action/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Holger Brunn diff --git a/attachment_action/readme/DESCRIPTION.rst b/attachment_action/readme/DESCRIPTION.rst new file mode 100644 index 00000000..47cdcb7b --- /dev/null +++ b/attachment_action/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module was written to provide a container for other modules to add buttons for actions on attachments. diff --git a/attachment_action/readme/USAGE.rst b/attachment_action/readme/USAGE.rst new file mode 100644 index 00000000..238c0f82 --- /dev/null +++ b/attachment_action/readme/USAGE.rst @@ -0,0 +1 @@ +This module doesn't do anything useful on its own, it's meant to be used by other developers. diff --git a/attachment_action/static/description/icon.png b/attachment_action/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/attachment_action/static/description/icon.png differ diff --git a/attachment_action/static/description/index.html b/attachment_action/static/description/index.html new file mode 100644 index 00000000..b40beeb0 --- /dev/null +++ b/attachment_action/static/description/index.html @@ -0,0 +1,402 @@ + + + + + + +Container for attachment actions + + + +
+

Container for attachment actions

+ + +

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

+

This module was written to provide a container for other modules to add buttons for actions on attachments.

+

Table of contents

+ +
+

Usage

+

This module doesn’t do anything useful on its own, it’s meant to be used by other developers.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/knowledge project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/attachment_action/static/src/css/attachment_action.css b/attachment_action/static/src/css/attachment_action.css new file mode 100644 index 00000000..9df4a5a0 --- /dev/null +++ b/attachment_action/static/src/css/attachment_action.css @@ -0,0 +1,21 @@ +.o_control_panel .o_cp_sidebar .o_sidebar_delete_attachment { + position: initial; + top: auto; + right: auto; +} +.o_control_panel .o_cp_sidebar .o_sidebar_attachment_action { + padding: 0px; + position: absolute; + top: 5px; + bottom: 5px; + right: 10px; + display: flex; + visibility: hidden; +} +.o_control_panel .o_cp_sidebar li:hover .o_sidebar_attachment_action { + visibility: visible; + background-color: inherit; +} +.o_control_panel .o_cp_sidebar .o_sidebar_attachment_action > span { + margin-left: 5px; +} diff --git a/attachment_action/static/src/xml/attachment_action.xml b/attachment_action/static/src/xml/attachment_action.xml new file mode 100644 index 00000000..27669f72 --- /dev/null +++ b/attachment_action/static/src/xml/attachment_action.xml @@ -0,0 +1,11 @@ + + + + + + + + jQuery(this).appendTo(this.siblings('.o_sidebar_attachment_action')); + + + diff --git a/attachment_action/views/templates.xml b/attachment_action/views/templates.xml new file mode 100644 index 00000000..b660899c --- /dev/null +++ b/attachment_action/views/templates.xml @@ -0,0 +1,10 @@ + + + + + + diff --git a/attachment_edit/README.rst b/attachment_edit/README.rst new file mode 100644 index 00000000..3176af0e --- /dev/null +++ b/attachment_edit/README.rst @@ -0,0 +1,87 @@ +================ +Edit attachments +================ + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fknowledge-lightgray.png?logo=github + :target: https://github.com/OCA/knowledge/tree/10.0/attachment_edit + :alt: OCA/knowledge +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/knowledge-10-0/knowledge-10-0-attachment_edit + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/118/10.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module adds a button on the records' attachment dropdown that allows to +open the attachment's form in edit mode. This makes it convenient to edit the +attachment's properties after upload. + +On the attachment's form, a field is added to move the attachment to another +record. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +Click the pencil that appears next to the delete button when you hover over +an attachment in order to edit it. + +To change the resource the attachment belongs to, edit the field `Resource +reference`. + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* Therp BV + +Contributors +~~~~~~~~~~~~ + +* Holger Brunn + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. + +This module is part of the `OCA/knowledge `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/attachment_edit/__init__.py b/attachment_edit/__init__.py new file mode 100644 index 00000000..915f58d4 --- /dev/null +++ b/attachment_edit/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# © 2015 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import models diff --git a/attachment_edit/__manifest__.py b/attachment_edit/__manifest__.py new file mode 100644 index 00000000..c0a1f135 --- /dev/null +++ b/attachment_edit/__manifest__.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- +# © 2015-2018 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +{ + "name": "Edit attachments", + "version": "10.0.1.0.0", + "author": "Therp BV,Odoo Community Association (OCA)", + "license": "AGPL-3", + "category": "Knowledge Management", + "summary": "Edit attachments after upload", + "depends": [ + 'attachment_action', + ], + "data": [ + "views/ir_attachment.xml", + 'views/templates.xml', + ], + "qweb": [ + 'static/src/xml/attachment_edit.xml', + ], +} diff --git a/attachment_edit/i18n/de.po b/attachment_edit/i18n/de.po new file mode 100644 index 00000000..257c8f1f --- /dev/null +++ b/attachment_edit/i18n/de.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_edit +# +# Translators: +# Rudolf Schnapka , 2017 +msgid "" +msgstr "" +"Project-Id-Version: knowledge (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-31 02:38+0000\n" +"PO-Revision-Date: 2017-04-19 11:33+0000\n" +"Last-Translator: Rudolf Schnapka \n" +"Language-Team: German (http://www.transifex.com/oca/OCA-knowledge-8-0/language/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: attachment_edit +#: field:ir.attachment,res_reference:0 +msgid "Resource reference" +msgstr "Herkunftsreferenz" diff --git a/attachment_edit/i18n/it.po b/attachment_edit/i18n/it.po new file mode 100644 index 00000000..531af1f7 --- /dev/null +++ b/attachment_edit/i18n/it.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_edit +# +# Translators: +# Marco Calcagni , 2018 +msgid "" +msgstr "" +"Project-Id-Version: knowledge (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-31 02:38+0000\n" +"PO-Revision-Date: 2018-04-10 19:32+0000\n" +"Last-Translator: Marco Calcagni \n" +"Language-Team: Italian (http://www.transifex.com/oca/OCA-knowledge-8-0/language/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: attachment_edit +#: field:ir.attachment,res_reference:0 +msgid "Resource reference" +msgstr "Riferimento alla risorsa" diff --git a/attachment_edit/i18n/sl.po b/attachment_edit/i18n/sl.po new file mode 100644 index 00000000..82301ef0 --- /dev/null +++ b/attachment_edit/i18n/sl.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_edit +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: knowledge (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-05-04 02:39+0000\n" +"PO-Revision-Date: 2016-05-03 15:18+0000\n" +"Last-Translator: Matjaž Mozetič \n" +"Language-Team: Slovenian (http://www.transifex.com/oca/OCA-knowledge-8-0/language/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: attachment_edit +#: field:ir.attachment,res_reference:0 +msgid "Resource reference" +msgstr "Sklic vira" diff --git a/attachment_edit/i18n/zh_CN.po b/attachment_edit/i18n/zh_CN.po new file mode 100644 index 00000000..1d0542c8 --- /dev/null +++ b/attachment_edit/i18n/zh_CN.po @@ -0,0 +1,24 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * attachment_edit +# +# Translators: +# ITGeeker , 2017 +msgid "" +msgstr "" +"Project-Id-Version: knowledge (8.0)\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-31 02:38+0000\n" +"PO-Revision-Date: 2017-04-19 01:16+0000\n" +"Last-Translator: ITGeeker \n" +"Language-Team: Chinese (China) (http://www.transifex.com/oca/OCA-knowledge-8-0/language/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: attachment_edit +#: field:ir.attachment,res_reference:0 +msgid "Resource reference" +msgstr "来源参考" diff --git a/attachment_edit/models/__init__.py b/attachment_edit/models/__init__.py new file mode 100644 index 00000000..a0a80d1f --- /dev/null +++ b/attachment_edit/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# © 2015 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from . import ir_attachment diff --git a/attachment_edit/models/ir_attachment.py b/attachment_edit/models/ir_attachment.py new file mode 100644 index 00000000..d50cea20 --- /dev/null +++ b/attachment_edit/models/ir_attachment.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +# © 2015 Therp BV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# -*- coding: utf-8 -*- +from openerp import models, fields, api + + +class IrAttachment(models.Model): + _inherit = 'ir.attachment' + + res_reference = fields.Reference( + selection='_selection_res_reference', + string='Resource reference', compute='_compute_res_reference', + inverse='_inverse_res_reference') + + @api.multi + @api.depends('res_id', 'res_model') + def _compute_res_reference(self): + for this in self: + if this.res_model and this.res_id: + this.res_reference = '%s,%s' % (this.res_model, this.res_id) + + @api.multi + def _inverse_res_reference(self): + for this in self: + if this.res_reference: + this.write({ + 'res_model': this.res_reference._name, + 'res_id': this.res_reference.id, + }) + else: + this.write({'res_model': False, 'res_id': False}) + + @api.model + def _selection_res_reference(self): + return self.env['ir.model'].search([ + ('transient', '=', False), + ('access_ids.group_id.users', '=', self.env.uid) + ]).mapped(lambda rec: (rec.model, rec.name)) diff --git a/attachment_edit/readme/CONTRIBUTORS.rst b/attachment_edit/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..b120a956 --- /dev/null +++ b/attachment_edit/readme/CONTRIBUTORS.rst @@ -0,0 +1 @@ +* Holger Brunn diff --git a/attachment_edit/readme/DESCRIPTION.rst b/attachment_edit/readme/DESCRIPTION.rst new file mode 100644 index 00000000..45ed5907 --- /dev/null +++ b/attachment_edit/readme/DESCRIPTION.rst @@ -0,0 +1,6 @@ +This module adds a button on the records' attachment dropdown that allows to +open the attachment's form in edit mode. This makes it convenient to edit the +attachment's properties after upload. + +On the attachment's form, a field is added to move the attachment to another +record. diff --git a/attachment_edit/readme/USAGE.rst b/attachment_edit/readme/USAGE.rst new file mode 100644 index 00000000..0934f2e1 --- /dev/null +++ b/attachment_edit/readme/USAGE.rst @@ -0,0 +1,5 @@ +Click the pencil that appears next to the delete button when you hover over +an attachment in order to edit it. + +To change the resource the attachment belongs to, edit the field `Resource +reference`. diff --git a/attachment_edit/static/description/icon.png b/attachment_edit/static/description/icon.png new file mode 100644 index 00000000..14d87f86 Binary files /dev/null and b/attachment_edit/static/description/icon.png differ diff --git a/attachment_edit/static/description/index.html b/attachment_edit/static/description/index.html new file mode 100644 index 00000000..8ce25d3b --- /dev/null +++ b/attachment_edit/static/description/index.html @@ -0,0 +1,409 @@ + + + + + + +Edit attachments + + + +
+

Edit attachments

+ + +

Beta License: AGPL-3 OCA/knowledge Translate me on Weblate Try me on Runbot

+

This module adds a button on the records’ attachment dropdown that allows to +open the attachment’s form in edit mode. This makes it convenient to edit the +attachment’s properties after upload.

+

On the attachment’s form, a field is added to move the attachment to another +record.

+

Table of contents

+ +
+

Usage

+

Click the pencil that appears next to the delete button when you hover over +an attachment in order to edit it.

+

To change the resource the attachment belongs to, edit the field Resource +reference.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Therp BV
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/knowledge project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/attachment_edit/static/src/js/attachment_edit.js b/attachment_edit/static/src/js/attachment_edit.js new file mode 100644 index 00000000..10002aac --- /dev/null +++ b/attachment_edit/static/src/js/attachment_edit.js @@ -0,0 +1,29 @@ +//-*- coding: utf-8 -*- +// (c) 2015-2018 Therp BV +// License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +odoo.define('attachment_edit', function(require) { + var Sidebar = require('web.Sidebar'); + + Sidebar.include({ + on_attachments_loaded: function() { + this._super.apply(this, arguments); + this.$('.o_sidebar_edit_attachment') + .click(this.proxy('on_attachment_edit')); + }, + on_attachment_edit: function(e) { + var $target = jQuery(e.currentTarget), + attachment_id = parseInt($target.attr('data-id'), 10); + e.preventDefault(); + e.stopPropagation(); + return this.do_action({ + type: 'ir_actions.act_window', + views: [[false, 'form']], + res_model: 'ir.attachment', + res_id: attachment_id, + flags: { + initial_mode: 'edit', + }, + }); + }, + }); +}); diff --git a/attachment_edit/static/src/xml/attachment_edit.xml b/attachment_edit/static/src/xml/attachment_edit.xml new file mode 100644 index 00000000..c664ca09 --- /dev/null +++ b/attachment_edit/static/src/xml/attachment_edit.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/attachment_edit/tests/__init__.py b/attachment_edit/tests/__init__.py new file mode 100644 index 00000000..7d99b068 --- /dev/null +++ b/attachment_edit/tests/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from . import test_attachment_edit diff --git a/attachment_edit/tests/test_attachment_edit.py b/attachment_edit/tests/test_attachment_edit.py new file mode 100644 index 00000000..60a9b95a --- /dev/null +++ b/attachment_edit/tests/test_attachment_edit.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Copyright 2018 Therp BV +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). +from odoo import SUPERUSER_ID +from odoo.tests.common import TransactionCase + + +class TestAttachmentEdit(TransactionCase): + def test_attachment_edit(self): + attachment = self.env['ir.attachment'].create({ + 'name': 'attachment', + }) + self.assertFalse(attachment.res_reference) + attachment.write({ + 'res_model': 'res.users', + 'res_id': SUPERUSER_ID, + }) + self.assertEqual( + attachment.res_reference, self.env.ref('base.user_root'), + ) + attachment.res_reference = None + self.assertFalse(attachment.res_model) + self.assertFalse(attachment.res_id) + attachment.res_reference = self.env.ref('base.user_root') + self.assertEqual(attachment.res_model, 'res.users') + self.assertEqual(attachment.res_id, SUPERUSER_ID) diff --git a/attachment_edit/views/ir_attachment.xml b/attachment_edit/views/ir_attachment.xml new file mode 100644 index 00000000..f7fbf214 --- /dev/null +++ b/attachment_edit/views/ir_attachment.xml @@ -0,0 +1,12 @@ + + + + ir.attachment + + + + + + + + diff --git a/attachment_edit/views/templates.xml b/attachment_edit/views/templates.xml new file mode 100644 index 00000000..f51deabe --- /dev/null +++ b/attachment_edit/views/templates.xml @@ -0,0 +1,10 @@ + + + + + +