From 76dcd9e71c609ea16050e2321bf71068baef2913 Mon Sep 17 00:00:00 2001 From: Seraphine Lantible Date: Sun, 14 Dec 2014 09:51:56 +0800 Subject: [PATCH] portation of product_brand to 8.0 --- product_brand/README.rst | 64 +++++++++++++++ product_brand/__init__.py | 31 +++++++ product_brand/__openerp__.py | 46 +++++++++++ product_brand/i18n/fr.po | 82 +++++++++++++++++++ product_brand/i18n/fr_FR.po | 82 +++++++++++++++++++ product_brand/i18n/product_brand.pot | 82 +++++++++++++++++++ product_brand/product_brand.py | 55 +++++++++++++ product_brand/product_brand_view.xml | 94 ++++++++++++++++++++++ product_brand/security/ir.model.access.csv | 2 + 9 files changed, 538 insertions(+) create mode 100644 product_brand/README.rst create mode 100644 product_brand/__init__.py create mode 100644 product_brand/__openerp__.py create mode 100644 product_brand/i18n/fr.po create mode 100644 product_brand/i18n/fr_FR.po create mode 100644 product_brand/i18n/product_brand.pot create mode 100644 product_brand/product_brand.py create mode 100644 product_brand/product_brand_view.xml create mode 100644 product_brand/security/ir.model.access.csv diff --git a/product_brand/README.rst b/product_brand/README.rst new file mode 100644 index 000000000..4be5897ee --- /dev/null +++ b/product_brand/README.rst @@ -0,0 +1,64 @@ +Product Brand Manage [product_brand] +=========== + +This module allows odoo users to easily manage product brands. You can +define brands, attach a logo and a description to them. +It also allows to attach a partner to a brand. + +Installation +============ + +To install this module, you need to: + + * git clone https://github.com/OCA/product_attribute --branch 8.0 + * make it available to odoo by adding its location to the addons_path in + /etc/odoo-server.conf + +Configuration +============= + +To configure this module, you need to: + + * no configuration required + +Usage +===== + +To use this module, you need to: + + * go to ... + +For further information, please visit: + + * https://www.odoo.com/forum/help-1 + +Known issues / Roadmap +====================== + +* A view to list or sort products by brand +* add a field with brands assiciated to a Customer or Supplier on + the Customers/Suppliers Form View + +Credits +======= + +Contributors +------------ + +Mathieu Lemercier +Franck Bret +Seraphine Lantible +Gunnar Wagner + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/product_brand/__init__.py b/product_brand/__init__.py new file mode 100644 index 000000000..a58001c86 --- /dev/null +++ b/product_brand/__init__.py @@ -0,0 +1,31 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # # +# product_brand for Odoo # # +# Copyright (C) 2009 NetAndCo (). # # +# Copyright (C) 2011 Akretion Benoît Guillot # # +# Copyright (C) 2014 prisnet.ch Seraphine Lantible # # +# Contributors # +# Mathieu Lemercier, mathieu@netandco.net, # # +# Franck Bret, franck@netandco.net # # +# Seraphine Lantible, s.lantible@gmail.com, http://www.prisnet.ch # +# # # +# 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 . # # +# # # +############################################################################### +############################################################################### +# Product Brand is an Openobject module wich enable Brand management # +# for products # +############################################################################### +from . import product_brand diff --git a/product_brand/__openerp__.py b/product_brand/__openerp__.py new file mode 100644 index 000000000..11e809468 --- /dev/null +++ b/product_brand/__openerp__.py @@ -0,0 +1,46 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # # +# product_brand for Odoo # # +# Copyright (C) 2009 NetAndCo (). # # +# Copyright (C) 2011 Akretion Benoît Guillot # # +# Copyright (C) 2014 prisnet.ch Seraphine Lantible # # +# Contributors # +# Mathieu Lemercier, mathieu@netandco.net, # # +# Franck Bret, franck@netandco.net # # +# Seraphine Lantible, s.lantible@gmail.com, http://www.prisnet.ch # +# # # +# 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 . # # +# # # +############################################################################### +############################################################################### +# Product Brand is an Openobject module wich enable Brand management for # +# products # +############################################################################### +{ + 'name': 'Product Brand Manager', + 'version': '0.1', + 'category': 'Product', + 'summary': ' brand', + 'author': "NetAndCo, Akretion," + "Prisnet Telecommunications SA," + "Odoo Community Association (OCA)", + 'license': 'AGPL-3', + 'depends': ['product'], + 'data': [ + 'product_brand_view.xml', + 'security/ir.model.access.csv' + ], + 'installable': True, +} diff --git a/product_brand/i18n/fr.po b/product_brand/i18n/fr.po new file mode 100644 index 000000000..e5b244d75 --- /dev/null +++ b/product_brand/i18n/fr.po @@ -0,0 +1,82 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_brand +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-14 12:55+0000\n" +"PO-Revision-Date: 2014-04-08 17:33+0000\n" +"Last-Translator: Guewen Baconnier @ Camptocamp \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-17 07:08+0000\n" +"X-Generator: Launchpad (build 17007)\n" + +#. module: product_brand +#: model:ir.model,name:product_brand.model_product_brand +#: view:product.brand:0 +msgid "product.brand" +msgstr "product.brand" + +#. module: product_brand +#: model:ir.model,name:product_brand.model_product_template +msgid "Product Template" +msgstr "Modèle de produit" + +#. module: product_brand +#: model:ir.ui.menu,name:product_brand.menu_product_brand +msgid "Brand management" +msgstr "Gestion des marques" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,description:0 +msgid "Description" +msgstr "Description" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,name:0 +msgid "Brand Name" +msgstr "Marque" + +#. module: product_brand +#: view:product.brand:0 +msgid "Product Brand" +msgstr "Marque d'article" + +#. module: product_brand +#: field:product.brand,logo:0 +msgid "Logo File" +msgstr "Logo" + +#. module: product_brand +#: model:ir.actions.act_window,name:product_brand.action_product_brand +#: view:product.product:0 +#: field:product.template,product_brand_id:0 +msgid "Brand" +msgstr "Marque" + +#. module: product_brand +#: help:product.brand,partner_id:0 +msgid "Select a partner for this brand if it exists." +msgstr "Sélectionnez un partenaire pour cette marque." + +#. module: product_brand +#: view:product.product:0 +msgid "Group by..." +msgstr "Regrouper par..." + +#. module: product_brand +#: field:product.brand,partner_id:0 +msgid "partner" +msgstr "Partenaire" + +#. module: product_brand +#: help:product.template,product_brand_id:0 +msgid "Select a brand for this product." +msgstr "Sélectionnez une marque pour ce produit." diff --git a/product_brand/i18n/fr_FR.po b/product_brand/i18n/fr_FR.po new file mode 100644 index 000000000..9f9d41af9 --- /dev/null +++ b/product_brand/i18n/fr_FR.po @@ -0,0 +1,82 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_brand +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 5.0.7\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2014-03-14 12:55+0000\n" +"PO-Revision-Date: 2014-03-11 12:42+0000\n" +"Last-Translator: Graeme Gellatly \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Launchpad-Export-Date: 2014-05-17 07:08+0000\n" +"X-Generator: Launchpad (build 17007)\n" + +#. module: product_brand +#: model:ir.model,name:product_brand.model_product_brand +#: view:product.brand:0 +msgid "product.brand" +msgstr "" + +#. module: product_brand +#: model:ir.model,name:product_brand.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_brand +#: model:ir.ui.menu,name:product_brand.menu_product_brand +msgid "Brand management" +msgstr "Gestion des marques" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,description:0 +msgid "Description" +msgstr "Description" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,name:0 +msgid "Brand Name" +msgstr "Marque" + +#. module: product_brand +#: view:product.brand:0 +msgid "Product Brand" +msgstr "" + +#. module: product_brand +#: field:product.brand,logo:0 +msgid "Logo File" +msgstr "" + +#. module: product_brand +#: model:ir.actions.act_window,name:product_brand.action_product_brand +#: view:product.product:0 +#: field:product.template,product_brand_id:0 +msgid "Brand" +msgstr "Marque" + +#. module: product_brand +#: help:product.brand,partner_id:0 +msgid "Select a partner for this brand if it exists." +msgstr "" + +#. module: product_brand +#: view:product.product:0 +msgid "Group by..." +msgstr "" + +#. module: product_brand +#: field:product.brand,partner_id:0 +msgid "partner" +msgstr "Partenaire" + +#. module: product_brand +#: help:product.template,product_brand_id:0 +msgid "Select a brand for this product." +msgstr "" diff --git a/product_brand/i18n/product_brand.pot b/product_brand/i18n/product_brand.pot new file mode 100644 index 000000000..9dddf3599 --- /dev/null +++ b/product_brand/i18n/product_brand.pot @@ -0,0 +1,82 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * product_brand +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-03-14 12:55+0000\n" +"PO-Revision-Date: 2014-03-14 12:55+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: product_brand +#: model:ir.model,name:product_brand.model_product_brand +#: view:product.brand:0 +msgid "product.brand" +msgstr "" + +#. module: product_brand +#: model:ir.model,name:product_brand.model_product_template +msgid "Product Template" +msgstr "" + +#. module: product_brand +#: model:ir.ui.menu,name:product_brand.menu_product_brand +msgid "Brand management" +msgstr "" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,description:0 +msgid "Description" +msgstr "" + +#. module: product_brand +#: view:product.brand:0 +#: field:product.brand,name:0 +msgid "Brand Name" +msgstr "" + +#. module: product_brand +#: view:product.brand:0 +msgid "Product Brand" +msgstr "" + +#. module: product_brand +#: field:product.brand,logo:0 +msgid "Logo File" +msgstr "" + +#. module: product_brand +#: model:ir.actions.act_window,name:product_brand.action_product_brand +#: view:product.product:0 +#: field:product.template,product_brand_id:0 +msgid "Brand" +msgstr "" + +#. module: product_brand +#: help:product.brand,partner_id:0 +msgid "Select a partner for this brand if it exists." +msgstr "" + +#. module: product_brand +#: view:product.product:0 +msgid "Group by..." +msgstr "" + +#. module: product_brand +#: field:product.brand,partner_id:0 +msgid "partner" +msgstr "" + +#. module: product_brand +#: help:product.template,product_brand_id:0 +msgid "Select a brand for this product." +msgstr "" + diff --git a/product_brand/product_brand.py b/product_brand/product_brand.py new file mode 100644 index 000000000..18b83b347 --- /dev/null +++ b/product_brand/product_brand.py @@ -0,0 +1,55 @@ +# -*- encoding: utf-8 -*- +############################################################################### +# # # +# product_brand for Odoo # # +# Copyright (C) 2009 NetAndCo (). # # +# Copyright (C) 2011 Akretion Benoît Guillot # # +# Copyright (C) 2014 prisnet.ch Seraphine Lantible # # +# Contributors # +# Mathieu Lemercier, mathieu@netandco.net, # # +# Franck Bret, franck@netandco.net # # +# Seraphine Lantible, s.lantible@gmail.com, http://www.prisnet.ch # +# # # +# 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 . # # +# # # +############################################################################### +############################################################################### +# Product Brand is an Openobject module wich enable Brand management for # +# products # +############################################################################### +from openerp.osv import orm, fields + + +class product_brand(orm.Model): + _name = 'product.brand' + _columns = { + 'name': fields.char('Brand Name'), + 'description': fields.text('Description', translate=True), + 'partner_id': fields.many2one( + 'res.partner', 'partner', + help='Select a partner for this brand if it exists.', + ondelete='restrict' + ), + 'logo': fields.binary('Logo File'), + } + + +class product_template(orm.Model): + _inherit = 'product.template' + _columns = { + 'product_brand_id': fields.many2one( + 'product.brand', 'Brand', + help='Select a brand for this product.' + ), + } diff --git a/product_brand/product_brand_view.xml b/product_brand/product_brand_view.xml new file mode 100644 index 000000000..832d6b847 --- /dev/null +++ b/product_brand/product_brand_view.xml @@ -0,0 +1,94 @@ + + + + + + product.brand.search.form + product.brand + + + + + + + + + + product.brand.form + product.brand + +
+ + +
+
+
+

+ +

+
+ + + + + + +
+
+
+
+ + + product.brand.tree + product.brand + + + + + + + + + + + product.search.form + product.product + + + + + + + + + + + + + product.template.product.form + product.template + + + + + + + + + + Brand + product.brand + form + tree,form + + + +
+
diff --git a/product_brand/security/ir.model.access.csv b/product_brand/security/ir.model.access.csv new file mode 100644 index 000000000..892147b47 --- /dev/null +++ b/product_brand/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_product_brand_product_manager","product.brand","model_product_brand","base.group_partner_manager",1,1,1,1