[MIG] stock_inventory_chatter: Migration to 13.0

This commit is contained in:
Joan Sisquella
2020-01-07 09:40:41 +01:00
parent f14bdd5795
commit 90a165e8af
4 changed files with 12 additions and 24 deletions

View File

@@ -1,11 +1,10 @@
# Copyright 2017-19 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# Copyright 2017-19 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
{
"name": "Stock Inventory Chatter",
"version": "12.0.1.0.0",
"author": "Eficent, " "Odoo Community Association (OCA)",
"version": "13.0.1.0.0",
"author": "ForgeFlow," "Odoo Community Association (OCA)",
"development_status": "Mature",
"website": "https://github.com/OCA/stock-logistics-warehouse",
"category": "Warehouse",

View File

@@ -2,11 +2,6 @@
<odoo>
<!-- 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>

View File

@@ -1,26 +1,19 @@
# Copyright 2017 Eficent Business and IT Consulting Services S.L.
# (http://www.eficent.com)
# Copyright 2019 ForgeFlow S.L. (https://www.forgeflow.com)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import api, fields, models
from odoo import fields, models
class StockInventory(models.Model):
_name = "stock.inventory"
_inherit = ["stock.inventory", "mail.thread"]
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")
state = fields.Selection(tracking=True)
@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"
if "state" in init_values and self.state == "confirm":
return self.env.ref("stock_inventory_chatter.mt_inventory_confirmed")
elif "state" in init_values and self.state == "done":
return "stock_inventory_chatter.mt_inventory_done"
return self.env.ref("stock_inventory_chatter.mt_inventory_done")
return super(StockInventory, self)._track_subtype(init_values)

View File

@@ -1,3 +1,4 @@
* Miquel Raïch <miquel.raich@eficent.com>
* Miquel Raïch <miquel.raich@forgeflow.com>
* Xavier Jimenez <xavier.jimenez@qubiq.es>
* Lois Rilo <lois.rilo@eficent.com>
* Lois Rilo <lois.rilo@forgeflow.com>
* Joan Sisquella <joan.sisquella@forgeflow.com>