diff --git a/product_brand/README.rst b/product_brand/README.rst index 4be5897ee..595498cc2 100644 --- a/product_brand/README.rst +++ b/product_brand/README.rst @@ -1,5 +1,5 @@ -Product Brand Manage [product_brand] -=========== +Product Brand Manager [product_brand] +===================================== This module allows odoo users to easily manage product brands. You can define brands, attach a logo and a description to them. @@ -35,20 +35,30 @@ For further information, please visit: 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 + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback +`here `_. + + Credits ======= Contributors ------------ -Mathieu Lemercier -Franck Bret -Seraphine Lantible -Gunnar Wagner +* Mathieu Lemercier +* Franck Bret +* Seraphine Lantible +* Gunnar Wagner +* Leonardo Donelli Maintainer ---------- diff --git a/product_brand/__openerp__.py b/product_brand/__openerp__.py index 11e809468..5f4dc405c 100644 --- a/product_brand/__openerp__.py +++ b/product_brand/__openerp__.py @@ -30,17 +30,16 @@ ############################################################################### { 'name': 'Product Brand Manager', - 'version': '0.1', + 'version': '8.0.0.1.0', 'category': 'Product', - 'summary': ' brand', - 'author': "NetAndCo, Akretion," - "Prisnet Telecommunications SA," - "Odoo Community Association (OCA)", + 'summary': 'Add brand to products', + 'author': 'NetAndCo, Akretion, Prisnet Telecommunications SA' + ', MONK Software, 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/product_brand.py b/product_brand/product_brand.py index 18b83b347..d82617ef8 100644 --- a/product_brand/product_brand.py +++ b/product_brand/product_brand.py @@ -1,55 +1,71 @@ # -*- 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 # # +# # +# product_brand for Odoo # +# Copyright (C) 2009 NetAndCo (). # +# Copyright (C) 2011 Akretion Benoît Guillot # +# Copyright (C) 2014 prisnet.ch Seraphine Lantible # +# Copyright (C) 2015 Leonardo Donelli # # Contributors # -# Mathieu Lemercier, mathieu@netandco.net, # # -# Franck Bret, franck@netandco.net # # +# 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 . # # -# # # +# Leonardo Donelli, donelli@webmonks.it, http://www.wearemonk.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 . # +# # ############################################################################### ############################################################################### # Product Brand is an Openobject module wich enable Brand management for # # products # ############################################################################### -from openerp.osv import orm, fields +from openerp import models, fields, api -class product_brand(orm.Model): +class ProductBrand(models.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'), - } + name = fields.Char('Brand Name', required=True) + description = fields.Text('Description', translate=True) + partner_id = fields.Many2one( + 'res.partner', + string='Partner', + help='Select a partner for this brand if it exists', + ondelete='restrict' + ) + logo = fields.Binary('Logo File') + product_ids = fields.One2many( + 'product.template', + 'product_brand_id', + string='Brand Products', + ) + products_count = fields.Integer( + string='Number of products', + compute='_get_products_count', + ) -class product_template(orm.Model): + @api.one + @api.depends('product_ids') + def _get_products_count(self): + self.products_count = len(self.product_ids) + + +class ProductTemplate(models.Model): _inherit = 'product.template' - _columns = { - 'product_brand_id': fields.many2one( - 'product.brand', 'Brand', - help='Select a brand for this product.' - ), - } + + product_brand_id = fields.Many2one( + 'product.brand', + string='Brand', + help='Select a brand for this product' + ) diff --git a/product_brand/product_brand_view.xml b/product_brand/product_brand_view.xml index 832d6b847..4fdf0f9fd 100644 --- a/product_brand/product_brand_view.xml +++ b/product_brand/product_brand_view.xml @@ -3,8 +3,13 @@ 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 , Franck Bret , Seraphine Lantible + Copyright (C) 2014 prisnet.ch Seraphine Lantible + Copyright (C) 2015 Leonardo Donelli + Contributors: + Mathieu Lemercier + Franck Bret + Seraphine Lantible + Leonardo Donelli --> @@ -13,39 +18,65 @@ product.brand - - + + - + + + + + product.brand.form product.brand
- - -
-
-
- - - - - - - + + + + + + + - + product.brand.tree product.brand @@ -57,6 +88,47 @@ + + product.brand.kanban + product.brand + + + + + + + +
+ + + +
+

+ + + +

+ + + + + ... + + +
+
+
+
+
+
+
+ product.search.form product.product @@ -66,29 +138,102 @@ - + - + + product.template.search.brand + product.template + + + + + + + + + + + + product.template.product.form product.template - + - + + + + + product kanban view: add brand + product.template + + + +
+ + + +
+
+
+
+ + + product variant kanban view: add brand + product.product + + + +
+ + + +
+
+
+
+ + + product tree view: add brand + product.template + + + + + + + + + + product variant tree view: add brand + product.product + + + + + + Brand product.brand form - tree,form + kanban,form,tree - + diff --git a/product_brand/security/ir.model.access.csv b/product_brand/security/ir.model.access.csv index 892147b47..899b0d21e 100644 --- a/product_brand/security/ir.model.access.csv +++ b/product_brand/security/ir.model.access.csv @@ -1,2 +1,3 @@ "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 +"access_product_brand_public","product.brand.public","model_product_brand",,1,0,0,0 diff --git a/product_brand/static/description/icon.png b/product_brand/static/description/icon.png new file mode 100644 index 000000000..3a0328b51 Binary files /dev/null and b/product_brand/static/description/icon.png differ