diff --git a/app_product_brand/__init__.py b/app_product_brand/__init__.py new file mode 100644 index 00000000..bf588bc8 --- /dev/null +++ b/app_product_brand/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import report diff --git a/app_product_brand/__manifest__.py b/app_product_brand/__manifest__.py new file mode 100644 index 00000000..cbdf35f4 --- /dev/null +++ b/app_product_brand/__manifest__.py @@ -0,0 +1,98 @@ +# 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.odooai.cn +# email: 300883@qq.com +# resource of odooai +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +# Odoo12在线用户手册(长期更新) +# https://www.odooai.cn/documentation/user/12.0/zh_CN/index.html + +# Odoo12在线开发者手册(长期更新) +# https://www.odooai.cn/documentation/12.0/index.html + +# Odoo10在线中文用户手册(长期更新) +# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# https://www.odooai.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# https://www.odooai.cn/odoo10_developer_document_offline/ + +############################################################################## +# Copyright (C) 2009-TODAY odooai.cn Ltd. https://www.odooai.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': '16.23.12.29', + 'author': 'odooai.cn', + 'category': 'Product', + 'website': 'https://www.odooai.cn', + 'license': 'LGPL-3', + 'sequence': 2, + 'price': 0.00, + 'currency': 'EUR', + 'images': ['static/description/banner.png'], + 'depends': [ + 'sale_stock', + 'purchase', + ], + 'summary': """ + Product brand manager. Odoo App of odooai.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': [ + 'app_purchase_pro', + 'app_sale_pro', + ], + 'data': [ + 'security/ir.model.access.csv', + 'views/product_brand_views.xml', + 'views/product_template_views.xml', + 'views/product_product_views.xml', + # todo: update report + 'report/sale_report_views.xml', + 'report/purchase_report_views.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..40a5ccf5 --- /dev/null +++ b/app_product_brand/hooks.py @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- + +# Created on 2018-10-12 +# author: 欧度智能,https://www.odooai.cn +# email: 300883@qq.com +# resource of odooai +# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). + +# Odoo在线中文用户手册(长期更新) +# https://www.odooai.cn/documentation/user/10.0/zh_CN/index.html + +# Odoo10离线中文用户手册下载 +# https://www.odooai.cn/odoo10_user_manual_document_offline/ +# Odoo10离线开发手册下载-含python教程,jquery参考,Jinja2模板,PostgresSQL参考(odoo开发必备) +# https://www.odooai.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..77b1c580 --- /dev/null +++ b/app_product_brand/i18n/zh_CN.po @@ -0,0 +1,171 @@ +# 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-20220602\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-09-06 11:10+0000\n" +"PO-Revision-Date: 2022-09-06 11:10+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,help:app_product_brand.field_product_brand__message_unread_counter +msgid "Number of unread messages" +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:ir.model.fields,field_description:app_product_brand.field_sale_report__product_brand_id +#: model:ir.model.fields,field_description:app_product_brand.field_purchase_report__product_brand_id +#: model_terms:ir.ui.view,arch_db:app_product_brand.app_view_order_product_search +#: model_terms:ir.ui.view,arch_db:app_product_brand.product_brand_search_form_view +#: model_terms:ir.ui.view,arch_db:app_product_brand.app_view_purchase_order_search +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,field_description:app_product_brand.field_product_brand__activity_user_id +msgid "Responsible User" +msgstr "" + +#. module: app_product_brand +#: model:ir.model.fields,field_description:app_product_brand.field_product_brand__message_has_sms_error +msgid "SMS Delivery error" +msgstr "" + +#. module: app_product_brand +#: model:ir.model,name:app_product_brand.model_sale_report +msgid "Sales Analysis Report" +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/models/__init__.py b/app_product_brand/models/__init__.py new file mode 100644 index 00000000..a476e455 --- /dev/null +++ b/app_product_brand/models/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import product_brand +from . import product_template diff --git a/app_product_brand/models/product_brand.py b/app_product_brand/models/product_brand.py new file mode 100644 index 00000000..7ffa8efe --- /dev/null +++ b/app_product_brand/models/product_brand.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- + +# 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 odooai.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' + + _inherit = ['mail.thread', 'mail.activity.mixin'] + _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='set null' + ) + 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", default=10) + + @api.depends('product_ids') + def _compute_products_count(self): + for brand in self: + brand.products_count = len(brand.product_ids) + diff --git a/app_product_brand/models/product_template.py b/app_product_brand/models/product_template.py new file mode 100644 index 00000000..ebfe482d --- /dev/null +++ b/app_product_brand/models/product_template.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +# 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 odooai.cn +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html) + +from odoo import api, fields, models, _ + + +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/models/sale_order_line.py b/app_product_brand/models/sale_order_line.py new file mode 100644 index 00000000..7ac39bf3 --- /dev/null +++ b/app_product_brand/models/sale_order_line.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +import logging +from odoo import fields, models, api, _ + +_logger = logging.getLogger(__name__) + + +class SaleOrderLine(models.Model): + _inherit = "sale.order.line" + + product_brand_id = fields.Many2one( + 'product.brand', + string='Brand', + compute='_compute_product_code', + readonly=True, store=True, + help='Select a brand for this product' + ) + + @api.depends('product_id') + def _compute_product_code(self): + # 直接覆盖 app_sale_pro + data = self.env['product.product'].search_read([('id', 'in', self.mapped('product_id').ids)], + fields=['id', 'default_code', 'product_brand_id']) + for rec in self: + rec.product_code = rec.product_id.default_code + rec.categ_id = rec.product_id.categ_id + rec.product_brand_id = rec.product_id.product_brand_id + + # for rec in self: + # rec.update({ + # 'product_code': data[rec.product_id.id].get('default_code'), + # 'product_brand_id': data[rec.product_id.id].get('product_brand_id') + # }) + + \ No newline at end of file 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..57cd84a7 --- /dev/null +++ b/app_product_brand/report/__init__.py @@ -0,0 +1,4 @@ +# -*- coding: utf-8 -*- + +from . import sale_report +from . import purchase_report diff --git a/app_product_brand/report/purchase_report.py b/app_product_brand/report/purchase_report.py new file mode 100644 index 00000000..f50639eb --- /dev/null +++ b/app_product_brand/report/purchase_report.py @@ -0,0 +1,17 @@ +# -*- coding: utf-8 -*- + +from odoo import tools +from odoo import api, fields, models + + +class PurchaseReport(models.Model): + _inherit = "purchase.report" + + product_brand_id = fields.Many2one('product.brand', string='Product Brand', readonly=True) + + def _select(self): + return super(PurchaseReport, self)._select() + \ + ", t.product_brand_id as product_brand_id" + + def _group_by(self): + return super(PurchaseReport, self)._group_by() + ",t.product_brand_id" diff --git a/app_product_brand/report/purchase_report_views.xml b/app_product_brand/report/purchase_report_views.xml new file mode 100644 index 00000000..6cc69904 --- /dev/null +++ b/app_product_brand/report/purchase_report_views.xml @@ -0,0 +1,30 @@ + + + + + app.product.brand.purchase.report.tree + purchase.report + + + + + + + + + + app.purchase.report.search + purchase.report + + + + + + + + + + + + diff --git a/app_product_brand/report/sale_report.py b/app_product_brand/report/sale_report.py new file mode 100644 index 00000000..5416e610 --- /dev/null +++ b/app_product_brand/report/sale_report.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- + +from odoo import tools +from odoo import api, fields, models + + +class SaleReport(models.Model): + _inherit = "sale.report" + + product_brand_id = fields.Many2one('product.brand', string='Product Brand', readonly=True) + + + 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/report/sale_report_views.xml b/app_product_brand/report/sale_report_views.xml new file mode 100644 index 00000000..e863ba9b --- /dev/null +++ b/app_product_brand/report/sale_report_views.xml @@ -0,0 +1,29 @@ + + + + + app.product.brand.sale.report.tree + sale.report + + + + + + + + + + app.sale.report.search + sale.report + + + + + + + + + + + + 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..c2168cdc --- /dev/null +++ b/app_product_brand/reports/account_invoice_report.py @@ -0,0 +1,29 @@ +# 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('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..f6edf470 --- /dev/null +++ b/app_product_brand/reports/sale_report.py @@ -0,0 +1,18 @@ +# 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('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..9cd59ebe 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..4a82393f 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..7ddba820 --- /dev/null +++ b/app_product_brand/static/description/index.html @@ -0,0 +1,471 @@ + + + + + + +Product Brand Manager + + + +
+

Product Brand Manager

+

Base on OCA 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..96ed7d5f --- /dev/null +++ b/app_product_brand/views/product_brand_views.xml @@ -0,0 +1,125 @@ + + + + product.brand.search.form + product.brand + + + + + + + + + + + Brand Products + ir.actions.act_window + product.template + kanban,form,tree + [('product_brand_id', '=', active_id)] + + + + Product Brand + ir.actions.act_window + product.brand + kanban,form,tree + current + [('product_ids', 'in', active_id)] + + + + product.brand.form + product.brand + +
+ +
+ +
+ +
+
+ + + + + + + + +
+
+ + + +
+
+
+
+ + + product.brand.tree + product.brand + + + + + + + + + + + + product.brand.kanban + product.brand + + + + + + + + +
+
+ Logo +
+
+

+ +

+ +
+
+
+
+
+
+
+ + + Brand + product.brand + tree,kanban,form + + + +
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..9d8e60ae --- /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..cbe523c1 --- /dev/null +++ b/app_product_brand/views/product_template_views.xml @@ -0,0 +1,58 @@ + + + + + + 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 + + + + + + + + +
+