@ -0,0 +1,46 @@ |
|||
.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg |
|||
:target: https://www.gnu.org/licenses/agpl-3.0-standalone.html |
|||
:alt: License: AGPL-3 |
|||
|
|||
Product Brand in Sale |
|||
===================== |
|||
This module allows the odoo users to manage their product brands easily. |
|||
|
|||
Configuration |
|||
============= |
|||
* No additional configurations needed |
|||
|
|||
Company |
|||
------- |
|||
* `Cybrosys Techno Solutions <https://cybrosys.com/>`__ |
|||
|
|||
License |
|||
======= |
|||
Affero General Public License, version 3 (AGPL v3). |
|||
(https://www.gnu.org/licenses/agpl-3.0-standalone.html) |
|||
|
|||
Credits |
|||
------- |
|||
Developer : (V18) Adarsh K, Contact: odoo@cybrosys.com |
|||
|
|||
Contacts |
|||
-------- |
|||
* Mail Contact : odoo@cybrosys.com |
|||
* Website : https://cybrosys.com |
|||
|
|||
Bug Tracker |
|||
----------- |
|||
Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. |
|||
|
|||
Maintainer |
|||
========== |
|||
.. image:: https://cybrosys.com/images/logo.png |
|||
:target: https://cybrosys.com |
|||
|
|||
This module is maintained by Cybrosys Technologies. |
|||
|
|||
For support and more information, please visit `Our Website <https://cybrosys.com/>`__ |
|||
|
|||
Further information |
|||
=================== |
|||
HTML Description: `<static/description/index.html>`__ |
@ -0,0 +1,22 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from . import models |
@ -0,0 +1,45 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
{ |
|||
'name': 'Product Brand in Sale', |
|||
'version': '18.0.1.0.0', |
|||
'category': 'Sales', |
|||
'summary': 'Product Brand in sale for manage products', |
|||
'description': 'This module allows the odoo users to manage their product' |
|||
' brands easily', |
|||
'author': 'Cybrosys Techno Solutions', |
|||
'company': 'Cybrosys Techno Solutions', |
|||
'maintainer': 'Cybrosys Techno Solutions', |
|||
'website': 'https://www.cybrosys.com', |
|||
'depends': ['sale_management'], |
|||
'data': [ |
|||
'security/ir.model.access.csv', |
|||
'views/product_brand_views.xml', |
|||
'views/product_template_views.xml', |
|||
'views/sale_report_views.xml', |
|||
], |
|||
'images': ['static/description/banner.png'], |
|||
'license': 'AGPL-3', |
|||
'installable': True, |
|||
'auto_install': False, |
|||
'application': False, |
|||
} |
@ -0,0 +1,6 @@ |
|||
## Module <product_brand_sale> |
|||
|
|||
#### 09.08.2024 |
|||
#### Version 18.0.1.0.0 |
|||
##### ADD |
|||
- Initial Commit for Product Brand in Sale |
@ -0,0 +1,24 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from . import product_brand |
|||
from . import product_template |
|||
from . import sale_report |
@ -0,0 +1,55 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from odoo import api, fields, models |
|||
|
|||
|
|||
class ProductBrand(models.Model): |
|||
""" |
|||
This class represents a brand of products. |
|||
|
|||
It is used to store information about different product brands, including |
|||
their name, an image associated with the brand, and a list of products that |
|||
belong to this brand. |
|||
""" |
|||
_name = 'product.brand' |
|||
_description = 'Product Brand' |
|||
|
|||
name = fields.Char(string="Name", help="Name of the brand") |
|||
brand_image = fields.Binary(string="Image", help="Image of the brand") |
|||
member_ids = fields.One2many('product.template', 'brand_id', |
|||
string="Members", |
|||
help="Products under the brand") |
|||
product_count = fields.Char(string='Product Count', |
|||
compute='_compute_product_count', store=True, |
|||
help="Total number of products in the brand") |
|||
|
|||
@api.depends('member_ids') |
|||
def _compute_product_count(self): |
|||
""" |
|||
Compute the total number of products in the brand. |
|||
|
|||
The method calculates the total number of products associated with this |
|||
brand by counting the number of records in the 'member_ids' one2many |
|||
field and updates the 'product_count' field with the result. |
|||
""" |
|||
for record in self: |
|||
record.product_count = len(record.member_ids) |
@ -0,0 +1,34 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class ProductTemplate(models.Model): |
|||
""" |
|||
This class extends the 'product.template' model to associate products with |
|||
brands. |
|||
""" |
|||
_inherit = 'product.template' |
|||
|
|||
brand_id = fields.Many2one('product.brand', string='Brand', |
|||
help="Name of the brand which the product" |
|||
" belongs to") |
@ -0,0 +1,48 @@ |
|||
# -*- coding: utf-8 -*- |
|||
################################################################################ |
|||
# |
|||
# Cybrosys Technologies Pvt. Ltd. |
|||
# Copyright (C) 2024-TODAY Cybrosys Technologies(<https://www.cybrosys.com>). |
|||
# Author: Adarsh K (odoo@cybrosys.com) |
|||
# |
|||
# This program is free software: you can modify |
|||
# it under the terms of the GNU Affero General Public License (AGPL) 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 <https://www.gnu.org/licenses/>. |
|||
# |
|||
################################################################################ |
|||
from odoo import fields, models |
|||
|
|||
|
|||
class SaleReport(models.Model): |
|||
""" |
|||
Inherit sale_report model |
|||
""" |
|||
_inherit = 'sale.report' |
|||
|
|||
brand_id = fields.Many2one('product.brand', string='Brand', help="Brand") |
|||
|
|||
def _select_additional_fields(self): |
|||
""" |
|||
Brand in pivot view of the sale order report |
|||
""" |
|||
res = super()._select_additional_fields() |
|||
res['brand_id'] = "t.brand_id" |
|||
return res |
|||
|
|||
def _group_by_sale(self): |
|||
""" |
|||
Brand as filter in the pivot view |
|||
""" |
|||
res = super()._group_by_sale() |
|||
res += """, |
|||
t.brand_id""" |
|||
return res |
|
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 28 KiB |
After Width: | Height: | Size: 628 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 210 KiB |
After Width: | Height: | Size: 209 KiB |
After Width: | Height: | Size: 109 KiB |
After Width: | Height: | Size: 495 B |
After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 624 B |
After Width: | Height: | Size: 136 KiB |
After Width: | Height: | Size: 214 KiB |
After Width: | Height: | Size: 36 KiB |
After Width: | Height: | Size: 3.6 KiB |
After Width: | Height: | Size: 310 B |
After Width: | Height: | Size: 929 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 17 KiB |
After Width: | Height: | Size: 542 B |
After Width: | Height: | Size: 576 B |
After Width: | Height: | Size: 733 B |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 174 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 911 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 600 B |
After Width: | Height: | Size: 673 B |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 462 B |
After Width: | Height: | Size: 2.1 KiB |
After Width: | Height: | Size: 926 B |
After Width: | Height: | Size: 9.0 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 7.0 KiB |
After Width: | Height: | Size: 878 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 653 B |
After Width: | Height: | Size: 800 B |
After Width: | Height: | Size: 905 B |
After Width: | Height: | Size: 189 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 839 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 5.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 34 KiB |
After Width: | Height: | Size: 26 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 23 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 2.3 KiB |
After Width: | Height: | Size: 427 B |
After Width: | Height: | Size: 627 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 988 B |
After Width: | Height: | Size: 3.7 KiB |
After Width: | Height: | Size: 5.0 KiB |
After Width: | Height: | Size: 875 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 912 KiB |
After Width: | Height: | Size: 1.3 MiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 46 KiB |
After Width: | Height: | Size: 85 KiB |
After Width: | Height: | Size: 31 KiB |
After Width: | Height: | Size: 44 KiB |
After Width: | Height: | Size: 90 KiB |
After Width: | Height: | Size: 95 KiB |
After Width: | Height: | Size: 59 KiB |
After Width: | Height: | Size: 73 KiB |
After Width: | Height: | Size: 880 KiB |
After Width: | Height: | Size: 87 KiB |
After Width: | Height: | Size: 11 KiB |
@ -0,0 +1,67 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Product brand form view--> |
|||
<record id="product_brand_view_form" model="ir.ui.view"> |
|||
<field name="name">product.brand.view.form</field> |
|||
<field name="model">product.brand</field> |
|||
<field name="arch" type="xml"> |
|||
<form> |
|||
<sheet> |
|||
<field name="brand_image" widget="image" class="oe_avatar"/> |
|||
<div class="oe_title"> |
|||
<label for="name" class="oe_edit_only" |
|||
string="Brand Name"/> |
|||
<h1> |
|||
<field name="name"/> |
|||
</h1> |
|||
<div name="options_active"/> |
|||
</div> |
|||
<group> |
|||
<field name="product_count" style="width:40px;" force_save="1"/> |
|||
</group> |
|||
<notebook> |
|||
<page string="Products"> |
|||
<field name="member_ids" widget="many2many" |
|||
options="{'not_delete': True}"> |
|||
<kanban quick_create="false" create="true" |
|||
delete="true"> |
|||
<field name="id"/> |
|||
<field name="name"/> |
|||
<templates> |
|||
<t t-name="kanban-box"> |
|||
<div class="oe_kanban_global_click" |
|||
style="max-width: 200px"> |
|||
<div class="o_kanban_record_top"> |
|||
<img t-att-src="kanban_image('product.template', 'image_128', record.id.raw_value)" |
|||
class="oe_avatar oe_kanban_avatar_smallbox o_image_40_cover mb0" |
|||
alt="Avatar"/> |
|||
<div class="o_kanban_record_headings ml8"> |
|||
<strong class="o_kanban_record_title"> |
|||
<field name="name"/> |
|||
</strong> |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</t> |
|||
</templates> |
|||
</kanban> |
|||
</field> |
|||
</page> |
|||
</notebook> |
|||
</sheet> |
|||
</form> |
|||
</field> |
|||
</record> |
|||
<!-- Product brand action--> |
|||
<record id="product_brand_action" model="ir.actions.act_window"> |
|||
<field name="name">Product Brand</field> |
|||
<field name="res_model">product.brand</field> |
|||
<field name="view_mode">list,form</field> |
|||
</record> |
|||
<!-- Menu for product brand--> |
|||
<menuitem id="product_brand_menu" |
|||
name="Product Brands" |
|||
parent="sale.product_menu_catalog" |
|||
sequence="3" |
|||
action="product_brand_action"/> |
|||
</odoo> |
@ -0,0 +1,26 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Inheriting product_template views for adding te brand inside the products--> |
|||
<record id="product_template_form_view" model="ir.ui.view"> |
|||
<field name="name">product.template.view.form.inherit.product.brand.sale</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_form_view"/> |
|||
<field name="arch" type="xml"> |
|||
<field name="categ_id" position="after"> |
|||
<field name="brand_id"/> |
|||
</field> |
|||
</field> |
|||
</record> |
|||
<!-- Inheriting product_template views to add brand--> |
|||
<record id="product_template_search_view" model="ir.ui.view"> |
|||
<field name="name">product.template.view.search.inherit.product.brand.sale</field> |
|||
<field name="model">product.template</field> |
|||
<field name="inherit_id" ref="product.product_template_search_view"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//search" position="inside"> |
|||
<filter string="Brand" name="Brand" |
|||
context="{'group_by':'brand_id'}"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |
@ -0,0 +1,15 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<odoo> |
|||
<!-- Inheriting sale_report search view to add group by option of brand--> |
|||
<record id="view_order_product_search" model="ir.ui.view"> |
|||
<field name="name">sale.report.view.search.inherit.product.brand.sale</field> |
|||
<field name="model">sale.report</field> |
|||
<field name="inherit_id" ref="sale.view_order_product_search"/> |
|||
<field name="arch" type="xml"> |
|||
<xpath expr="//filter[@name='Customer']" position="after"> |
|||
<filter string="Brand" name="Brand" |
|||
context="{'group_by':'brand_id'}"/> |
|||
</xpath> |
|||
</field> |
|||
</record> |
|||
</odoo> |