From 108f66d69e06cac229d334b2de6d2ca09b2d3c7a Mon Sep 17 00:00:00 2001 From: Richard Mathot Date: Wed, 23 Dec 2015 16:03:09 +0100 Subject: [PATCH] [IMP] delivery: HS codes for product HS Code is a standardized code used to describe products categories, and facilitate customs clearance. (https://en.wikipedia.org/wiki/Harmonized_System) Some international transporters require HS codes and use them. We allow users to store them on product.template's. --- addons/delivery/__openerp__.py | 1 + addons/delivery/models/product_template.py | 4 +++- addons/delivery/views/product_template_view.xml | 17 +++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 addons/delivery/views/product_template_view.xml diff --git a/addons/delivery/__openerp__.py b/addons/delivery/__openerp__.py index efa69dbfdf5..590a913b82b 100644 --- a/addons/delivery/__openerp__.py +++ b/addons/delivery/__openerp__.py @@ -18,6 +18,7 @@ invoices from picking, the system is able to add and compute the shipping line. 'security/ir.model.access.csv', 'views/delivery_view.xml', 'views/partner_view.xml', + 'views/product_template_view.xml', 'data/delivery_data.xml', 'views/report_shipping.xml', 'views/report_deliveryslip.xml' diff --git a/addons/delivery/models/product_template.py b/addons/delivery/models/product_template.py index 228dea5f149..d6b7a1341ad 100644 --- a/addons/delivery/models/product_template.py +++ b/addons/delivery/models/product_template.py @@ -1,12 +1,14 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from openerp import api, models +from openerp import api, models, fields class ProductTemplate(models.Model): _inherit = 'product.template' + hs_code = fields.Char(string="HS Code", help="Standardized code for international shipping and goods declaration", oldname="x_hs_code") + @api.multi def write(self, vals): res = super(ProductTemplate, self).write(vals) diff --git a/addons/delivery/views/product_template_view.xml b/addons/delivery/views/product_template_view.xml new file mode 100644 index 00000000000..19fe781cb96 --- /dev/null +++ b/addons/delivery/views/product_template_view.xml @@ -0,0 +1,17 @@ + + + + + product.template.form.hs_code + product.template + + +
+ + + + +
+
+ +