Skip to content

Commit

Permalink
Merge 87116ff into bdeb3fa
Browse files Browse the repository at this point in the history
  • Loading branch information
randall-vx authored Oct 24, 2020
2 parents bdeb3fa + 87116ff commit cd9c50b
Show file tree
Hide file tree
Showing 14 changed files with 226 additions and 0 deletions.
49 changes: 49 additions & 0 deletions account_chatter/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg
:alt: License: LGPL-3

Account Chatter
===============

This module allows to use chatter in CoA, Journals and Account Moves, to
create audit changes in every model.

To configure go to:

1. Settings > Users & Companies > Users

2. Select any user you can share account chatter notifications

3. Account & Finance > Check > Show account notifications

Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/Vauxoo/addons-vauxoo/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
<https://github.com/vauxoo/
addons-vauxoo/issues/new?body=module:%20
account_chatter%0Aversion:%20
12.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Contributors
------------

* Randall Castro <randall@vauxoo.com>

Maintainer
----------

.. image:: https://www.vauxoo.com/logo.png
:alt: Vauxoo
:target: https://vauxoo.com

This module is maintained by Vauxoo.

A latinamerican company that provides training, coaching,
development and implementation of enterprise management
systems and bases its entire operation strategy in the use
of Open Source Software and its main product is odoo.

To contribute to this module, please visit http://www.vauxoo.com.
4 changes: 4 additions & 0 deletions account_chatter/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import models
24 changes: 24 additions & 0 deletions account_chatter/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

{
"name": "Account Chatter",
"version": "12.0.1.0.0",
"author": "Vauxoo",
"category": "Accounting",
"website": "http://www.vauxoo.com",
"license": "LGPL-3",
"depends": [
"account",
],
"demo": [
],
"data": [
"security/account_chatter_security.xml",
"views/account_account_views.xml",
"views/account_journal_views.xml",
"views/account_move_views.xml",
],
"installable": True,
"auto_install": False,
}
6 changes: 6 additions & 0 deletions account_chatter/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from . import account_account
from . import account_journal
from . import account_move
41 changes: 41 additions & 0 deletions account_chatter/models/account_account.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import models, fields


class AccountAccount(models.Model):

_name = "account.account"
_inherit = ['account.account', 'mail.thread']

name = fields.Char(track_visibility=True)
currency_id = fields.Many2one(track_visibility=True)
code = fields.Char(track_visibility=True)
deprecated = fields.Boolean(track_visibility=True)
reconcile = fields.Boolean(track_visibility=True)
user_type_id = fields.Many2one(track_visibility=True)
tax_ids = fields.Many2many(track_visibility=True)
tag_ids = fields.Many2many(track_visibility=True)
group_id = fields.Many2one(track_visibility=True)
realizable_account = fields.Boolean(track_visibility=True)

def _message_track(self, tracked_fields, initial):
"""Shows old value ---> new value in every changed record."""
changes, tracking_value_ids = super()._message_track(tracked_fields, initial)
for display_name, display_info in tracked_fields.items():
if display_name not in ('tag_ids', 'tax_ids'):
continue
initial_value = initial[display_name]
new_value = self[display_name]
if new_value != initial_value and (new_value or initial_value):
tracking_sequence = getattr(self._fields[display_name], 'track_sequence', 100)
initial_value = ", ".join(initial_value.mapped('name')) if initial_value else False
new_value = ", ".join(new_value.mapped('name')) if new_value else False
display_info['type'] = 'char'
tracking = self.env['mail.tracking.value'].create_tracking_values(
initial_value, new_value, display_name, display_info, tracking_sequence)
if tracking:
tracking_value_ids.append([0, 0, tracking])
changes.add(display_name)
return changes, tracking_value_ids
19 changes: 19 additions & 0 deletions account_chatter/models/account_journal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import models, fields


class AccountJournal(models.Model):

_inherit = ["account.journal", "mail.thread"]
_name = "account.journal"

name = fields.Char(track_visibility=True)
code = fields.Char(track_visibility=True)
type = fields.Selection(track_visibility=True)
default_credit_account_id = fields.Many2one(track_visibility=True)
default_debit_account_id = fields.Many2one(track_visibility=True)
currency_id = fields.Many2one(track_visibility=True)
company_id = fields.Many2one(track_visibility=True)
active = fields.Boolean(track_visibility=True)
23 changes: 23 additions & 0 deletions account_chatter/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2020 Vauxoo
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl).

from odoo import fields, models


class AccountMove(models.Model):

_name = "account.move"
_inherit = ['account.move', 'mail.thread']

name = fields.Char(track_visibility=True)
ref = fields.Char(track_visibility=True)
date = fields.Date(track_visibility=True)
journal_id = fields.Many2one(track_visibility=True)
currency_id = fields.Many2one(track_visibility=True)
state = fields.Selection(track_visibility=True)
partner_id = fields.Many2one(track_visibility=True)
amount = fields.Monetary(track_visibility=True)
narration = fields.Text(track_visibility=True)
auto_reverse = fields.Boolean(track_visibility=True)
reverse_date = fields.Date(track_visibility=True)
reverse_entry_id = fields.Many2one(track_visibility=True)
10 changes: 10 additions & 0 deletions account_chatter/security/account_chatter_security.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>

<record id="group_show_account_chatter_notifications" model="res.groups">
<field name="name">Show account chatter notifications</field>
<field name="category_id" ref="base.module_category_accounting_and_finance"/>
<field name="comment">Show notifications of accounting entries, journal and accounts reflecting changes and observations.</field>
</record>

</odoo>
Binary file added account_chatter/static/src/description/img_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added account_chatter/static/src/description/img_03.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions account_chatter/views/account_account_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<odoo>
<record id="view_account_form_inherit" model="ir.ui.view">
<field name="name">account.account.form.inherit</field>
<field name="model">account.account</field>
<field name="inherit_id" ref="account.view_account_form"/>
<field name="groups_id" eval="[(4, ref('account_chatter.group_show_account_chatter_notifications'))]"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids"
widget="mail_followers" groups="base.group_user"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</xpath>
</field>
</record>
</odoo>
17 changes: 17 additions & 0 deletions account_chatter/views/account_journal_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<odoo>
<record id="view_account_journal_form_inherit" model="ir.ui.view">
<field name="name">account.journal.form.inherit</field>
<field name="model">account.journal</field>
<field name="inherit_id" ref="account.view_account_journal_form"/>
<field name="groups_id" eval="[(4, ref('account_chatter.group_show_account_chatter_notifications'))]"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids"
widget="mail_followers" groups="base.group_user"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</xpath>
</field>
</record>
</odoo>
16 changes: 16 additions & 0 deletions account_chatter/views/account_move_views.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<odoo>
<record id="view_move_form" model="ir.ui.view">
<field name="name">account.move.form.inherit</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="groups_id" eval="[(4, ref('account_chatter.group_show_account_chatter_notifications'))]"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="after">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers"/>
<field name="message_ids" widget="mail_thread"/>
</div>
</xpath>
</field>
</record>
</odoo>

0 comments on commit cd9c50b

Please sign in to comment.