diff --git a/product_category_codes/README.rst b/product_category_codes/README.rst new file mode 100644 index 000000000..3bcad8d2c --- /dev/null +++ b/product_category_codes/README.rst @@ -0,0 +1,16 @@ +========================= +Product Category Code v11 +========================= + This module allows you to add a code for the product category. We can search the category by code. + Also we can search in products, No need to specify the category name for search, we can search by code too. + search will check the category name as well as category code. it make more easy in search. + +Features +======== +* Allows to add code in Product Category. +* Search by code in Product Category. +* Category search in products make more easy. + +Credits +======= +Nikhil Krishnan @ cybrosys diff --git a/product_category_codes/__init__.py b/product_category_codes/__init__.py new file mode 100644 index 000000000..d3ea814be --- /dev/null +++ b/product_category_codes/__init__.py @@ -0,0 +1,23 @@ +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan(nikhil@cybrosys.in) +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from . import models diff --git a/product_category_codes/__manifest__.py b/product_category_codes/__manifest__.py new file mode 100644 index 000000000..8b26de3a0 --- /dev/null +++ b/product_category_codes/__manifest__.py @@ -0,0 +1,39 @@ +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +{ + 'name': 'Product Category Code', + 'version': '11.0.1.0.0', + 'summary': """We Can Search/Find Product & Category by Product Category CODE.""", + 'description': """We can search and find product and category by product category code.""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'http://www.cybrosys.com', + 'category': 'Sales Management', + 'depends': ['product'], + 'license': 'LGPL-3', + 'data': ['views/product_category_code.xml'], + 'demo': [], + 'images': ['static/description/banner.jpg'], + 'installable': True, + 'auto_install': False, +} diff --git a/product_category_codes/doc/RELEASE_NOTES.md b/product_category_codes/doc/RELEASE_NOTES.md new file mode 100755 index 000000000..14dd98b61 --- /dev/null +++ b/product_category_codes/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 25.04.2019 +#### Version 11.0.1.0.0 +##### ADD +- Initial commit diff --git a/product_category_codes/models/__init__.py b/product_category_codes/models/__init__.py new file mode 100644 index 000000000..9b6cb0312 --- /dev/null +++ b/product_category_codes/models/__init__.py @@ -0,0 +1,25 @@ +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from . import product_category + + diff --git a/product_category_codes/models/product_category.py b/product_category_codes/models/product_category.py new file mode 100644 index 000000000..c2e22bfc9 --- /dev/null +++ b/product_category_codes/models/product_category.py @@ -0,0 +1,62 @@ +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Nikhil krishnan() +# you can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# It is forbidden to publish, distribute, sublicense, or sell copies +# of the Software or modified copies of the Software. +# +# 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 LESSER GENERAL PUBLIC LICENSE (LGPL v3) for more details. +# +# You should have received a copy of the GNU LESSER GENERAL PUBLIC LICENSE +# GENERAL PUBLIC LICENSE (LGPL v3) along with this program. +# If not, see . +# +############################################################################## + +from odoo import models, fields, api +from odoo.osv import expression + + +class ProductCategoryCode(models.Model): + _inherit = 'product.category' + + _sql_constraints = [('category_code_unique', 'unique (category_code)', 'The code must be unique')] + + category_code = fields.Char(string='Code', copy=False) + + @api.model + def name_search(self, name, args=None, operator='ilike', limit=100): + if not args: + args = [] + if name: + # Be sure name_search is symetric to name_get + category_names = name.split(' / ') + parents = list(category_names) + child = parents.pop() + domain = ['|', ('name', operator, child), ('category_code', operator, child)] + if parents: + names_ids = self.name_search(' / '.join(parents), args=args, operator='ilike', limit=limit) + category_ids = [name_id[0] for name_id in names_ids] + if operator in expression.NEGATIVE_TERM_OPERATORS: + categories = self.search([('id', 'not in', category_ids)]) + domain = expression.OR([[('parent_id', 'in', categories.ids)], domain]) + else: + domain = expression.AND([[('parent_id', 'in', category_ids)], domain]) + for i in range(1, len(category_names)): + domain = [[('name', operator, ' / '.join(category_names[-1 - i:]))], domain] + if operator in expression.NEGATIVE_TERM_OPERATORS: + domain = expression.AND(domain) + else: + domain = expression.OR(domain) + categories = self.search(expression.AND([domain, args]), limit=limit) + else: + categories = self.search(args, limit=limit) + return categories.name_get() + diff --git a/product_category_codes/static/description/banner.jpg b/product_category_codes/static/description/banner.jpg new file mode 100644 index 000000000..7b3e1cb51 Binary files /dev/null and b/product_category_codes/static/description/banner.jpg differ diff --git a/product_category_codes/static/description/category search result.png b/product_category_codes/static/description/category search result.png new file mode 100644 index 000000000..34699f548 Binary files /dev/null and b/product_category_codes/static/description/category search result.png differ diff --git a/product_category_codes/static/description/code in product search.png b/product_category_codes/static/description/code in product search.png new file mode 100644 index 000000000..8732ec3c7 Binary files /dev/null and b/product_category_codes/static/description/code in product search.png differ diff --git a/product_category_codes/static/description/code.png b/product_category_codes/static/description/code.png new file mode 100644 index 000000000..449b0fcb5 Binary files /dev/null and b/product_category_codes/static/description/code.png differ diff --git a/product_category_codes/static/description/cybro_logo.png b/product_category_codes/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/product_category_codes/static/description/cybro_logo.png differ diff --git a/product_category_codes/static/description/icon.png b/product_category_codes/static/description/icon.png new file mode 100644 index 000000000..bd0be8c21 Binary files /dev/null and b/product_category_codes/static/description/icon.png differ diff --git a/product_category_codes/static/description/index.html b/product_category_codes/static/description/index.html new file mode 100644 index 000000000..baa4062e4 --- /dev/null +++ b/product_category_codes/static/description/index.html @@ -0,0 +1,384 @@ +
+
+

+ Product Category Code +

+

+ Provide Code for Product Category, Search by code in category and product. +

+
+ Cybrosys Technologies +
+ +
+ cybrosys technologies +
+
+
+
+ + + +
+
+

+ Overview +

+

+ This module allows you to add a code for the product category and it will helps to search the product category by specific code. +

+

+ Configuration +

+

+ No additional configuration required +

+
+
+ + +
+
+

+ Features +

+

+ + Allows adding code in Product Category. +

+

+ + Search by code in Product Category. +

+

+ + Category search in products makes easier. +

+ +
+
+ + + +
+
+

+ Screenshots +

+

+ +
+ + This module allows you to add a code for the product category. +
+

+
+ +
+

+
+ As shown here, we can search the category by code. +
+

+
+ +
+

+ + Get the result. +

+
+ +
+ +

+
+ + No need to specify the category name for the search, we can search by code too. The search will check the category name as well as category code. +
+

+
+ +
+
+
+ + + + + +
+
+ cybrosys technologies +
+
+
+
+

+ Our Services +

+
+ + + +
+ +
+ + + +
+

+ + Odoo Support +

+ +
+ +
+
+
+
+
+

+ Our Industries +

+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Trading + +

+

+ Easily procure and sell your products. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Manufacturing +

+

+ Plan, track and schedule your operations. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Restaurant +

+

+ Run your bar or restaurant methodical. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + POS +

+

+ Easy configuring and convivial selling. +

+
+ +
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + E-commerce & Website +

+

+ Mobile friendly, awe-inspiring product pages. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Hotel Management +

+

+ An all-inclusive hotel management application. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Education +

+

+ A Collaborative platform for educational management. +

+
+
+
+ +
+
+ + Odoo Industry + +
+
+
+

+ + Service Management +

+

+ Keep track of services and invoice accordingly. +

+
+
+
+
+
+
+ +
+ + + + + + + + + + diff --git a/product_category_codes/static/description/product-category-codes-cybrosys-1.png b/product_category_codes/static/description/product-category-codes-cybrosys-1.png new file mode 100644 index 000000000..5f86095c4 Binary files /dev/null and b/product_category_codes/static/description/product-category-codes-cybrosys-1.png differ diff --git a/product_category_codes/static/description/product-category-codes-cybrosys-2.png b/product_category_codes/static/description/product-category-codes-cybrosys-2.png new file mode 100644 index 000000000..9b322cd83 Binary files /dev/null and b/product_category_codes/static/description/product-category-codes-cybrosys-2.png differ diff --git a/product_category_codes/static/description/product-category-codes-cybrosys-3.png b/product_category_codes/static/description/product-category-codes-cybrosys-3.png new file mode 100644 index 000000000..71e2f9899 Binary files /dev/null and b/product_category_codes/static/description/product-category-codes-cybrosys-3.png differ diff --git a/product_category_codes/static/description/product-category-codes-cybrosys-4.png b/product_category_codes/static/description/product-category-codes-cybrosys-4.png new file mode 100644 index 000000000..0ff5d94df Binary files /dev/null and b/product_category_codes/static/description/product-category-codes-cybrosys-4.png differ diff --git a/product_category_codes/static/description/search in category.png b/product_category_codes/static/description/search in category.png new file mode 100644 index 000000000..fe5823248 Binary files /dev/null and b/product_category_codes/static/description/search in category.png differ diff --git a/product_category_codes/views/product_category_code.xml b/product_category_codes/views/product_category_code.xml new file mode 100644 index 000000000..11f7fd1f5 --- /dev/null +++ b/product_category_codes/views/product_category_code.xml @@ -0,0 +1,38 @@ + + + + + product.category.code.search + product.category + + + + + + + + + + product.category.code.form + product.category + + + + + + + + + + product.category.list + product.category + 1 + + + + + + + + +