diff --git a/stock_tracking_ul/__init__.py b/stock_tracking_ul/__init__.py new file mode 100644 index 0000000..1f5552d --- /dev/null +++ b/stock_tracking_ul/__init__.py @@ -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 +# +# 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 . import product +from . import stock diff --git a/stock_tracking_ul/__openerp__.py b/stock_tracking_ul/__openerp__.py new file mode 100644 index 0000000..db048e2 --- /dev/null +++ b/stock_tracking_ul/__openerp__.py @@ -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 +# +# 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 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 . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['delivery'], + 'data': ['stock_view.xml', 'product_view.xml'], + 'installable': True, +} diff --git a/stock_tracking_ul/product.py b/stock_tracking_ul/product.py new file mode 100644 index 0000000..4e4f607 --- /dev/null +++ b/stock_tracking_ul/product.py @@ -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 +# +# 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.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)'), + } diff --git a/stock_tracking_ul/product_view.xml b/stock_tracking_ul/product_view.xml new file mode 100644 index 0000000..616f789 --- /dev/null +++ b/stock_tracking_ul/product_view.xml @@ -0,0 +1,43 @@ + + + + + + + + + + extend.product.ul.form + product.ul + + + + + + + + + + + + + extend.product.ul.tree + product.ul + + + + + + + + + + + + + + diff --git a/stock_tracking_ul/stock.py b/stock_tracking_ul/stock.py new file mode 100644 index 0000000..fbe9657 --- /dev/null +++ b/stock_tracking_ul/stock.py @@ -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 +# +# 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.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)'), + } diff --git a/stock_tracking_ul/stock_view.xml b/stock_tracking_ul/stock_view.xml new file mode 100644 index 0000000..2a419d3 --- /dev/null +++ b/stock_tracking_ul/stock_view.xml @@ -0,0 +1,38 @@ + + + + + + + + + + add.ul_id.stock.tracking.form + stock.tracking + + + + + + + + + + + add.ul_id.stock.tracking.tree + stock.tracking + + + + + + + + + + +