diff --git a/product_approval_management/__init__.py b/product_approval_management/__init__.py new file mode 100644 index 000000000..c880c02b4 --- /dev/null +++ b/product_approval_management/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/product_approval_management/__manifest__.py b/product_approval_management/__manifest__.py new file mode 100644 index 000000000..a73837381 --- /dev/null +++ b/product_approval_management/__manifest__.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Product Approval", + 'summary': """Product Approval Management""", + 'description': """ + Using this module a user can create product which will be in + draft state and only a product manager can confirm the product. + Also only the confirmed products can be selected from + sale order line + """, + 'category': "Sales/Sales", + 'author': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'depends': ['sale_management'], + 'data': [ + 'security/approve_security.xml', + 'security/ir.model.access.csv', + 'views/product_approval_views.xml' + ], + 'images': ['static/description/banner.jpg'], + 'version': '14.0.1.0.0', + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': True, +} diff --git a/product_approval_management/models/__init__.py b/product_approval_management/models/__init__.py new file mode 100644 index 000000000..c880c02b4 --- /dev/null +++ b/product_approval_management/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from . import models diff --git a/product_approval_management/models/models.py b/product_approval_management/models/models.py new file mode 100644 index 000000000..a03d150a9 --- /dev/null +++ b/product_approval_management/models/models.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies() +# Author: Cybrosys Techno Solutions () +# +# You can modify it under the terms of the GNU LESSER +# GENERAL PUBLIC LICENSE (LGPL v3), Version 3. +# +# 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 +# (LGPL v3) along with this program. +# If not, see . +# +############################################################################# + +from odoo import fields, models + + +class ApproveProduct(models.Model): + _inherit = 'product.template' + + approve_state = fields.Selection([ + ('draft', 'Draft'), + ('confirmed', 'Confirmed') + ], default='draft') + + def confirm_product_approval(self): + for rec in self: + rec.approve_state = 'confirmed' + + def reset_product_approval(self): + for rec in self: + rec.approve_state = 'draft' + + +class SaleOrderLine(models.Model): + _inherit = 'sale.order.line' + + product_id = fields.Many2one( + 'product.product', string='Product', + domain="[('approve_state', '=', 'confirmed'), ('sale_ok', '=', True), '|', ('company_id', '=', False),('company_id', '=', company_id)]", + change_default=True, ondelete='restrict', check_company=True) diff --git a/product_approval_management/security/approve_security.xml b/product_approval_management/security/approve_security.xml new file mode 100644 index 000000000..99a6ad12a --- /dev/null +++ b/product_approval_management/security/approve_security.xml @@ -0,0 +1,8 @@ + + + + + Product Manager + + + \ No newline at end of file diff --git a/product_approval_management/security/ir.model.access.csv b/product_approval_management/security/ir.model.access.csv new file mode 100644 index 000000000..5868fd8ef --- /dev/null +++ b/product_approval_management/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_manager,product.template,model_product_template,product_manager,1,1,1,1 + diff --git a/product_approval_management/static/description/banner.jpg b/product_approval_management/static/description/banner.jpg new file mode 100644 index 000000000..356fbc2ce Binary files /dev/null and b/product_approval_management/static/description/banner.jpg differ diff --git a/product_approval_management/static/description/icon.png b/product_approval_management/static/description/icon.png new file mode 100644 index 000000000..2ee39d5df Binary files /dev/null and b/product_approval_management/static/description/icon.png differ diff --git a/product_approval_management/static/description/images/confirm_button.png b/product_approval_management/static/description/images/confirm_button.png new file mode 100644 index 000000000..498d9249c Binary files /dev/null and b/product_approval_management/static/description/images/confirm_button.png differ diff --git a/product_approval_management/static/description/images/cybro_logo.png b/product_approval_management/static/description/images/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/product_approval_management/static/description/images/cybro_logo.png differ diff --git a/product_approval_management/static/description/images/draft_state.png b/product_approval_management/static/description/images/draft_state.png new file mode 100644 index 000000000..b802b91f6 Binary files /dev/null and b/product_approval_management/static/description/images/draft_state.png differ diff --git a/product_approval_management/static/description/images/product_manager.png b/product_approval_management/static/description/images/product_manager.png new file mode 100644 index 000000000..19ccd9ee8 Binary files /dev/null and b/product_approval_management/static/description/images/product_manager.png differ diff --git a/product_approval_management/static/description/images/reset_to_draft.png b/product_approval_management/static/description/images/reset_to_draft.png new file mode 100644 index 000000000..e8d52bea0 Binary files /dev/null and b/product_approval_management/static/description/images/reset_to_draft.png differ diff --git a/product_approval_management/static/description/images/sale_order_line.png b/product_approval_management/static/description/images/sale_order_line.png new file mode 100644 index 000000000..d313cd42d Binary files /dev/null and b/product_approval_management/static/description/images/sale_order_line.png differ diff --git a/product_approval_management/static/description/index.html b/product_approval_management/static/description/index.html new file mode 100644 index 000000000..dd4a144a4 --- /dev/null +++ b/product_approval_management/static/description/index.html @@ -0,0 +1,697 @@ + + + + + + + + Approval For Products + + + + + +
+
+
+ +
+
+ +
+

+ Product Approval

+ +

+ Approval Management provides users Approval Feature on product creation, and only approved products can be used in sale orders +

+ + Key Highlights + +
+
+
+ +
    +
  • New User group Product Manager is created +
  • +
  • Only the Product Manager can Approve the products created +
  • +
  • By default the products creation will be in draft state +
  • +
  • Only the confirmed Products can be selected in Sale Order +
  • +
+
+
+
+ +
+ + + + + + + + + + + + + +
+ +
+
+
+ + +
+
+ +
+
+

+ Overview

+ +

Introducing Approval For Products in version 14 community. The module helps provides users with an Approval Feature on product creation and only those approved products can be used in sale orders

+
+
+

+ Features

+
    +
  • +
    + New User group Product Manager is created
    +
  • +
  • +
    + Only the Product Manager can Approve the products created
    +
  • +
  • +
    + By default the products creation will be in draft state
    +
  • +
  • +
    + Only the confirmed Products can be selected in Sale Order
    +
  • +
  • +
    + Product Manager Can also reset the confirm state to draft
    +
  • +
+
+
+

+ Screenshots

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

+ Suggested Products

+
+ +
+ + +
+ +
+
+ Odoo Gold Partner +
+
+

+ Our Services

+

We provide following services

+ +
+
+
+ Odoo Gold Partner +
+
+ + +
+ +
+ + +
+
+
+

+ Need Help?

+
+
+
+ + +
+
+
Visit us
+

Visit our + website for more + information.

+ www.cybrosys.com +
+ +
+
Write to us
+

Do you + have any queries regarding our + products & services? Let us know.

+ odoo@cybrosys.com + info@cybrosys.com +
+ b + +
+
Follow Us
+

Follow us + on social media for latest + updates.

+
+ + + + + + +
+ +
+ +
+
+
+ +
+
+ +
+ +
+ +
+
+ +
+
+
+ + + + diff --git a/product_approval_management/views/product_approval_views.xml b/product_approval_management/views/product_approval_views.xml new file mode 100644 index 000000000..53b502fa8 --- /dev/null +++ b/product_approval_management/views/product_approval_views.xml @@ -0,0 +1,38 @@ + + + + approval + product.template + + +
+
+ +
+
+ + + approval + sale.order + + + + [('approve_state', '=', 'confirmed'), ('sale_ok', '=', True), '|', ('company_id', '=', False),('company_id', '=', company_id)] + + + + + + +
+