diff --git a/app_product_brand/README.rst b/app_product_brand/README.rst new file mode 100644 index 00000000..c35b9c07 --- /dev/null +++ b/app_product_brand/README.rst @@ -0,0 +1,120 @@ +===================== +Product Brand Manager +===================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png + :target: https://odoo-community.org/page/development-status + :alt: Mature +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fproduct--attribute-lightgray.png?logo=github + :target: https://github.com/OCA/product-attribute/tree/12.0/product_brand + :alt: OCA/product-attribute +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/product-attribute-12-0/product-attribute-12-0-product_brand + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/135/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This module allows odoo users to easily manage product brands. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +To create a new brand: + +#. Go to *Sales > Configuration > Products > Product Brands*. +#. You can set its logo, associate a partner and add a description. + +To add a product to a brand: + +#. Go to the product itself and edit. +#. Below the product's name there is a Brand field where you can pick the one + the product belongs to. + +To see the sales report based on brand dimension: + +#. Go to *Sales > Reporting > Sales*. +#. There you can *Group by* brand or add it as a dimension in the pivot view. + +To see the invoice report based on brand dimension: + +#. Go to *Invoicing > Reporting > Management > Invoices*. +#. There you can *Group by* brand or add it as a dimension in the pivot view. + +Known issues / Roadmap +====================== + +* Add a field with brands associated to a Customer or Supplier on + the Customers/Suppliers Form View. +* Fix smart button alignment in brand 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 `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +~~~~~~~ + +* NetAndCo +* Akretion +* Prisnet Telecommunications SA +* MONK Software +* SerpentCS Pvt. Ltd. +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Mathieu Lemercier +* Franck Bret +* Seraphine Lantible +* Gunnar Wagner +* Leonardo Donelli +* Serpent Consulting Services Pvt. Ltd. +* Marcelo Pickler +* Andrius Laukavičius (Boolit) +* Daniel Campos +* `Tecnativa `_ + + * David Vidal + +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +This module is part of the `OCA/product-attribute `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/app_product_brand/__init__.py b/app_product_brand/__init__.py new file mode 100644 index 00000000..30988763 --- /dev/null +++ b/app_product_brand/__init__.py @@ -0,0 +1,2 @@ +from . import models +# from . import reports diff --git a/app_product_brand/__manifest__.py b/app_product_brand/__manifest__.py new file mode 100644 index 00000000..f092ff26 --- /dev/null +++ b/app_product_brand/__manifest__.py @@ -0,0 +1,95 @@ +# Copyright 2009 NetAndCo (). +# Copyright 2011 Akretion Benoît Guillot +# Copyright 2014 prisnet.ch Seraphine Lantible +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# Copyright 2018 Daniel Campos +# Copyright 2018 Tecnativa - David Vidal +# Copyright 2019 Giovanni - GSLabIt +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). +# -*- coding: utf-8 -*- + +# Created on 2019-11-12 +# author: 广州尚鹏,https://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +# Odoo12在线用户手册(长期更新) +# https://www.sunpop.cn/documentation/user/12.0/zh_CN/index.html + +# Odoo12在线开发者手册(长期更新) +# https://www.sunpop.cn/documentation/12.0/index.html + +# Odoo10在线中文用户手册(长期更新) +# https://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# https://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# https://www.sunpop.cn/odoo10_developer_document_offline/ + +############################################################################## +# Copyright (C) 2009-TODAY Sunpop.cn Ltd. https://www.sunpop.cn +# Author: Ivan Deng,300883@qq.com +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# See . +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +############################################################################## + +{ + 'name': 'Product Brand Manager', + 'version': '13.19.12.12', + 'author': 'Sunpop.cn', + 'category': 'Product', + 'website': 'https://www.sunpop.cn', + 'license': 'LGPL-3', + 'sequence': 2, + 'price': 0.00, + 'currency': 'EUR', + 'images': ['static/description/banner.png'], + 'depends': [ + 'sale', + ], + 'summary': """ + Odoo App of Sunpop.cn + """, + 'description': """ + Support Odoo 13,12, 11, Enterprise and Community Edition + 1. + 2. + 3. Multi-language Support. + 4. Multi-Company Support. + 5. Support Odoo 13,12, 11, Enterprise and Community Edition + ========== + 1. + 2. + 3. 多语言支持 + 4. 多公司支持 + 5. Odoo 13, 12, 11, 企业版,社区版,多版本支持 + """, + 'depends': [ + 'sale', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_brand_views.xml', + 'views/product_template_views.xml', + 'views/product_product_views.xml', + # todo: update report + # 'reports/sale_report_view.xml', + # 'reports/account_invoice_report_view.xml', + ], + 'qweb': [ + 'static/src/xml/*.xml', + ], + 'demo': [], + # 'pre_init_hook': 'pre_init_hook', + # 'post_init_hook': 'post_init_hook', + # 'uninstall_hook': 'uninstall_hook', + 'installable': True, + 'application': True, + 'auto_install': False, +} diff --git a/app_product_brand/hooks.py b/app_product_brand/hooks.py new file mode 100644 index 00000000..3ba52cbf --- /dev/null +++ b/app_product_brand/hooks.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +# Created on 2018-10-12 +# author: 广州尚鹏,https://www.sunpop.cn +# email: 300883@qq.com +# resource of Sunpop +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +# Odoo在线中文用户手册(长期更新) +# https://www.sunpop.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# https://www.sunpop.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# https://www.sunpop.cn/odoo10_developer_document_offline/ +# description: + +from odoo import api, SUPERUSER_ID, _ + + +def pre_init_hook(cr): + pass + # cr.execute("") + +def post_init_hook(cr, registry): + pass + # cr.execute("") + +def uninstall_hook(cr, registry): + pass + # cr.execute("") + diff --git a/app_product_brand/i18n/zh_CN.po b/app_product_brand/i18n/zh_CN.po new file mode 100644 index 00000000..ad9786c6 --- /dev/null +++ b/app_product_brand/i18n/zh_CN.po @@ -0,0 +1,147 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * app_product_brand +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2019-12-11 17:04+0000\n" +"PO-Revision-Date: 2019-12-11 17:04+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: app_product_brand +#: model:ir.actions.act_window,name:app_product_brand.action_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_product__product_brand_id +#: model:ir.model.fields,field_description:app_product_brand.field_product_template__product_brand_id +#: model_terms:ir.ui.view,arch_db:app_product_brand.product_template_form_brand_add +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_template_search_brand +msgid "Brand" +msgstr "品牌" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__name +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_form +msgid "Brand Name" +msgstr "品牌名称" + +#. module: app_product_brand +#: model:ir.actions.act_window,name:app_product_brand.action_open_brand_products +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__product_ids +msgid "Brand Products" +msgstr "品牌产品" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__create_uid +msgid "Created by" +msgstr "创建者" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__create_date +msgid "Created on" +msgstr "创建时间" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__description +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_form +msgid "Description" +msgstr "说明" + +#. module: app_product_brand +#: model:ir.model.fields,help:app_product_brand.field_product_brand__sequence +msgid "Determine the display order" +msgstr "决定显示顺序" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__display_name +msgid "Display Name" +msgstr "显示名称" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__id +msgid "ID" +msgstr "" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand____last_update +msgid "Last Modified on" +msgstr "最后更改日" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__write_uid +msgid "Last Updated by" +msgstr "最后更新者" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__write_date +msgid "Last Updated on" +msgstr "更新时间" + +#. module: app_product_brand +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_kanban +msgid "Logo" +msgstr "" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__logo +msgid "Logo File" +msgstr "Logo文件" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__products_count +msgid "Number of products" +msgstr "产品数量" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__partner_id +msgid "Partner" +msgstr "业务伙伴" + +#. module: app_product_brand +#: model:ir.actions.act_window,name:app_product_brand.action_open_single_product_brand +#: model:ir.model,name:app_product_brand.model_product_brand +#: model_terms:ir.ui.view,arch_db:app_product_brand.product_brand_search_form_view +msgid "Product Brand" +msgstr "产品品牌" + +#. module: app_product_brand +#: model:ir.ui.menu,name:app_product_brand.menu_product_brand +msgid "Product Brands" +msgstr "产品品牌" + +#. module: app_product_brand +#: model:ir.model,name:app_product_brand.model_product_template +msgid "Product Template" +msgstr "产品模板" + +#. module: app_product_brand +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_form +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_kanban +msgid "Products" +msgstr "产品" + +#. module: app_product_brand +#: model:ir.model.fields,help:app_product_brand.field_product_product__product_brand_id +#: model:ir.model.fields,help:app_product_brand.field_product_template__product_brand_id +msgid "Select a brand for this product" +msgstr "为产品选择一个品牌" + +#. module: app_product_brand +#: model:ir.model.fields,help:app_product_brand.field_product_brand__partner_id +msgid "Select a partner for this brand if any." +msgstr "为品牌选择一个供应商" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__sequence +msgid "Sequence" +msgstr "单号规则" + +#. module: app_product_brand +#: model_terms:ir.ui.view,arch_db:app_product_brand.view_product_brand_tree +msgid "product.brand" +msgstr "产品.品牌" diff --git a/app_product_brand/migrations/12.0.2.0.0/post-migration.py b/app_product_brand/migrations/12.0.2.0.0/post-migration.py new file mode 100644 index 00000000..2d7bd852 --- /dev/null +++ b/app_product_brand/migrations/12.0.2.0.0/post-migration.py @@ -0,0 +1,14 @@ +# Copyright 2019 Tecnativa - Pedro M. Baeza +# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html + +from openupgradelib import openupgrade +from openupgradelib import openupgrade_90 + + +@openupgrade.migrate(use_env=True) +def migrate(env, version): + column = openupgrade.get_legacy_name('logo') + if openupgrade.column_exists(env.cr, 'product_brand', column): + openupgrade_90.convert_binary_field_to_attachment( + env, {'product.brand': [('logo', None)]}, + ) diff --git a/app_product_brand/migrations/12.0.2.0.0/pre-migration.py b/app_product_brand/migrations/12.0.2.0.0/pre-migration.py new file mode 100644 index 00000000..0f6162b4 --- /dev/null +++ b/app_product_brand/migrations/12.0.2.0.0/pre-migration.py @@ -0,0 +1,16 @@ +# Copyright 2019 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openupgradelib import openupgrade + +column_renames = { + 'product_brand': [ + ('logo', None), + ], +} + + +@openupgrade.migrate() +def migrate(env, version): + if openupgrade.column_exists(env.cr, 'product_brand', 'logo'): + openupgrade.rename_columns(env.cr, column_renames) diff --git a/app_product_brand/models/__init__.py b/app_product_brand/models/__init__.py new file mode 100644 index 00000000..6cb55ac7 --- /dev/null +++ b/app_product_brand/models/__init__.py @@ -0,0 +1 @@ +from . import product_brand diff --git a/app_product_brand/models/product_brand.py b/app_product_brand/models/product_brand.py new file mode 100644 index 00000000..f81b0dda --- /dev/null +++ b/app_product_brand/models/product_brand.py @@ -0,0 +1,50 @@ +# Copyright 2009 NetAndCo (). +# Copyright 2011 Akretion Benoît Guillot +# Copyright 2014 prisnet.ch Seraphine Lantible +# Copyright 2016 Serpent Consulting Services Pvt. Ltd. +# Copyright 2018 Daniel Campos +# Copyright 2019 Sunpop.cn +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import api, fields, models, _ + + +class ProductBrand(models.Model): + _name = 'product.brand' + _description = "Product Brand" + _order = 'sequence, name' + + name = fields.Char('Brand Name', required=True) + description = fields.Text(translate=True) + partner_id = fields.Many2one( + 'res.partner', + string='Partner', + help='Select a partner for this brand if any.', + ondelete='restrict' + ) + logo = fields.Binary('Logo File', attachment=True) + product_ids = fields.One2many( + 'product.template', + 'product_brand_id', + string='Brand Products', + ) + products_count = fields.Integer( + string='Number of products', + compute='_compute_products_count', + ) + sequence = fields.Integer('Sequence', help="Determine the display order") + + @api.depends('product_ids') + def _compute_products_count(self): + for brand in self: + brand.products_count = len(brand.product_ids) + + +class ProductTemplate(models.Model): + _inherit = 'product.template' + + product_brand_id = fields.Many2one( + 'product.brand', + string='Brand', + help='Select a brand for this product' + ) diff --git a/app_product_brand/readme/CONTRIBUTORS.rst b/app_product_brand/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..84908264 --- /dev/null +++ b/app_product_brand/readme/CONTRIBUTORS.rst @@ -0,0 +1,12 @@ +* Mathieu Lemercier +* Franck Bret +* Seraphine Lantible +* Gunnar Wagner +* Leonardo Donelli +* Serpent Consulting Services Pvt. Ltd. +* Marcelo Pickler +* Andrius Laukavičius (Boolit) +* Daniel Campos +* `Tecnativa `_ + + * David Vidal diff --git a/app_product_brand/readme/DESCRIPTION.rst b/app_product_brand/readme/DESCRIPTION.rst new file mode 100644 index 00000000..2c3805e6 --- /dev/null +++ b/app_product_brand/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +This module allows odoo users to easily manage product brands. diff --git a/app_product_brand/readme/ROADMAP.rst b/app_product_brand/readme/ROADMAP.rst new file mode 100644 index 00000000..4b146810 --- /dev/null +++ b/app_product_brand/readme/ROADMAP.rst @@ -0,0 +1,3 @@ +* Add a field with brands associated to a Customer or Supplier on + the Customers/Suppliers Form View. +* Fix smart button alignment in brand form view diff --git a/app_product_brand/readme/USAGE.rst b/app_product_brand/readme/USAGE.rst new file mode 100644 index 00000000..375ee4b2 --- /dev/null +++ b/app_product_brand/readme/USAGE.rst @@ -0,0 +1,20 @@ +To create a new brand: + +#. Go to *Sales > Configuration > Products > Product Brands*. +#. You can set its logo, associate a partner and add a description. + +To add a product to a brand: + +#. Go to the product itself and edit. +#. Below the product's name there is a Brand field where you can pick the one + the product belongs to. + +To see the sales report based on brand dimension: + +#. Go to *Sales > Reporting > Sales*. +#. There you can *Group by* brand or add it as a dimension in the pivot view. + +To see the invoice report based on brand dimension: + +#. Go to *Invoicing > Reporting > Management > Invoices*. +#. There you can *Group by* brand or add it as a dimension in the pivot view. diff --git a/app_product_brand/report/__init__.py b/app_product_brand/report/__init__.py new file mode 100644 index 00000000..633f8661 --- /dev/null +++ b/app_product_brand/report/__init__.py @@ -0,0 +1,2 @@ +# -*- coding: utf-8 -*- + diff --git a/app_product_brand/reports/__init__.py b/app_product_brand/reports/__init__.py new file mode 100644 index 00000000..fbeedbce --- /dev/null +++ b/app_product_brand/reports/__init__.py @@ -0,0 +1,2 @@ +from . import account_invoice_report +from . import sale_report diff --git a/app_product_brand/reports/account_invoice_report.py b/app_product_brand/reports/account_invoice_report.py new file mode 100644 index 00000000..2ff32fbb --- /dev/null +++ b/app_product_brand/reports/account_invoice_report.py @@ -0,0 +1,32 @@ +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import fields, models + + +class AccountInvoiceReport(models.Model): + _inherit = "account.invoice.report" + + product_brand_id = fields.Many2one( + comodel_name='product.brand', + string='Brand', + ) + + def _select(self): + select_str = super()._select() + select_str += """ + , sub.product_brand_id as product_brand_id + """ + return select_str + + def _sub_select(self): + select_str = super()._sub_select() + select_str += """ + , pt.product_brand_id + """ + return select_str + + def _group_by(self): + group_by_str = super()._group_by() + group_by_str += ", pt.product_brand_id" + return group_by_str diff --git a/app_product_brand/reports/account_invoice_report_view.xml b/app_product_brand/reports/account_invoice_report_view.xml new file mode 100644 index 00000000..0d7bb18e --- /dev/null +++ b/app_product_brand/reports/account_invoice_report_view.xml @@ -0,0 +1,15 @@ + + + + + + account.invoice.report + + + + + + + + diff --git a/app_product_brand/reports/sale_report.py b/app_product_brand/reports/sale_report.py new file mode 100644 index 00000000..2cd20d02 --- /dev/null +++ b/app_product_brand/reports/sale_report.py @@ -0,0 +1,21 @@ +# Copyright 2018 Tecnativa - David Vidal +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import fields, models + + +class SaleReport(models.Model): + _inherit = "sale.report" + + product_brand_id = fields.Many2one( + comodel_name='product.brand', + string='Brand', + ) + + # pylint:disable=dangerous-default-value + def _query(self, with_clause='', fields={}, groupby='', from_clause=''): + fields['product_brand_id'] = ", t.product_brand_id as product_brand_id" + groupby += ', t.product_brand_id' + return super(SaleReport, self)._query( + with_clause, fields, groupby, from_clause + ) diff --git a/app_product_brand/reports/sale_report_view.xml b/app_product_brand/reports/sale_report_view.xml new file mode 100644 index 00000000..6be6e5c9 --- /dev/null +++ b/app_product_brand/reports/sale_report_view.xml @@ -0,0 +1,15 @@ + + + + + + sale.report + + + + + + + + diff --git a/app_product_brand/security/app_security.xml b/app_product_brand/security/app_security.xml new file mode 100644 index 00000000..a4b85605 --- /dev/null +++ b/app_product_brand/security/app_security.xml @@ -0,0 +1,51 @@ + + + + + + acc_module_user + + + + + + + + + + App... + Helps you manage your ... + 8 + + + + + App User + + + The user will be able to ... + + + + + App Admin + + + The user will be able to config ... + + + + + + + + + + Users are allowed to access their own m/// + + ['|', ('partner_id', 'in', [user.partner_id.id]), ('user_id.id', '=', user.id)] + + + + + diff --git a/app_product_brand/security/ir.model.access.csv b/app_product_brand/security/ir.model.access.csv new file mode 100644 index 00000000..899b0d21 --- /dev/null +++ b/app_product_brand/security/ir.model.access.csv @@ -0,0 +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/app_product_brand/static/description/banner.png b/app_product_brand/static/description/banner.png new file mode 100644 index 00000000..3a0a3c4b Binary files /dev/null and b/app_product_brand/static/description/banner.png differ diff --git a/app_product_brand/static/description/icon.png b/app_product_brand/static/description/icon.png new file mode 100644 index 00000000..3a0328b5 Binary files /dev/null and b/app_product_brand/static/description/icon.png differ diff --git a/app_product_brand/static/description/index.html b/app_product_brand/static/description/index.html new file mode 100644 index 00000000..8d70db69 --- /dev/null +++ b/app_product_brand/static/description/index.html @@ -0,0 +1,470 @@ + + + + + + +Product Brand Manager + + + +
+

Product Brand Manager

+ + +

Mature License: AGPL-3 OCA/product-attribute Translate me on Weblate Try me on Runbot

+

This module allows odoo users to easily manage product brands.

+

Table of contents

+ +
+

Usage

+

To create a new brand:

+
    +
  1. Go to Sales > Configuration > Products > Product Brands.
  2. +
  3. You can set its logo, associate a partner and add a description.
  4. +
+

To add a product to a brand:

+
    +
  1. Go to the product itself and edit.
  2. +
  3. Below the product’s name there is a Brand field where you can pick the one +the product belongs to.
  4. +
+

To see the sales report based on brand dimension:

+
    +
  1. Go to Sales > Reporting > Sales.
  2. +
  3. There you can Group by brand or add it as a dimension in the pivot view.
  4. +
+

To see the invoice report based on brand dimension:

+
    +
  1. Go to Invoicing > Reporting > Management > Invoices.
  2. +
  3. There you can Group by brand or add it as a dimension in the pivot view.
  4. +
+
+
+

Known issues / Roadmap

+
    +
  • Add a field with brands associated to a Customer or Supplier on +the Customers/Suppliers Form View.
  • +
  • Fix smart button alignment in brand 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.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • NetAndCo
  • +
  • Akretion
  • +
  • Prisnet Telecommunications SA
  • +
  • MONK Software
  • +
  • SerpentCS Pvt. Ltd.
  • +
  • Tecnativa
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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.

+

This module is part of the OCA/product-attribute project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + diff --git a/app_product_brand/static/img/icon_sunpop.png b/app_product_brand/static/img/icon_sunpop.png new file mode 100644 index 00000000..aa490954 Binary files /dev/null and b/app_product_brand/static/img/icon_sunpop.png differ diff --git a/app_product_brand/static/img/logo_sunpop.png b/app_product_brand/static/img/logo_sunpop.png new file mode 100644 index 00000000..bc32c24e Binary files /dev/null and b/app_product_brand/static/img/logo_sunpop.png differ diff --git a/app_product_brand/tests/__init__.py b/app_product_brand/tests/__init__.py new file mode 100644 index 00000000..3b72ef1f --- /dev/null +++ b/app_product_brand/tests/__init__.py @@ -0,0 +1 @@ +from . import test_product_brand diff --git a/app_product_brand/tests/test_product_brand.py b/app_product_brand/tests/test_product_brand.py new file mode 100644 index 00000000..82639074 --- /dev/null +++ b/app_product_brand/tests/test_product_brand.py @@ -0,0 +1,25 @@ +# Copyright (c) 2018 Daniel Campos - Avanzosc S.L. +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). + +from odoo.tests import common + + +class TestProductBrand(common.TransactionCase): + + def setUp(self): + super().setUp() + self.product = self.env.ref('product.product_product_4') + self.supplier = self.ref('base.res_partner_2') + self.product_brand_obj = self.env['product.brand'] + self.product_brand = self.product_brand_obj.create( + {'name': 'Test Brand', + 'description': 'Test brand description', + 'partner_id': self.supplier + }) + + def test_products_count(self): + self.assertEqual(self.product_brand.products_count, 0, + 'Error product count does not match') + self.product.product_brand_id = self.product_brand.id + self.assertEqual(self.product_brand.products_count, 1, + 'Error product count does not match') diff --git a/app_product_brand/views/product_brand_views.xml b/app_product_brand/views/product_brand_views.xml new file mode 100644 index 00000000..6cf737e0 --- /dev/null +++ b/app_product_brand/views/product_brand_views.xml @@ -0,0 +1,117 @@ + + + + product.brand.search.form + product.brand + + + + + + + + + + + + + + product.brand.form + product.brand + +
+ +
+ +
+ +
+
+ + + + + + + + +
+
+
+
+ + + product.brand.tree + product.brand + + + + + + + + + + + + product.brand.kanban + product.brand + + + + + + + + +
+
+ Logo +
+
+

+ +

+ +
+
+
+
+
+
+
+ + + Brand + product.brand + kanban,form,tree + + + +
diff --git a/app_product_brand/views/product_product_views.xml b/app_product_brand/views/product_product_views.xml new file mode 100644 index 00000000..979791ff --- /dev/null +++ b/app_product_brand/views/product_product_views.xml @@ -0,0 +1,32 @@ + + + + + + product variant tree view add brand + product.product + + + + + + + + + + product variant kanban view add brand + product.product + + + +
+ + + +
+
+
+
+ +
+
diff --git a/app_product_brand/views/product_template_views.xml b/app_product_brand/views/product_template_views.xml new file mode 100644 index 00000000..5bc9aee8 --- /dev/null +++ b/app_product_brand/views/product_template_views.xml @@ -0,0 +1,59 @@ + + + + + + product.template.search.brand + product.template + + + + + + + + + + + + product.template.product.form + product.template + + + + +
+ + + + + + product kanban view add brand + product.template + + + +
+ + + +
+
+
+
+ + + product tree view add brand + product.template + + + + + + + + + +