diff --git a/stock_my_operations_filter/__init__.py b/stock_my_operations_filter/__init__.py new file mode 100644 index 0000000..b857415 --- /dev/null +++ b/stock_my_operations_filter/__init__.py @@ -0,0 +1,3 @@ +# -*- coding: utf-8 -*- + +from . import stock diff --git a/stock_my_operations_filter/__openerp__.py b/stock_my_operations_filter/__openerp__.py new file mode 100644 index 0000000..84dba4f --- /dev/null +++ b/stock_my_operations_filter/__openerp__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Stock My Operations Filter module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Stock My Operations Filter', + 'version': '8.0.0.1.0', + 'category': 'Inventory, Logistic, Storage', + 'license': 'AGPL-3', + 'summary': "Adds a filter 'My Operations'", + 'description': """ +When you have several warehouses, you have a lot of Stock Operations Types, and the menu *Warehouse > All Operations* becomes difficult to use because there are too many types of operations. This module solves this problem: it adds a filter 'My Operations' on stock.picking.type, which is active by default when you go to Warehouse > All Operations. This filter is configurable for each user. + +This module has been written by Alexis de Lattre from Akretion +. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['stock'], + 'data': [ + 'stock_view.xml', + 'users_view.xml', + ], + 'installable': True, +} diff --git a/stock_my_operations_filter/stock.py b/stock_my_operations_filter/stock.py new file mode 100644 index 0000000..ccb3138 --- /dev/null +++ b/stock_my_operations_filter/stock.py @@ -0,0 +1,40 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Stock My Operations Filter module for Odoo +# Copyright (C) 2015 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +from openerp import models, fields + + +class ResUsers(models.Model): + _inherit = 'res.users' + + default_picking_type_ids = fields.Many2many( + 'stock.picking.type', 'stock_picking_type_users_rel', + 'user_id', 'picking_type_id', string='Default Stock Operations') + + +class StockPickingType(models.Model): + _inherit = 'stock.picking.type' + + default_user_ids = fields.Many2many( + 'res.users', 'stock_picking_type_users_rel', + 'picking_type_id', 'user_id', string='Visible by Default by') diff --git a/stock_my_operations_filter/stock_view.xml b/stock_my_operations_filter/stock_view.xml new file mode 100644 index 0000000..bd75665 --- /dev/null +++ b/stock_my_operations_filter/stock_view.xml @@ -0,0 +1,41 @@ + + + + + + + + my.operations.stock.picking.type.form + stock.picking.type + + + + + + + + + + + + my.operations.stock.picking.type.search + stock.picking.type + + + + + + + + + + {'search_default_my_operations': True} + + + + diff --git a/stock_my_operations_filter/users_view.xml b/stock_my_operations_filter/users_view.xml new file mode 100644 index 0000000..24d83e5 --- /dev/null +++ b/stock_my_operations_filter/users_view.xml @@ -0,0 +1,23 @@ + + + + + + + + usability.default_warehouse.res.users.form + res.users + + + + + + + + + +