Browse Source

[MIG] mail_activity_board: Migration to 12.0

pull/338/head
mreficent 6 years ago
parent
commit
70b5a76101
  1. 14
      mail_activity_board/README.rst
  2. 2
      mail_activity_board/__manifest__.py
  3. 5
      mail_activity_board/models/mail_activity.py
  4. 4
      mail_activity_board/models/mail_activity_mixin.py
  5. 4
      mail_activity_board/readme/CONTRIBUTORS.rst
  6. BIN
      mail_activity_board/static/description/icon.png
  7. 6
      mail_activity_board/static/description/index.html
  8. 10
      mail_activity_board/views/mail_activity_view.xml
  9. 2
      mail_activity_board/views/templates.xml

14
mail_activity_board/README.rst

@ -14,13 +14,13 @@ Activities board
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3 :alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github
:target: https://github.com/OCA/social/tree/11.0/mail_activity_board
:target: https://github.com/OCA/social/tree/12.0/mail_activity_board
:alt: OCA/social :alt: OCA/social
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/social-11-0/social-11-0-mail_activity_board
:target: https://translation.odoo-community.org/projects/social-12-0/social-12-0-mail_activity_board
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/205/11.0
:target: https://runbot.odoo-community.org/runbot/205/12.0
:alt: Try me on Runbot :alt: Try me on Runbot
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -52,7 +52,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/social/issues>`_.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_activity_board%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
`feedback <https://github.com/OCA/social/issues/new?body=module:%20mail_activity_board%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -72,6 +72,10 @@ Contributors
* David Juaneda * David Juaneda
* `Eficent <https://www.eficent.com>`_:
* Miquel Raïch (miquel.raich@eficent.com)
Maintainers Maintainers
~~~~~~~~~~~ ~~~~~~~~~~~
@ -85,6 +89,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/11.0/mail_activity_board>`_ project on GitHub.
This module is part of the `OCA/social <https://github.com/OCA/social/tree/12.0/mail_activity_board>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

2
mail_activity_board/__manifest__.py

@ -3,7 +3,7 @@
{ {
'name': 'Activities board', 'name': 'Activities board',
'summary': 'Add Activity Boards', 'summary': 'Add Activity Boards',
'version': '11.0.1.0.1',
'version': '12.0.1.0.0',
'development_status': 'Beta', 'development_status': 'Beta',
'category': 'Social Network', 'category': 'Social Network',
'website': 'https://github.com/OCA/social', 'website': 'https://github.com/OCA/social',

5
mail_activity_board/models/mail_activity.py

@ -1,4 +1,5 @@
# Copyright 2018 David Juaneda - <djuaneda@sdi.es> # Copyright 2018 David Juaneda - <djuaneda@sdi.es>
# Copyright 2018 Eficent Business and IT Consulting Services, S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import api, models, fields, SUPERUSER_ID from odoo import api, models, fields, SUPERUSER_ID
@ -54,10 +55,10 @@ class MailActivity(models.Model):
@api.model @api.model
def _find_allowed_doc_ids(self, model_ids): def _find_allowed_doc_ids(self, model_ids):
IrModelAccess = self.env['ir.model.access']
ir_model_access_model = self.env['ir.model.access']
allowed_ids = set() allowed_ids = set()
for doc_model, doc_dict in model_ids.items(): for doc_model, doc_dict in model_ids.items():
if not IrModelAccess.check(doc_model, 'read', False):
if not ir_model_access_model.check(doc_model, 'read', False):
continue continue
allowed_ids |= self._find_allowed_model_wise(doc_model, doc_dict) allowed_ids |= self._find_allowed_model_wise(doc_model, doc_dict)
return allowed_ids return allowed_ids

4
mail_activity_board/models/mail_activity_mixin.py

@ -20,7 +20,7 @@ class MailActivityMixin(models.AbstractModel):
:return: action. :return: action.
""" """
id = kwargs.get("id")
_id = kwargs.get("id")
action = self.env['mail.activity'].action_activities_board() action = self.env['mail.activity'].action_activities_board()
views = [] views = []
for v in action['views']: for v in action['views']:
@ -28,5 +28,5 @@ class MailActivityMixin(models.AbstractModel):
v = (v[0], 'list') v = (v[0], 'list')
views.append(v) views.append(v)
action['views'] = views action['views'] = views
action['domain'] = [('res_id', '=', id)]
action['domain'] = [('res_id', '=', _id)]
return action return action

4
mail_activity_board/readme/CONTRIBUTORS.rst

@ -1,3 +1,7 @@
* `SDI <https://www.sdi.es>`_: * `SDI <https://www.sdi.es>`_:
* David Juaneda * David Juaneda
* `Eficent <https://www.eficent.com>`_:
* Miquel Raïch (miquel.raich@eficent.com)

BIN
mail_activity_board/static/description/icon.png

After

Width: 128  |  Height: 128  |  Size: 9.2 KiB

6
mail_activity_board/static/description/index.html

@ -367,7 +367,7 @@ ul.auto-toc {
!! This file is generated by oca-gen-addon-readme !! !! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !! !! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/social/tree/11.0/mail_activity_board"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/social-11-0/social-11-0-mail_activity_board"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/205/11.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/social/tree/12.0/mail_activity_board"><img alt="OCA/social" src="https://img.shields.io/badge/github-OCA%2Fsocial-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/social-12-0/social-12-0-mail_activity_board"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/205/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module adds an activity board with form, tree, kanban, calendar, pivot, graph and search views.</p> <p>This module adds an activity board with form, tree, kanban, calendar, pivot, graph and search views.</p>
<p><strong>Table of contents</strong></p> <p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents"> <div class="contents local topic" id="contents">
@ -398,7 +398,7 @@ which shows the activities related to the opportunity.</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/social/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. 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 If you spotted it first, help us smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_activity_board%0Aversion:%2011.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<a class="reference external" href="https://github.com/OCA/social/issues/new?body=module:%20mail_activity_board%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -426,7 +426,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
<p>OCA, or the Odoo Community Association, is a nonprofit organization whose <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/11.0/mail_activity_board">OCA/social</a> project on GitHub.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/social/tree/12.0/mail_activity_board">OCA/social</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

10
mail_activity_board/views/mail_activity_view.xml

@ -4,7 +4,6 @@
VIEWS VIEWS
--> -->
<!-- FORM VIEW --> <!-- FORM VIEW -->
<record id="mail_activity_view_form_board" model="ir.ui.view"> <record id="mail_activity_view_form_board" model="ir.ui.view">
<field name="name">mail.activity.boards.view.form</field> <field name="name">mail.activity.boards.view.form</field>
@ -59,7 +58,7 @@
<field name="inherit_id" ref="mail.mail_activity_view_tree"/> <field name="inherit_id" ref="mail.mail_activity_view_tree"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//tree" position="attributes"> <xpath expr="//tree" position="attributes">
<attribute name="default_order"></attribute>
<attribute name="default_order"/>
<attribute name="decoration-danger">(date_deadline &lt; current_date)</attribute> <attribute name="decoration-danger">(date_deadline &lt; current_date)</attribute>
<attribute name="decoration-warning">(date_deadline == current_date)</attribute> <attribute name="decoration-warning">(date_deadline == current_date)</attribute>
<attribute name="decoration-success">(date_deadline &gt; current_date)</attribute> <attribute name="decoration-success">(date_deadline &gt; current_date)</attribute>
@ -131,7 +130,8 @@
</div> </div>
<div class="oe_kanban_bottom_right"> <div class="oe_kanban_bottom_right">
<img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)"
t-att-title="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
t-att-title="record.user_id.value"
t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div> </div>
</div> </div>
</div> </div>
@ -167,8 +167,8 @@
</xpath> </xpath>
<xpath expr='//search/group' position='inside'> <xpath expr='//search/group' position='inside'>
<filter string="User" context="{'group_by':'user_id'}"/>
<filter string="Origin" context="{'group_by': 'res_model_id'}"/>
<filter string="User" name='assigned_user' context="{'group_by':'user_id'}"/>
<filter string="Origin" name='origin' context="{'group_by': 'res_model_id'}"/>
</xpath> </xpath>
</field> </field>

2
mail_activity_board/views/templates.xml

@ -2,7 +2,7 @@
<odoo> <odoo>
<template id="assets_backend" name="mail_activity_board assets" inherit_id="web.assets_backend"> <template id="assets_backend" name="mail_activity_board assets" inherit_id="web.assets_backend">
<xpath expr="." position="inside"> <xpath expr="." position="inside">
<script type="text/javascript" src="/mail_activity_board/static/src/js/override_chatter.js"></script>
<script type="text/javascript" src="/mail_activity_board/static/src/js/override_chatter.js"/>
</xpath> </xpath>
</template> </template>
</odoo> </odoo>
Loading…
Cancel
Save