diff --git a/fleet_rental/__manifest__.py~ b/fleet_rental/__manifest__.py~ index 7b7088bec..979ecf616 100644 --- a/fleet_rental/__manifest__.py~ +++ b/fleet_rental/__manifest__.py~ @@ -22,7 +22,7 @@ ############################################################################## { 'name': 'Fleet Rental Management', - 'summary': """This module will helps you to give the vehicles for Rent.""", + 'summary': """The Complete Solution for a Car/Vehicle Rental System""", 'version': '10.0.2.0.0', 'author': 'Cybrosys Techno Solutions', 'website': "http://www.cybrosys.com", diff --git a/product_category_codes/README.rst b/product_category_codes/README.rst new file mode 100644 index 000000000..715387f10 --- /dev/null +++ b/product_category_codes/README.rst @@ -0,0 +1,16 @@ +========================= +Product Category Code v10 +========================= + 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, nikhil@cybrosys.in \ No newline at end of file diff --git a/product_category_codes/__init__.py b/product_category_codes/__init__.py new file mode 100644 index 000000000..3e3d78902 --- /dev/null +++ b/product_category_codes/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- + +############################################################################## +# +# 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 . +# +############################################################################## + +import models diff --git a/product_category_codes/__manifest__.py b/product_category_codes/__manifest__.py new file mode 100644 index 000000000..79f6263c1 --- /dev/null +++ b/product_category_codes/__manifest__.py @@ -0,0 +1,41 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-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': '10.0.1.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/models/__init__.py b/product_category_codes/models/__init__.py new file mode 100644 index 000000000..9d09e9457 --- /dev/null +++ b/product_category_codes/models/__init__.py @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-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 . +# +############################################################################## + +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..926febeb2 --- /dev/null +++ b/product_category_codes/models/product_category.py @@ -0,0 +1,64 @@ +# -*- coding: utf-8 -*- +# +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2017-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..b9ae2cc54 --- /dev/null +++ b/product_category_codes/static/description/index.html @@ -0,0 +1,98 @@ +
+
+
+

Product Category Code

+

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

+

Cybrosys Technologies

+
+
+

Major Features:

+
    +
  •    Allows to add code in Product Category.
  • +
  •    Search by code in Product Category.
  • +
  •    Category search in products make more easy.
  • +
+
+
+
+ +
+
+
+

Code in product category.

+
+ +
+
+
+

+

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.

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

Search in product list by category

+
+
+ +
+
+
+

+ 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. +

+
+
+
+ +
+

Need Any Help?

+ +
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..648be63ef --- /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 + + + + + + + + +