Add module stock_tracking_ul

This commit is contained in:
Alexis de Lattre
2014-11-15 00:06:14 +01:00
parent 560beb826b
commit bdf4a7e15d
6 changed files with 221 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Tracking UL module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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 . import product
from . import stock

View File

@@ -0,0 +1,46 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Tracking UL module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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 Tracking UL',
'version': '0.1',
'category': 'Inventory, Logistic, Storage',
'license': 'AGPL-3',
'summary': 'Link stock.tracking to product.ul',
'description': """
This module adds a link from stock.tracking to product.ul. It also adds
the properties of stock.ul that are present in OpenERP 8 and not present
in OpenERP 7 (weight, width, length, height). This will be required for
UPS webservices, which need to know the size of each package.
So this module should NOT be used on v8, only on v7.
This module has been written by Alexis de Lattre
from Akretion <alexis.delattre@akretion.com>.
""",
'author': 'Akretion',
'website': 'http://www.akretion.com',
'depends': ['delivery'],
'data': ['stock_view.xml', 'product_view.xml'],
'installable': True,
}

View File

@@ -0,0 +1,37 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Tracking UL module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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.osv import orm, fields
class product_ul(orm.Model):
_inherit = 'product.ul'
_columns = {
# These fields are backported from Odoo v8
# In v8, they don't say what is the unit of measure !!!
# so I suppose it is cm and kg
'height': fields.float('Height (cm)', help='The height of the package in cm'),
'width': fields.float('Width (cm)', help='The width of the package in cm'),
'length': fields.float('Length (cm)', help='The length of the package in cm'),
'weight': fields.float('Empty Package Weight (kg)'),
}

View File

@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="product_ul_form_view" model="ir.ui.view">
<field name="name">extend.product.ul.form</field>
<field name="model">product.ul</field>
<field name="inherit_id" ref="product.product_ul_form_view" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="weight"/>
<field name="length"/>
<field name="width"/>
<field name="height"/>
</field>
</field>
</record>
<record id="product_ul_tree" model="ir.ui.view">
<field name="name">extend.product.ul.tree</field>
<field name="model">product.ul</field>
<field name="inherit_id" ref="product.product_ul_tree" />
<field name="arch" type="xml">
<field name="type" position="after">
<field name="weight"/>
<field name="length"/>
<field name="width"/>
<field name="height"/>
</field>
</field>
</record>
</data>
</openerp>

View File

@@ -0,0 +1,33 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Stock Tracking UL module for OpenERP
# Copyright (C) 2014 Akretion (http://www.akretion.com)
# @author Alexis de Lattre <alexis.delattre@akretion.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.osv import orm, fields
class stock_tracking(orm.Model):
_inherit = 'stock.tracking'
_columns = {
'ul_id': fields.many2one('product.ul', 'Shipping Unit'),
# poids mesuré
'measured_weight': fields.float('Measured Total Weight (kg)'),
}

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (C) 2014 Akretion (http://www.akretion.com/)
@author Alexis de Lattre <alexis.delattre@akretion.com>
The licence is in the file __openerp__.py
-->
<openerp>
<data>
<record id="view_tracking_form" model="ir.ui.view">
<field name="name">add.ul_id.stock.tracking.form</field>
<field name="model">stock.tracking</field>
<field name="inherit_id" ref="stock.view_tracking_form" />
<field name="arch" type="xml">
<field name="name" position="after">
<field name="ul_id"/>
<field name="measured_weight"/>
</field>
</field>
</record>
<record id="view_tracking_tree" model="ir.ui.view">
<field name="name">add.ul_id.stock.tracking.tree</field>
<field name="model">stock.tracking</field>
<field name="inherit_id" ref="stock.view_tracking_tree" />
<field name="arch" type="xml">
<field name="serial" position="after">
<field name="ul_id"/>
</field>
</field>
</record>
</data>
</openerp>