diff --git a/sale_amount_check/README.rst b/sale_amount_check/README.rst new file mode 100644 index 000000000..fde7cccb1 --- /dev/null +++ b/sale_amount_check/README.rst @@ -0,0 +1,44 @@ +================== +Excess Amount Warning v11 +================== +Warning when a user try to pay down payment greater than sale order + +Contacts +======== +* Cybrosys Techno Solutions + +Depends +======= +[sale] addon Odoo +[stock] addon Odoo + + +Installation +============ +- www.odoo.com/documentation/11.0/setup/install.html +- Install our custom addon + + +License +======= + GNU Affero General Public License + (http://www.gnu.org/licenses/agpl.html) + +Bug Tracker +=========== + +Contact odoo@cybrosys.com + +Authors +------- +* Developer: Cybrosys Technologies + +Maintainer +---------- + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit https://www.cybrosys.com. + + + diff --git a/sale_amount_check/__init__.py b/sale_amount_check/__init__.py new file mode 100644 index 000000000..b11b437b9 --- /dev/null +++ b/sale_amount_check/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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/sale_amount_check/__manifest__.py b/sale_amount_check/__manifest__.py new file mode 100644 index 000000000..99684a0b0 --- /dev/null +++ b/sale_amount_check/__manifest__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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': 'Excess Amount Warning', + 'version': '11.0.1.0.0', + 'summary': 'Prevent Invoice Creation When Down Payment is Greater Than SO Total', + 'description': """Prevent Invoice Creation When Down Payment is Greater Than SO Total""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': "http://www.cybrosys.com", + 'category': 'Sales', + 'website': 'www.cybrosys.com', + 'depends': [ + 'base', + 'sale', + 'stock' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, +} diff --git a/sale_amount_check/models/__init__.py b/sale_amount_check/models/__init__.py new file mode 100644 index 000000000..b4d5290f1 --- /dev/null +++ b/sale_amount_check/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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 warning_sale_invoice diff --git a/sale_amount_check/models/warning_sale_invoice.py b/sale_amount_check/models/warning_sale_invoice.py new file mode 100644 index 000000000..a6cc8de25 --- /dev/null +++ b/sale_amount_check/models/warning_sale_invoice.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Cybrosys Technologies() +# 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, api, _ +from odoo.exceptions import UserError + + +class WarningOnSaleInvoice(models.TransientModel): + _inherit = 'sale.advance.payment.inv' + + @api.multi + def _create_invoice(self, order, so_line, amount): + total_inv = 0 + for invoices in self.env['account.invoice'].search([('origin', '=', order.name)]): + total_inv += invoices.amount_total + total_inv += amount + if total_inv > order.amount_total: + raise UserError(_('You are trying to invoice more than total price')) + return super(WarningOnSaleInvoice, self)._create_invoice(order, so_line, amount) + diff --git a/sale_amount_check/static/description/banner.jpg b/sale_amount_check/static/description/banner.jpg new file mode 100644 index 000000000..0674680b6 Binary files /dev/null and b/sale_amount_check/static/description/banner.jpg differ diff --git a/sale_amount_check/static/description/check-amount-cybrosys-1.png b/sale_amount_check/static/description/check-amount-cybrosys-1.png new file mode 100644 index 000000000..9bd214b5e Binary files /dev/null and b/sale_amount_check/static/description/check-amount-cybrosys-1.png differ diff --git a/sale_amount_check/static/description/cybro_logo.png b/sale_amount_check/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/sale_amount_check/static/description/cybro_logo.png differ diff --git a/sale_amount_check/static/description/icon.png b/sale_amount_check/static/description/icon.png new file mode 100644 index 000000000..e4c4bc8aa Binary files /dev/null and b/sale_amount_check/static/description/icon.png differ diff --git a/sale_amount_check/static/description/index.html b/sale_amount_check/static/description/index.html new file mode 100644 index 000000000..489411608 --- /dev/null +++ b/sale_amount_check/static/description/index.html @@ -0,0 +1,319 @@ +
+
+

+ Excess Amount Warning +

+

+ Warning for Down Payment +

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

+ Overview +

+

+ This Cybrosys's module allows you to get warning when a user try to pay down payment greater than sale order amount +

+
+
+
+
+

+ Features +

+

+ + warning when a user try to pay down payment greater than sale order +

+
+
+
+
+

+ Screenshots +

+

+ + Error message when you try to invoice a greater value than SO total amount +

+
+ +
+
+
+
+
+ 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/sale_amount_check/static/description/warning.png b/sale_amount_check/static/description/warning.png new file mode 100644 index 000000000..d3745c70e Binary files /dev/null and b/sale_amount_check/static/description/warning.png differ