[9.0][ADD] stock_inventory_chatter

This commit is contained in:
mreficent
2017-06-30 18:24:56 +02:00
committed by Joan Sisquella
parent fcb0c7db81
commit 10f8497a8f
8 changed files with 157 additions and 0 deletions

View File

@@ -0,0 +1,52 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
=======================
Stock Inventory Chatter
=======================
This module adds the capability to log the changes being done in Inventory Adjustments.
Usage
=====
.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/153/9.0
Bug Tracker
===========
Bugs are tracked on `GitHub Issues
<https://github.com/OCA/stock-logistics-warehouse/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smash it by providing detailed and welcomed feedback.
Credits
=======
Images
------
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.
Contributors
------------
* Miquel Raïch <miquel.raich@eficent.com>
Maintainer
----------
.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org
This module is maintained by the OCA.
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.
To contribute to this module, please visit https://odoo-community.org.

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import models

View File

@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
'name': 'Stock Inventory Chatter',
'version': '9.0.1.0.0',
'author': "Eficent, "
"Odoo Community Association (OCA)",
"website": "https://github.com/OCA/stock-logistics-warehouse",
'category': 'Warehouse',
'summary': "Log changes being done in Inventory Adjustments",
'depends': ['stock'],
"data": [
'data/stock_data.xml',
'views/stock_inventory_view.xml',
],
'license': 'AGPL-3',
'installable': True,
'application': False,
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Stock-related subtypes for messaging / Chatter -->
<record id="mt_inventory_canceled" model="mail.message.subtype">
<field name="name">Inventory Canceled</field>
<field name="res_model">stock.inventory</field>
<field name="default" eval="False"/>
</record>
<record id="mt_inventory_confirmed" model="mail.message.subtype">
<field name="name">Inventory Confirmed</field>
<field name="res_model">stock.inventory</field>
<field name="default" eval="False"/>
</record>
<record id="mt_inventory_done" model="mail.message.subtype">
<field name="name">Inventory Done</field>
<field name="res_model">stock.inventory</field>
<field name="default" eval="False"/>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from . import stock

View File

@@ -0,0 +1,27 @@
# -*- coding: utf-8 -*-
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from openerp import api, fields, models
class StockInventory(models.Model):
_name = 'stock.inventory'
_inherit = ['stock.inventory', 'mail.thread', 'ir.needaction_mixin']
partner_id = fields.Many2one(track_visibility='always')
state = fields.Selection(track_visibility='onchange')
location_id = fields.Many2one(track_visibility='always')
filter = fields.Selection(track_visibility='onchange')
@api.multi
def _track_subtype(self, init_values):
self.ensure_one()
if 'state' in init_values and self.state == 'cancel':
return 'stock_inventory_chatter.mt_inventory_canceled'
elif 'state' in init_values and self.state == 'confirm':
return 'stock_inventory_chatter.mt_inventory_confirmed'
elif 'state' in init_values and self.state == 'done':
return 'stock_inventory_chatter.mt_inventory_done'
return super(StockInventory, self)._track_subtype(init_values)

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright 2017 Eficent Business and IT Consulting Services S.L.
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<record id="view_inventory_form" model="ir.ui.view">
<field name="name">Inventory form view - add chatter </field>
<field name="model">stock.inventory</field>
<field name="inherit_id" ref="stock.view_inventory_form"/>
<field name="arch" type="xml">
<sheet position="after">
<div class="oe_chatter">
<field name="message_follower_ids" widget="mail_followers" />
<field name="message_ids" widget="mail_thread" />
</div>
</sheet>
</field>
</record>
</data>
</openerp>