diff --git a/invoice_stock_move/README.rst b/invoice_stock_move/README.rst new file mode 100644 index 000000000..f13e30a61 --- /dev/null +++ b/invoice_stock_move/README.rst @@ -0,0 +1,38 @@ +Stock Picking From Invoice +========================== +This Module Enables To Create Stocks Picking From Customer/Supplier Invoice + +Configuration +============= +* No additional configurations needed + +Company +------- +* `Cybrosys Techno Solutions `__ + +Credits +------- +* Developers: Saritha Sahadevan @cybrosys, odoo@cybrosys.com + Muhammed P V14 @cybrosys, odoo@cybrosys.com + +Contacts +-------- +* Mail Contact : odoo@cybrosys.com +* Website : https://cybrosys.com + +Bug Tracker +----------- +Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. + +Maintainer +========== +.. image:: https://cybrosys.com/images/logo.png + :target: https://cybrosys.com + +This module is maintained by Cybrosys Technologies. + +For support and more information, please visit `Our Website `__ + +Further information +=================== +HTML Description: ``__ diff --git a/invoice_stock_move/__init__.py b/invoice_stock_move/__init__.py new file mode 100644 index 000000000..48fd56964 --- /dev/null +++ b/invoice_stock_move/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import models diff --git a/invoice_stock_move/__manifest__.py b/invoice_stock_move/__manifest__.py new file mode 100644 index 000000000..0bda77b66 --- /dev/null +++ b/invoice_stock_move/__manifest__.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +{ + 'name': "Stock Picking From Invoice", + 'version': '14.0.1.0.0', + 'summary': """Stock Picking From Customer/Supplier Invoice""", + 'description': """This Module Enables To Create Stocks Picking From Customer/Supplier Invoice""", + 'author': "Cybrosys Techno Solutions", + 'company': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'category': 'Accounting', + 'depends': ['base', 'account', 'stock', 'payment'], + 'data': ['views/invoice_stock_move_view.xml'], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/invoice_stock_move/doc/RELEASE_NOTES.md b/invoice_stock_move/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..ffe67d774 --- /dev/null +++ b/invoice_stock_move/doc/RELEASE_NOTES.md @@ -0,0 +1,7 @@ +## Module + +#### 05.10.2020 +#### Version 14.0.1.0.0 +#### ADD + +Initial Commit \ No newline at end of file diff --git a/invoice_stock_move/models/__init__.py b/invoice_stock_move/models/__init__.py new file mode 100644 index 000000000..c762ff19a --- /dev/null +++ b/invoice_stock_move/models/__init__.py @@ -0,0 +1,22 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from . import invoice_stock diff --git a/invoice_stock_move/models/invoice_stock.py b/invoice_stock_move/models/invoice_stock.py new file mode 100644 index 000000000..687a12016 --- /dev/null +++ b/invoice_stock_move/models/invoice_stock.py @@ -0,0 +1,175 @@ +# -*- coding: utf-8 -*- +############################################################################# +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2019-TODAY Cybrosys Technologies(). +# Author: Saritha Sahadevan @cybrosys(odoo@cybrosys.com) +# +# You can modify it under the terms of the GNU AFFERO +# GENERAL PUBLIC LICENSE (AGPL 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 AFFERO GENERAL PUBLIC LICENSE (AGPL v3) for more details. +# +# You should have received a copy of the GNU AFFERO GENERAL PUBLIC LICENSE +# (AGPL v3) along with this program. +# If not, see . +# +############################################################################# +from odoo.exceptions import UserError +from odoo import models, fields, api, _ + + +class InvoiceStockMove(models.Model): + _inherit = 'account.move' + + def _get_stock_type_ids(self): + data = self.env['stock.picking.type'].search([]) + + if self._context.get('default_move_type') == 'out_invoice': + for line in data: + if line.code == 'outgoing': + return line + if self._context.get('default_move_type') == 'in_invoice': + for line in data: + if line.code == 'incoming': + return line + + picking_count = fields.Integer(string="Count") + invoice_picking_id = fields.Many2one('stock.picking', string="Picking Id") + + picking_type_id = fields.Many2one('stock.picking.type', 'Picking Type', + default=_get_stock_type_ids, + help="This will determine picking type of incoming shipment") + + state = fields.Selection([ + ('draft', 'Draft'), + ('proforma', 'Pro-forma'), + ('proforma2', 'Pro-forma'), + ('posted', 'Posted'), + ('post', 'Post'), + ('cancel', 'Cancelled'), + ('done', 'Received'), + ], string='Status', index=True, readonly=True, default='draft', + track_visibility='onchange', copy=False) + + def action_stock_move(self): + if not self.picking_type_id: + raise UserError(_( + " Please select a picking type")) + for order in self: + if not self.invoice_picking_id: + pick = {} + if self.picking_type_id.code == 'outgoing': + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.name, + 'location_dest_id': self.partner_id.property_stock_customer.id, + 'location_id': self.picking_type_id.default_location_src_id.id, + 'move_type': 'direct' + } + if self.picking_type_id.code == 'incoming': + pick = { + 'picking_type_id': self.picking_type_id.id, + 'partner_id': self.partner_id.id, + 'origin': self.name, + 'location_dest_id': self.picking_type_id.default_location_dest_id.id, + 'location_id': self.partner_id.property_stock_supplier.id, + 'move_type': 'direct' + } + + picking = self.env['stock.picking'].create(pick) + self.invoice_picking_id = picking.id + self.picking_count = len(picking) + moves = order.invoice_line_ids.filtered( + lambda r: r.product_id.type in ['product', 'consu'])._create_stock_moves(picking) + move_ids = moves._action_confirm() + move_ids._action_assign() + + def action_view_picking(self): + action = self.env.ref('stock.action_picking_tree_ready') + result = action.read()[0] + result.pop('id', None) + result['context'] = {} + result['domain'] = [('id', '=', self.invoice_picking_id.id)] + pick_ids = sum([self.invoice_picking_id.id]) + if pick_ids: + res = self.env.ref('stock.view_picking_form', False) + result['views'] = [(res and res.id or False, 'form')] + result['res_id'] = pick_ids or False + return result + + def _reverse_moves(self, default_values_list=None, cancel=False): + ''' Reverse a recordset of account.move. + If cancel parameter is true, the reconcilable or liquidity lines + of each original move will be reconciled with its reverse's. + + :param default_values_list: A list of default values to consider per move. + ('type' & 'reversed_entry_id' are computed in the method). + :return: An account.move recordset, reverse of the current self. + ''' + + if self.picking_type_id.code == 'outgoing': + data = self.env['stock.picking.type'].search( + [('company_id', '=', self.company_id.id), ('code', '=', 'incoming')], limit=1) + self.picking_type_id = data.id + elif self.picking_type_id.code == 'incoming': + data = self.env['stock.picking.type'].search( + [('company_id', '=', self.company_id.id), ('code', '=', 'outgoing')], limit=1) + self.picking_type_id = data.id + reverse_moves = super(InvoiceStockMove, self)._reverse_moves() + return reverse_moves + + +class SupplierInvoiceLine(models.Model): + _inherit = 'account.move.line' + + def _create_stock_moves(self, picking): + moves = self.env['stock.move'] + done = self.env['stock.move'].browse() + for line in self: + price_unit = line.price_unit + if picking.picking_type_id.code == 'outgoing': + template = { + 'name': line.name or '', + 'product_id': line.product_id.id, + 'product_uom': line.product_uom_id.id, + 'location_id': picking.picking_type_id.default_location_src_id.id, + 'location_dest_id': line.move_id.partner_id.property_stock_customer.id, + 'picking_id': picking.id, + 'state': 'draft', + 'company_id': line.move_id.company_id.id, + 'price_unit': price_unit, + 'picking_type_id': picking.picking_type_id.id, + 'route_ids': 1 and [ + (6, 0, [x.id for x in self.env['stock.location.route'].search([('id', 'in', (2, 3))])])] or [], + 'warehouse_id': picking.picking_type_id.warehouse_id.id, + } + if picking.picking_type_id.code == 'incoming': + template = { + 'name': line.name or '', + 'product_id': line.product_id.id, + 'product_uom': line.product_uom_id.id, + 'location_id': line.move_id.partner_id.property_stock_supplier.id, + 'location_dest_id': picking.picking_type_id.default_location_dest_id.id, + 'picking_id': picking.id, + 'state': 'draft', + 'company_id': line.move_id.company_id.id, + 'price_unit': price_unit, + 'picking_type_id': picking.picking_type_id.id, + 'route_ids': 1 and [ + (6, 0, [x.id for x in self.env['stock.location.route'].search([('id', 'in', (2, 3))])])] or [], + 'warehouse_id': picking.picking_type_id.warehouse_id.id, + } + diff_quantity = line.quantity + tmp = template.copy() + tmp.update({ + 'product_uom_qty': diff_quantity, + }) + template['product_uom_qty'] = diff_quantity + done += moves.create(template) + return done diff --git a/invoice_stock_move/static/description/banner.png b/invoice_stock_move/static/description/banner.png new file mode 100644 index 000000000..554528f48 Binary files /dev/null and b/invoice_stock_move/static/description/banner.png differ diff --git a/invoice_stock_move/static/description/icon.png b/invoice_stock_move/static/description/icon.png new file mode 100644 index 000000000..2736ee0b4 Binary files /dev/null and b/invoice_stock_move/static/description/icon.png differ diff --git a/invoice_stock_move/static/description/images/banner_lifeline_for_task.jpeg b/invoice_stock_move/static/description/images/banner_lifeline_for_task.jpeg new file mode 100644 index 000000000..4a467ea22 Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_lifeline_for_task.jpeg differ diff --git a/invoice_stock_move/static/description/images/banner_project_report_xls_pdf.png b/invoice_stock_move/static/description/images/banner_project_report_xls_pdf.png new file mode 100644 index 000000000..3c430a7eb Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_project_report_xls_pdf.png differ diff --git a/invoice_stock_move/static/description/images/banner_project_status_report.png b/invoice_stock_move/static/description/images/banner_project_status_report.png new file mode 100644 index 000000000..d1b689710 Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_project_status_report.png differ diff --git a/invoice_stock_move/static/description/images/banner_subtask.jpeg b/invoice_stock_move/static/description/images/banner_subtask.jpeg new file mode 100644 index 000000000..f2b224110 Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_subtask.jpeg differ diff --git a/invoice_stock_move/static/description/images/banner_task_deadline_reminder.jpeg b/invoice_stock_move/static/description/images/banner_task_deadline_reminder.jpeg new file mode 100644 index 000000000..998679818 Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_task_deadline_reminder.jpeg differ diff --git a/invoice_stock_move/static/description/images/banner_task_statusbar.jpeg b/invoice_stock_move/static/description/images/banner_task_statusbar.jpeg new file mode 100644 index 000000000..2c57cbb7b Binary files /dev/null and b/invoice_stock_move/static/description/images/banner_task_statusbar.jpeg differ diff --git a/invoice_stock_move/static/description/images/checked.png b/invoice_stock_move/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/invoice_stock_move/static/description/images/checked.png differ diff --git a/invoice_stock_move/static/description/images/cust_transfer_validate.png b/invoice_stock_move/static/description/images/cust_transfer_validate.png new file mode 100644 index 000000000..0f6f3eb07 Binary files /dev/null and b/invoice_stock_move/static/description/images/cust_transfer_validate.png differ diff --git a/invoice_stock_move/static/description/images/customer invoice.png b/invoice_stock_move/static/description/images/customer invoice.png new file mode 100644 index 000000000..bbf299454 Binary files /dev/null and b/invoice_stock_move/static/description/images/customer invoice.png differ diff --git a/invoice_stock_move/static/description/images/cybrosys.png b/invoice_stock_move/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/invoice_stock_move/static/description/images/cybrosys.png differ diff --git a/invoice_stock_move/static/description/images/employee.png b/invoice_stock_move/static/description/images/employee.png new file mode 100644 index 000000000..be4468de3 Binary files /dev/null and b/invoice_stock_move/static/description/images/employee.png differ diff --git a/invoice_stock_move/static/description/images/task_timer_youtube.png b/invoice_stock_move/static/description/images/task_timer_youtube.png new file mode 100644 index 000000000..fb6579727 Binary files /dev/null and b/invoice_stock_move/static/description/images/task_timer_youtube.png differ diff --git a/invoice_stock_move/static/description/images/vendor bill.png b/invoice_stock_move/static/description/images/vendor bill.png new file mode 100644 index 000000000..9fe45978e Binary files /dev/null and b/invoice_stock_move/static/description/images/vendor bill.png differ diff --git a/invoice_stock_move/static/description/images/vendor_transfer_validate.png b/invoice_stock_move/static/description/images/vendor_transfer_validate.png new file mode 100644 index 000000000..afba99d3b Binary files /dev/null and b/invoice_stock_move/static/description/images/vendor_transfer_validate.png differ diff --git a/invoice_stock_move/static/description/index.html b/invoice_stock_move/static/description/index.html new file mode 100644 index 000000000..716f49901 --- /dev/null +++ b/invoice_stock_move/static/description/index.html @@ -0,0 +1,302 @@ +
cybrosys-logo
+
+
+
+

Stock Picking From Invoice

+

This Module Enables To Stock Pickings From Customer/Supplier Invoice.

+
+

Key Highlights

+
    +
  • Stock Picking From Customer Invoice.
  • +
  • Stock Picking From Supplier Invoice.
  • +
+
+
+
+ +
+
+
+
+ +
+
+ +

Overview

+
+

+ Currently in Odoo , We cannot transfer stocks directly from customer/supplier invoice. We need to depend sales module or purchase module to transfer or receive goods. This module enable to transfer stocks from invoices without depending sales and purchase module.

+
+
+ +

Stock Picking From Invoice

+
+
    +
  • + Stock Picking From Customer Invoice. +
  • + +
  • + Stock Picking From Supplier Invoice. +
  • +
+
+ +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

Our Industries

+
+ +
+
+
+ +
+
+

Trading

+

Easily procure and sell your products.

+
+
+
+
+ +
+
+

Manufacturing

+

Plan, track and schedule your operations.

+
+
+
+
+ +
+
+

Restaurant

+

Run your bar or restaurant methodical.

+
+
+
+
+ +
+
+

POS

+

Easy configuring and convivial selling.

+
+
+
+
+ +
+
+

E-commerce & Website

+

Mobile friendly, awe-inspiring product pages.

+
+
+
+
+ +
+
+

Hotel Management

+

An all-inclusive hotel management application.

+
+
+
+
+ +
+
+

Education

+

A Collaborative platform for educational management.

+
+
+
+
+ +
+
+

Service Management

+

Keep track of services and invoice accordingly.

+
+
+
+
+ +
+
+
+
+

Need Any Help?

+
+

If you have anything to share with us based on your use of this module, please let us know. We are ready to offer our support.

+
+

Email us

+

odoo@cybrosys.com / info@cybrosys.com

+
+
+

Contact Us

+ www.cybrosys.com +
+
+
+
+
+
+
+
+
+ +
+ + + + + + + +
+
+
+ \ No newline at end of file diff --git a/invoice_stock_move/views/invoice_stock_move_view.xml b/invoice_stock_move/views/invoice_stock_move_view.xml new file mode 100644 index 000000000..165ae21c8 --- /dev/null +++ b/invoice_stock_move/views/invoice_stock_move_view.xml @@ -0,0 +1,30 @@ + + + + + Move Name + account.move + + + + + + + + + \ No newline at end of file