Merge pull request #46 from savoirfairelinux/partner_area_management

Add partner_area_data and partner_area_management
This commit is contained in:
Pedro M. Baeza
2015-06-02 11:57:28 +02:00
16 changed files with 612 additions and 0 deletions

View File

@@ -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 <adriana.ierfino@savoirfairelinux.com>
* Bruno Joliveau <bruno.joliveau@savoirfairelinux.com>
* Agathe Mollé <agathe.molle@savoirfairelinux.com>
Credits
=======
* Module developed and tested with Odoo version 8.0
* For questions, please contact our support services <support@savoirfairelinux.com>
Maintainer
==========
This module is maintained by Savoir-Faire Linux.

View File

@@ -0,0 +1 @@
# -*- coding: utf-8 -*-

View File

@@ -0,0 +1,39 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'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,
}

View File

@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="product_uom_categ_surface" model="product.uom.categ">
<field name="name">Surface</field>
</record>
<record id="product_uom_m2" model="product.uom">
<field name="name"></field>
<field name="category_id" eval="product_uom_categ_surface"/>
<field name="uom_type">reference</field>
</record>
<record id="product_uom_feet2" model="product.uom">
<field name="name">feet²</field>
<field name="category_id" eval="product_uom_categ_surface"/>
<field name="uom_type">smaller</field>
<field name="factor">10.76391042</field>
</record>
</data>
</openerp>

View File

@@ -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é <agathe.molle@savoirfairelinux.com>\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²"

View File

@@ -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 ""

View File

@@ -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 <adriana.ierfino@savoirfairelinux.com>
* Bruno Joliveau <bruno.joliveau@savoirfairelinux.com>
* Agathe Mollé <agathe.molle@savoirfairelinux.com>
Credits
=======
* Module developed and tested with Odoo version 8.0
* For questions, please contact our support services <support@savoirfairelinux.com>
Maintainer
==========
This module is maintained by Savoir-Faire Linux.

View File

@@ -0,0 +1,5 @@
# -*- coding: utf-8 -*-
from . import (
models,
)

View File

@@ -0,0 +1,41 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'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,
}

View File

@@ -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é <agathe.molle@savoirfairelinux.com>\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"

View File

@@ -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 ""

View File

@@ -0,0 +1,6 @@
# -*- coding: utf-8 -*-
from . import (
res_company,
stock_location,
)

View File

@@ -0,0 +1,47 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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(),
)

View File

@@ -0,0 +1,52 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Odoo, Open Source Management Solution
# This module copyright (C) 2015 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
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(),
)

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_location_area_management_res_company_form_view"
model="ir.ui.view">
<field name="name">stock.location.area.management.res.company.form</field>
<field name="inherit_id" ref="base.view_company_form"/>
<field name="model">res.company</field>
<field name="arch" type="xml">
<xpath expr="//group[@name='account_grp']" position="after">
<group name="locations_grp" string="Locations">
<field name="locations_uom"/>
</group>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="stock_location_area_management_stock_location_form_view"
model="ir.ui.view">
<field name="name">stock.location.area.management.stock.location.form</field>
<field name="inherit_id" ref="stock.view_location_form"/>
<field name="model">stock.location</field>
<field name="arch" type="xml">
<xpath expr="//group[@name='localization']" position="after">
<group name="surface_grp" string="Surface" col="4">
<field name="active_dimension"/>
<field name="area_dimension"
nolabel="1"
attrs="{'invisible': [('active_dimension', '=', False)]}"/>
<field name="location_uom"
nolabel="1"
attrs="{'invisible': [('active_dimension', '=', False)]}"/>
</group>
</xpath>
</field>
</record>
<record id="stock_location_area_management_stock_location_list_view"
model="ir.ui.view">
<field name="name">stock.location.area.management.stock.location.list</field>
<field name="inherit_id" ref="stock.view_location_tree2"/>
<field name="model">stock.location</field>
<field name="arch" type="xml">
<field name="usage" position="after">
<field name="area_dimension"/>
<field name="location_uom"/>
</field>
</field>
</record>
<record id="stock_location_area_management_stock_location_search"
model="ir.ui.view">
<field name="name">stock.location.area.management.stock.location.search</field>
<field name="model">stock.location</field>
<field name="inherit_id" ref="stock.view_location_search"/>
<field name="arch" type="xml">
<field name="location_id" position="after">
<field name="area_dimension" string="Dimension"/>
<field name="partner_id" string="Owner"/>
<group expand="0" string="Group By">
<filter string="Partner"
domain="[]"
context="{'group_by' : 'partner_id'}"/>
</group>
</field>
</field>
</record>
</data>
</openerp>