diff --git a/stock_location_area_data/README.rst b/stock_location_area_data/README.rst new file mode 100644 index 000000000..18863fd53 --- /dev/null +++ b/stock_location_area_data/README.rst @@ -0,0 +1,47 @@ +Features +======== + +This module was written to add surface units of measure + +Screenshots +=========== + +... next step (after development) + +Installation +============ + +To install this module, you just need to select the module and insure yourself dependencies are available + +Configuration +============= + +No particular configuration to use this module + +Usage +===== + +* n/a + +Known issues / Roadmap +====================== + +* n/a + +Contributors +============ + +* Adriana Ierfino +* Bruno Joliveau +* Agathe Mollé + +Credits +======= + +* Module developed and tested with Odoo version 8.0 +* For questions, please contact our support services + +Maintainer +========== + +This module is maintained by Savoir-Faire Linux. diff --git a/stock_location_area_data/__init__.py b/stock_location_area_data/__init__.py new file mode 100644 index 000000000..40a96afc6 --- /dev/null +++ b/stock_location_area_data/__init__.py @@ -0,0 +1 @@ +# -*- coding: utf-8 -*- diff --git a/stock_location_area_data/__openerp__.py b/stock_location_area_data/__openerp__.py new file mode 100644 index 000000000..fec0ef1b3 --- /dev/null +++ b/stock_location_area_data/__openerp__.py @@ -0,0 +1,39 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Odoo, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 Location Area Data', + 'version': '0.1', + 'author': 'Savoir-faire Linux', + 'maintainer': 'Savoir-faire Linux', + 'website': 'http://www.savoirfairelinux.com', + 'license': 'AGPL-3', + 'category': 'Warehouse', + 'summary': "Add surface units of measure", + 'depends': [ + 'product', + ], + 'data': [ + 'data/stock_location_area_data.xml', + ], + 'installable': True, + 'application': False, +} diff --git a/stock_location_area_data/data/stock_location_area_data.xml b/stock_location_area_data/data/stock_location_area_data.xml new file mode 100644 index 000000000..46daa9edf --- /dev/null +++ b/stock_location_area_data/data/stock_location_area_data.xml @@ -0,0 +1,23 @@ + + + + + + Surface + + + + + + reference + + + + feet² + + smaller + 10.76391042 + + + + diff --git a/stock_location_area_data/i18n/fr.po b/stock_location_area_data/i18n/fr.po new file mode 100644 index 000000000..3676c5991 --- /dev/null +++ b/stock_location_area_data/i18n/fr.po @@ -0,0 +1,34 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_area_data +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-21 20:06+0000\n" +"PO-Revision-Date: 2015-04-21 16:08-0500\n" +"Last-Translator: Agathe Mollé \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: fr\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#. module: stock_location_area_data +#: model:product.uom.categ,name:stock_location_area_data.product_uom_categ_surface +msgid "Surface" +msgstr "Surface" + +#. module: stock_location_area_data +#: model:product.uom,name:stock_location_area_data.product_uom_feet2 +msgid "feet²" +msgstr "pied²" + +#. module: stock_location_area_data +#: model:product.uom,name:stock_location_area_data.product_uom_m2 +msgid "m²" +msgstr "m²" diff --git a/stock_location_area_data/i18n/stock_location_area_data.pot b/stock_location_area_data/i18n/stock_location_area_data.pot new file mode 100644 index 000000000..b552cc969 --- /dev/null +++ b/stock_location_area_data/i18n/stock_location_area_data.pot @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_area_data +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-21 20:06+0000\n" +"PO-Revision-Date: 2015-04-21 20:06+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_location_area_data +#: model:product.uom.categ,name:stock_location_area_data.product_uom_categ_surface +msgid "Surface" +msgstr "" + +#. module: stock_location_area_data +#: model:product.uom,name:stock_location_area_data.product_uom_feet2 +msgid "feet²" +msgstr "" + +#. module: stock_location_area_data +#: model:product.uom,name:stock_location_area_data.product_uom_m2 +msgid "m²" +msgstr "" diff --git a/stock_location_area_management/README.rst b/stock_location_area_management/README.rst new file mode 100644 index 000000000..82f8bbfa8 --- /dev/null +++ b/stock_location_area_management/README.rst @@ -0,0 +1,50 @@ +Features +======== + +This module was written to enter a location's area based on different units of measure +The information is dependant on the different locations entered + +Screenshots +=========== + +... next step (after development) + +Installation +============ + +To install this module, you just need to select the module and insure yourself dependencies are available + +Configuration +============= + +No particular configuration to use this module + +Usage +===== + +To use this module, you need to : + +- create a location and enter its area dimensions + +Known issues / Roadmap +====================== + +* n/a + +Contributors +============ + +* Adriana Ierfino +* Bruno Joliveau +* Agathe Mollé + +Credits +======= + +* Module developed and tested with Odoo version 8.0 +* For questions, please contact our support services + +Maintainer +========== + +This module is maintained by Savoir-Faire Linux. diff --git a/stock_location_area_management/__init__.py b/stock_location_area_management/__init__.py new file mode 100644 index 000000000..30e6bf2bc --- /dev/null +++ b/stock_location_area_management/__init__.py @@ -0,0 +1,5 @@ +# -*- coding: utf-8 -*- + +from . import ( + models, +) diff --git a/stock_location_area_management/__openerp__.py b/stock_location_area_management/__openerp__.py new file mode 100644 index 000000000..1f0d2f174 --- /dev/null +++ b/stock_location_area_management/__openerp__.py @@ -0,0 +1,41 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Odoo, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 Location Area Management', + 'version': '0.1', + 'author': 'Savoir-faire Linux', + 'maintainer': 'Savoir-faire Linux', + 'website': 'http://www.savoirfairelinux.com', + 'license': 'AGPL-3', + 'category': 'Warehouse', + 'summary': "Enter a location's area based on different units of measure", + 'depends': [ + 'stock', + 'stock_location_area_data' + ], + 'data': [ + 'views/res_company.xml', + 'views/stock_location.xml', + ], + 'installable': True, + 'application': False, +} diff --git a/stock_location_area_management/i18n/fr.po b/stock_location_area_management/i18n/fr.po new file mode 100644 index 000000000..6768d43dd --- /dev/null +++ b/stock_location_area_management/i18n/fr.po @@ -0,0 +1,81 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_area_management +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-21 20:09+0000\n" +"PO-Revision-Date: 2015-04-21 16:19-0500\n" +"Last-Translator: Agathe Mollé \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 1.5.4\n" +"Language: fr\n" +"X-Poedit-SourceCharset: UTF-8\n" + +#. module: stock_location_area_management +#: model:ir.model,name:stock_location_area_management.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +#: field:stock.location,area_dimension:0 +msgid "Dimension" +msgstr "Dimension" + +#. module: stock_location_area_management +#: field:stock.location,active_dimension:0 +msgid "Area Dimension" +msgstr "Dimension de la surface" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Group By" +msgstr "Grouper par" + +#. module: stock_location_area_management +#: model:ir.model,name:stock_location_area_management.model_stock_location +msgid "Inventory Locations" +msgstr "Emplacements d'inventaire" + +#. module: stock_location_area_management +#: view:res.company:stock_location_area_management.stock_location_area_management_res_company_form_view +msgid "Locations" +msgstr "Emplacements" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Owner" +msgstr "Propriétaire" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Partner" +msgstr "Partenaire" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_form_view +msgid "Surface" +msgstr "Surface" + +#. module: stock_location_area_management +#: help:stock.location,location_uom:0 +msgid "This field corresponds to the unit of measure of the location" +msgstr "Ce champ correspond à l'unité de mesure de l'emplacement" + +#. module: stock_location_area_management +#: help:res.company,locations_uom:0 +msgid "" +"This field corresponds to the unit of measure of the warehouse locations" +msgstr "Ce champ correspond à l'unité de mesure des emplacements de l'entrepôt" + +#. module: stock_location_area_management +#: field:res.company,locations_uom:0 field:stock.location,location_uom:0 +msgid "Unit of Measure" +msgstr "Unité de mesure" diff --git a/stock_location_area_management/i18n/stock_location_area_management.pot b/stock_location_area_management/i18n/stock_location_area_management.pot new file mode 100644 index 000000000..055adf49a --- /dev/null +++ b/stock_location_area_management/i18n/stock_location_area_management.pot @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * stock_location_area_management +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2015-04-21 20:09+0000\n" +"PO-Revision-Date: 2015-04-21 20:09+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: stock_location_area_management +#: model:ir.model,name:stock_location_area_management.model_res_company +msgid "Companies" +msgstr "" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +#: field:stock.location,area_dimension:0 +msgid "Dimension" +msgstr "" + +#. module: stock_location_area_management +#: field:stock.location,active_dimension:0 +msgid "Area Dimension" +msgstr "" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Group By" +msgstr "" + +#. module: stock_location_area_management +#: model:ir.model,name:stock_location_area_management.model_stock_location +msgid "Inventory Locations" +msgstr "" + +#. module: stock_location_area_management +#: view:res.company:stock_location_area_management.stock_location_area_management_res_company_form_view +msgid "Locations" +msgstr "" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Owner" +msgstr "" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_search +msgid "Partner" +msgstr "" + +#. module: stock_location_area_management +#: view:stock.location:stock_location_area_management.stock_location_area_management_stock_location_form_view +msgid "Surface" +msgstr "" + +#. module: stock_location_area_management +#: help:stock.location,location_uom:0 +msgid "This field corresponds to the unit of measure of the location" +msgstr "" + +#. module: stock_location_area_management +#: help:res.company,locations_uom:0 +msgid "This field corresponds to the unit of measure of the warehouse locations" +msgstr "" + +#. module: stock_location_area_management +#: field:res.company,locations_uom:0 +#: field:stock.location,location_uom:0 +msgid "Unit of Measure" +msgstr "" diff --git a/stock_location_area_management/models/__init__.py b/stock_location_area_management/models/__init__.py new file mode 100644 index 000000000..e79b12f10 --- /dev/null +++ b/stock_location_area_management/models/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- + +from . import ( + res_company, + stock_location, +) diff --git a/stock_location_area_management/models/res_company.py b/stock_location_area_management/models/res_company.py new file mode 100644 index 000000000..eaa9b8db6 --- /dev/null +++ b/stock_location_area_management/models/res_company.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Odoo, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 ResCompany(models.Model): + """ + Add the unit of measure of the warehouse locations. + Set by default to m². + """ + _inherit = 'res.company' + + def _get_default_locations_uom(self): + """ + Get the unit of measure m² (default) + :return: Unit of measure m² + """ + return self.env.ref('stock_location_area_data.product_uom_m2') + + locations_uom = fields.Many2one( + string='Unit of Measure', + comodel_name='product.uom', + help='This field corresponds to the unit of measure of the warehouse ' + 'locations', + domain="[('category_id.name','=','Surface')]", + default=lambda self: self._get_default_locations_uom(), + ) diff --git a/stock_location_area_management/models/stock_location.py b/stock_location_area_management/models/stock_location.py new file mode 100644 index 000000000..c04db7956 --- /dev/null +++ b/stock_location_area_management/models/stock_location.py @@ -0,0 +1,52 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Odoo, Open Source Management Solution +# This module copyright (C) 2015 Savoir-faire Linux +# (). +# +# 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 StockLocation(models.Model): + """ + Add the area dimension and the unit of measure of the warehouse locations. + By default, the unit of measure is the one of the user's company. + Add a boolean for the form view in order to display or not area + dimensions fields. + """ + _inherit = 'stock.location' + + area_dimension = fields.Integer('Dimension') + + active_dimension = fields.Boolean('Area Dimension') + + def _get_company_locations_uom(self): + """ + Get the unit of measure of the user's company locations + :return: Unit of measure of the user's company + """ + return self.env['res.users'].browse(self._uid).company_id.locations_uom + + location_uom = fields.Many2one( + string='Unit of Measure', + comodel_name='product.uom', + help='This field corresponds to the unit of measure of the location', + domain="[('category_id.name','=','Surface')]", + default=lambda self: self._get_company_locations_uom(), + ) diff --git a/stock_location_area_management/views/res_company.xml b/stock_location_area_management/views/res_company.xml new file mode 100644 index 000000000..45ba9bdab --- /dev/null +++ b/stock_location_area_management/views/res_company.xml @@ -0,0 +1,20 @@ + + + + + + stock.location.area.management.res.company.form + + res.company + + + + + + + + + + + diff --git a/stock_location_area_management/views/stock_location.xml b/stock_location_area_management/views/stock_location.xml new file mode 100644 index 000000000..5a6f22689 --- /dev/null +++ b/stock_location_area_management/views/stock_location.xml @@ -0,0 +1,57 @@ + + + + + + stock.location.area.management.stock.location.form + + stock.location + + + + + + + + + + + + + stock.location.area.management.stock.location.list + + stock.location + + + + + + + + + + stock.location.area.management.stock.location.search + stock.location + + + + + + + + + + + + + +