From 2a5f3c460ea8e2af0d93d3eefc8401198bf40d85 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 27 Jul 2015 09:23:35 +0200 Subject: [PATCH] Add module product_usability --- product_usability/__init__.py | 3 + product_usability/__openerp__.py | 47 +++++++++++ product_usability/product.py | 31 +++++++ product_usability/product_view.xml | 81 +++++++++++++++++++ .../security/product_security.xml | 19 +++++ 5 files changed, 181 insertions(+) create mode 100644 product_usability/__init__.py create mode 100644 product_usability/__openerp__.py create mode 100644 product_usability/product.py create mode 100644 product_usability/product_view.xml create mode 100644 product_usability/security/product_security.xml diff --git a/product_usability/__init__.py b/product_usability/__init__.py new file mode 100644 index 0000000..ca4e74d --- /dev/null +++ b/product_usability/__init__.py @@ -0,0 +1,3 @@ +# -*- encoding: utf-8 -*- + +from . import product diff --git a/product_usability/__openerp__.py b/product_usability/__openerp__.py new file mode 100644 index 0000000..27042a3 --- /dev/null +++ b/product_usability/__openerp__.py @@ -0,0 +1,47 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Product Usability module for Odoo +# Copyright (C) 2015 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': 'Product Usability', + 'version': '0.1', + 'category': 'Product', + 'license': 'AGPL-3', + 'summary': 'Small usability enhancements to the product module', + 'description': """ +Product Usability +================= + +The usability enhancements include: +* show the object product.price.history in the product template form view + +This module has been written by Alexis de Lattre from Akretion . + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['product'], + 'data': [ + 'security/product_security.xml', + 'product_view.xml', + ], + 'installable': True, +} diff --git a/product_usability/product.py b/product_usability/product.py new file mode 100644 index 0000000..f906970 --- /dev/null +++ b/product_usability/product.py @@ -0,0 +1,31 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Product Usability module for Odoo +# Copyright (C) 2015 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 import models, fields + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + price_history_ids = fields.One2many( + 'product.price.history', 'product_template_id', + string='Product Price History') diff --git a/product_usability/product_view.xml b/product_usability/product_view.xml new file mode 100644 index 0000000..b54e230 --- /dev/null +++ b/product_usability/product_view.xml @@ -0,0 +1,81 @@ + + + + + + + + + + product.price.history.form + product.price.history + +
+ + + + + + +
+
+
+ + + product.price.history.tree + product.price.history + + + + + + + + + + + + product.price.history.search + product.price.history + + + + + + + + + + + + + Product Price History + product.price.history + tree,form + {'product_price_history_main_view': True} + + + + + + + usability.product.template.form + product.template + + + + + + + + + + + +
+
diff --git a/product_usability/security/product_security.xml b/product_usability/security/product_security.xml new file mode 100644 index 0000000..fdbb27b --- /dev/null +++ b/product_usability/security/product_security.xml @@ -0,0 +1,19 @@ + + + + + + + + + Product price history multi-company + + ['|', ('company_id', '=', False), ('company_id', 'child_of', [user.company_id.id])] + + + +