Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] calendar_attachment: Show attachments in modal window #105

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions calendar_attachment/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
**This file is going to be generated by oca-gen-addon-readme.**

*Manual changes will be overwritten.*

Please provide content in the ``readme`` directory:

* **DESCRIPTION.rst** (required)
* INSTALL.rst (optional)
* CONFIGURE.rst (optional)
* **USAGE.rst** (optional, highly recommended)
* DEVELOP.rst (optional)
* ROADMAP.rst (optional)
* HISTORY.rst (optional, recommended)
* **CONTRIBUTORS.rst** (optional, highly recommended)
* CREDITS.rst (optional)

Content of this README will also be drawn from the addon manifest,
from keys such as name, authors, maintainers, development_status,
and license.

A good, one sentence summary in the manifest is also highly recommended.


Automatic changelog generation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

`HISTORY.rst` can be auto generated using `towncrier <https://pypi.org/project/towncrier>`_.

Just put towncrier compatible changelog fragments into `readme/newsfragments`
and the changelog file will be automatically generated and updated when a new fragment is added.

Please refer to `towncrier` documentation to know more.

NOTE: the changelog will be automatically generated when using `/ocabot merge $option`.
If you need to run it manually, refer to `OCA/maintainer-tools README <https://github.com/OCA/maintainer-tools>`_.
1 change: 1 addition & 0 deletions calendar_attachment/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
12 changes: 12 additions & 0 deletions calendar_attachment/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "Calendar Attachments",
"version": "16.0.1.0.0",
"category": "Productivity/Calendar",
"license": "AGPL-3",
"author": "Onestein,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/calendar",
"depends": ["calendar"],
"data": [
"views/calendar_event_view.xml",
],
}
1 change: 1 addition & 0 deletions calendar_attachment/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import calendar_event
11 changes: 11 additions & 0 deletions calendar_attachment/models/calendar_event.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from odoo import fields, models


class CalendarEvent(models.Model):
_inherit = "calendar.event"

attachment_ids = fields.One2many(
comodel_name="ir.attachment",
inverse_name="res_id",
domain=[("res_model", "=", "calendar.event")],
)
1 change: 1 addition & 0 deletions calendar_attachment/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Dennis Sluijk <[email protected]> (https://onestein.nl)
5 changes: 5 additions & 0 deletions calendar_attachment/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
The calendar view opens the form in a modal window therefore the chatter is not visible.
This module adds a tab with the attachments on the event form, so the attachments are
also accessible from the calendar view.

![Calendar Event Modal Window](../static/description/screenshot.png)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions calendar_attachment/views/calendar_event_view.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="view_calendar_event_form" model="ir.ui.view">
<field name="model">calendar.event</field>
<field name="inherit_id" ref="calendar.view_calendar_event_form" />
<field name="arch" type="xml">
<xpath expr="//notebook" position="inside">
<page name="attachments" string="Attachments">
<field
name="attachment_ids"
widget="one2many"
mode="kanban"
context="{'default_res_model': 'calendar.event'}"
/>
</page>
</xpath>
</field>
</record>
</odoo>
1 change: 1 addition & 0 deletions setup/calendar_attachment/odoo/addons/calendar_attachment
6 changes: 6 additions & 0 deletions setup/calendar_attachment/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import setuptools

setuptools.setup(
setup_requires=['setuptools-odoo'],
odoo_addon=True,
)
Loading