diff --git a/sale_shipping_constrains/__init__.py b/sale_shipping_constrains/__init__.py new file mode 100644 index 000000000..427d284cf --- /dev/null +++ b/sale_shipping_constrains/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . +# +############################################################################## +import models diff --git a/sale_shipping_constrains/__openerp__.py b/sale_shipping_constrains/__openerp__.py new file mode 100644 index 000000000..edabdfbed --- /dev/null +++ b/sale_shipping_constrains/__openerp__.py @@ -0,0 +1,42 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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': 'Shipping Validation In Sales', + 'summary': 'Warning Message When Shipped Product is Greater Than Ordered Quantity', + 'version': '9.0.1.0.0', + 'category': 'Sales', + 'description': """Warning Message When Shipped Product is Greater Than Ordered Quantity""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'website': 'www.cybrosys.com', + 'depends': [ + 'base', + 'sale', + 'stock' + ], + 'images': ['static/description/banner.jpg'], + 'license': 'LGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/sale_shipping_constrains/models/__init__.py b/sale_shipping_constrains/models/__init__.py new file mode 100644 index 000000000..d5527380d --- /dev/null +++ b/sale_shipping_constrains/models/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 . +# +############################################################################## +import warning_sale_shipping diff --git a/sale_shipping_constrains/models/warning_sale_shipping.py b/sale_shipping_constrains/models/warning_sale_shipping.py new file mode 100644 index 000000000..86c196910 --- /dev/null +++ b/sale_shipping_constrains/models/warning_sale_shipping.py @@ -0,0 +1,39 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Cybrosys Technologies Pvt. Ltd. +# Copyright (C) 2016-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 openerp import models, api +from openerp.tools.translate import _ +from openerp.exceptions import UserError + + +class StockMoveWarning(models.Model): + _inherit = 'stock.move' + + @api.multi + def onchange_quantity(self, product_id, product_qty, product_uom): + qty_sales = 0 + for orders in self.env['sale.order'].search([('name', '=', self.picking_id.origin)]).order_line: + if orders.product_id == product_id: + qty_sales += orders.product_uom_qty + if product_qty > qty_sales: + raise UserError(_('You are trying to deliver more than ordered quantity')) + return super(StockMoveWarning, self).onchange_quantity(product_id, product_qty, product_uom) diff --git a/sale_shipping_constrains/static/description/banner.jpg b/sale_shipping_constrains/static/description/banner.jpg new file mode 100644 index 000000000..f3c0a1013 Binary files /dev/null and b/sale_shipping_constrains/static/description/banner.jpg differ diff --git a/sale_shipping_constrains/static/description/cybro_logo.png b/sale_shipping_constrains/static/description/cybro_logo.png new file mode 100644 index 000000000..bb309114c Binary files /dev/null and b/sale_shipping_constrains/static/description/cybro_logo.png differ diff --git a/sale_shipping_constrains/static/description/icon.png b/sale_shipping_constrains/static/description/icon.png new file mode 100644 index 000000000..5613b3e24 Binary files /dev/null and b/sale_shipping_constrains/static/description/icon.png differ diff --git a/sale_shipping_constrains/static/description/index.html b/sale_shipping_constrains/static/description/index.html new file mode 100644 index 000000000..f5803106f --- /dev/null +++ b/sale_shipping_constrains/static/description/index.html @@ -0,0 +1,47 @@ +
+
+

Shipping Validation In Sales

+

Creates a warning if you try to ship more products than mentioned in sale order

+

Author : Cybrosys Techno Solutions , www.cybrosys.com

+
+
+ +
+
+

Stock moves

+
+

+ ☛ Warning message when more products are shipped
+

+
+ +
+
+
+
+ +
+

Need Any Help?

+ +
diff --git a/sale_shipping_constrains/static/description/warning.png b/sale_shipping_constrains/static/description/warning.png new file mode 100644 index 000000000..07dcd15b4 Binary files /dev/null and b/sale_shipping_constrains/static/description/warning.png differ