diff --git a/stock_intercompany_transfer/README.rst b/stock_intercompany_transfer/README.rst new file mode 100644 index 000000000..37658daae --- /dev/null +++ b/stock_intercompany_transfer/README.rst @@ -0,0 +1,43 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +Inter Company Stock Transfer +============================ + +Inter Company Stock Transfer +- Create counterpart Receipt/Delivery Orders between companies + +Installation +============ +- www.odoo.com/documentation/13.0/setup/install.html +- Install our custom addon + +Company +------- +* `Cybrosys Techno Solutions `__ + +Author +------- +Cybrosys Techno Solutions + +Contacts +-------- +* Mail Contact : odoo@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: ``__ \ No newline at end of file diff --git a/stock_intercompany_transfer/__init__.py b/stock_intercompany_transfer/__init__.py new file mode 100644 index 000000000..27ac04d78 --- /dev/null +++ b/stock_intercompany_transfer/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import models diff --git a/stock_intercompany_transfer/__manifest__.py b/stock_intercompany_transfer/__manifest__.py new file mode 100644 index 000000000..64e10894f --- /dev/null +++ b/stock_intercompany_transfer/__manifest__.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +{ + 'name': 'Inter Company Stock Transfer', + 'version': '13.0.1.0.0', + 'summary': """Create counterpart Receipt/Delivery Orders between companies.""", + 'description': """Automatically Create Receipt/Delivery orders if any company validates a + Deliver Order/Receipt to the selected company,Inter Company Stock Transfer, Stock Transfer, + Create counterpart Receipt/Delivery Orders between companies""", + 'category': 'Warehouse', + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['stock', 'account'], + 'data': [ + 'views/res_company_view.xml', + ], + 'images': ['static/description/banner.png'], + 'license': 'AGPL-3', + 'installable': True, + 'auto_install': False, + 'application': False, +} diff --git a/stock_intercompany_transfer/doc/RELEASE_NOTES.md b/stock_intercompany_transfer/doc/RELEASE_NOTES.md new file mode 100644 index 000000000..ee0b06148 --- /dev/null +++ b/stock_intercompany_transfer/doc/RELEASE_NOTES.md @@ -0,0 +1,9 @@ +## Module + +#### 30.01.2020 +#### Version 13.0.1.0.0 +##### ADD + +- Initial Commit for stock_intercompany_transfer + + diff --git a/stock_intercompany_transfer/models/__init__.py b/stock_intercompany_transfer/models/__init__.py new file mode 100644 index 000000000..be457f116 --- /dev/null +++ b/stock_intercompany_transfer/models/__init__.py @@ -0,0 +1,25 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from . import res_company +from . import stock_picking diff --git a/stock_intercompany_transfer/models/res_company.py b/stock_intercompany_transfer/models/res_company.py new file mode 100644 index 000000000..c7e0aae0c --- /dev/null +++ b/stock_intercompany_transfer/models/res_company.py @@ -0,0 +1,68 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import models, fields, api, exceptions, _ + + +class ResCompanyInherit(models.Model): + _inherit = 'res.company' + + enable_inter_company_transfer = fields.Boolean(string='Inter Company Transfer', copy=False) + destination_warehouse_id = fields.Many2one('stock.warehouse', string='Warehouse') + apply_transfer_type = fields.Selection([('all', 'Delivery and Receipts'), + ('incoming', 'Receipt'), + ('outgoing', 'Delivery Order')], string='Apply On', default='all', + help="Select the Picking type to apply the inter company transfer") + message = fields.Text(string="Message", compute='compute_message') + + @api.depends('apply_transfer_type', 'destination_warehouse_id') + def compute_message(self): + """Creating the Display message according to the selected type.""" + for rec in self: + if rec.apply_transfer_type == 'incoming': + create_type = "Delivery" + selected_type = "Receipt" + elif rec.apply_transfer_type == 'outgoing': + create_type = "Receipt" + selected_type = "Delivery" + else: + create_type = "Delivery Order/Receipt" + selected_type = "Receipt/Delivery" + + msg = _("Create a %s Order when a company validate a " + "%s Order for %s using %s Warehouse.") % (create_type, selected_type, rec.sudo().name, + rec.sudo().destination_warehouse_id.name) + rec.message = msg + + @api.onchange('enable_inter_company_transfer') + def onchange_inter_company_transfer(self): + company = self._origin + wh = self.env['stock.warehouse'].sudo().search([('company_id', '=', company.sudo().id)], limit=1, order='id ASC') + self.destination_warehouse_id = wh + + + + + + + diff --git a/stock_intercompany_transfer/models/stock_picking.py b/stock_intercompany_transfer/models/stock_picking.py new file mode 100644 index 000000000..fe52df5fe --- /dev/null +++ b/stock_intercompany_transfer/models/stock_picking.py @@ -0,0 +1,107 @@ +# -*- coding: utf-8 -*- +################################################################################### +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2020-TODAY Cybrosys Technologies (). +# Author: Cybrosys Techno Solutions () +# +# This program is free software: you can modify +# it under the terms of the GNU Affero General Public License (AGPL) as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# 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 for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +################################################################################### + +from odoo import models, fields, api, exceptions, _ +from odoo.exceptions import UserError + + +class StockPickingInherit(models.Model): + _inherit = 'stock.picking' + + auto_generated = fields.Boolean(string='Auto Generated Transfer', copy=False, + help="Field helps to check the picking is created from an another picking or not") + + def button_validate(self): + """Creating the internal transfer if it is not created from another picking""" + res = super(StockPickingInherit, self).button_validate() + if not self.auto_generated: + self.create_intercompany_transfer() + return res + + def create_intercompany_transfer(self): + """Creating the transfer if the selected company is enabled the internal transfer option""" + company_id = self.env['res.company'].sudo().search([('partner_id', '=', self.partner_id.id)], limit=1) + operation_type_id = False + location_id = False + location_dest_id = False + + if company_id and company_id.enable_inter_company_transfer: + create_transfer = False + if self.picking_type_id.code == company_id.apply_transfer_type or company_id.apply_transfer_type == 'all': + create_transfer = True + if create_transfer: + warehouse_ids = company_id.destination_warehouse_id.sudo() + if self.picking_type_id.code == 'incoming': + operation_type_id = self.env['stock.picking.type'].sudo().search( + [('warehouse_id', 'in', warehouse_ids.ids), ('code', '=', 'outgoing')], limit=1) + + elif self.picking_type_id.code == 'outgoing': + operation_type_id = self.env['stock.picking.type'].sudo().search( + [('warehouse_id', 'in', warehouse_ids.ids), ('code', '=', 'incoming')], limit=1) + else: + raise UserError(_('Internal transfer between companies are not allowed')) + + if operation_type_id: + if operation_type_id.default_location_src_id: + location_id = operation_type_id.default_location_src_id.id + elif self.company_id.partner_id: + location_id = self.partner_id.property_stock_supplier.id + + if operation_type_id.default_location_dest_id: + location_dest_id = operation_type_id.default_location_dest_id.id + elif company_id.partner_id: + location_dest_id = company_id.partner_id.property_stock_customer.id + if location_id and location_dest_id: + picking_vals = { + 'partner_id': self.company_id.partner_id.id, + 'company_id': company_id.id, + 'picking_type_id': operation_type_id.id, + 'location_id': location_id, + 'location_dest_id': location_dest_id, + 'auto_generated': True, + 'origin': self.name + } + picking_id = self.env['stock.picking'].sudo().create(picking_vals) + else: + raise UserError(_('Please configure appropriate locations on Operation type/Partner')) + + for move in self.move_lines: + lines = self.move_line_ids.filtered(lambda x: x.product_id == move.product_id) + done_qty = sum(lines.mapped('qty_done')) + if not done_qty: + done_qty = sum(lines.mapped('product_uom_qty')) + move_vals = { + 'picking_id': picking_id.id, + 'picking_type_id': operation_type_id.id, + 'name': move.name, + 'product_id': move.product_id.id, + 'product_uom': move.product_uom.id, + 'product_uom_qty': done_qty, + 'location_id': location_id, + 'location_dest_id': location_dest_id, + 'company_id': company_id.id + } + self.env['stock.move'].sudo().create(move_vals) + if picking_id: + picking_id.sudo().action_confirm() + picking_id.sudo().action_assign() diff --git a/stock_intercompany_transfer/static/description/banner.png b/stock_intercompany_transfer/static/description/banner.png new file mode 100644 index 000000000..16231a891 Binary files /dev/null and b/stock_intercompany_transfer/static/description/banner.png differ diff --git a/stock_intercompany_transfer/static/description/icon.png b/stock_intercompany_transfer/static/description/icon.png new file mode 100644 index 000000000..a0bdb78c3 Binary files /dev/null and b/stock_intercompany_transfer/static/description/icon.png differ diff --git a/stock_intercompany_transfer/static/description/images/banner_barcode_scanning.jpeg b/stock_intercompany_transfer/static/description/images/banner_barcode_scanning.jpeg new file mode 100644 index 000000000..529143e4e Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/banner_barcode_scanning.jpeg differ diff --git a/stock_intercompany_transfer/static/description/images/banner_currency_total.png b/stock_intercompany_transfer/static/description/images/banner_currency_total.png new file mode 100644 index 000000000..6153ed719 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/banner_currency_total.png differ diff --git a/stock_intercompany_transfer/static/description/images/banner_customer_sequence.jpeg b/stock_intercompany_transfer/static/description/images/banner_customer_sequence.jpeg new file mode 100644 index 000000000..7451342d6 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/banner_customer_sequence.jpeg differ diff --git a/stock_intercompany_transfer/static/description/images/checked.png b/stock_intercompany_transfer/static/description/images/checked.png new file mode 100644 index 000000000..578cedb80 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/checked.png differ diff --git a/stock_intercompany_transfer/static/description/images/cybrosys.png b/stock_intercompany_transfer/static/description/images/cybrosys.png new file mode 100644 index 000000000..d76b5bafb Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/cybrosys.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_1.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_1.png new file mode 100644 index 000000000..191c3de6e Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_1.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_2.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_2.png new file mode 100644 index 000000000..41f98e400 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_2.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_3.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_3.png new file mode 100644 index 000000000..f6f576c94 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_3.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_4.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_4.png new file mode 100644 index 000000000..978fda97b Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_4.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_5.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_5.png new file mode 100644 index 000000000..7e9715c88 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_5.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_6.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_6.png new file mode 100644 index 000000000..1a843b713 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_6.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_7.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_7.png new file mode 100644 index 000000000..06ef319d3 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_7.png differ diff --git a/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_8.png b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_8.png new file mode 100644 index 000000000..286635d68 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/dynamic_partner_fields_8.png differ diff --git a/stock_intercompany_transfer/static/description/images/export_stockinfo_xls.png b/stock_intercompany_transfer/static/description/images/export_stockinfo_xls.png new file mode 100644 index 000000000..a8dade6e9 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/export_stockinfo_xls.png differ diff --git a/stock_intercompany_transfer/static/description/images/inter_company_transfer.png b/stock_intercompany_transfer/static/description/images/inter_company_transfer.png new file mode 100644 index 000000000..a3da47ab1 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/inter_company_transfer.png differ diff --git a/stock_intercompany_transfer/static/description/images/inter_company_transfer1.png b/stock_intercompany_transfer/static/description/images/inter_company_transfer1.png new file mode 100644 index 000000000..a9c4b7024 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/inter_company_transfer1.png differ diff --git a/stock_intercompany_transfer/static/description/images/inter_company_transfer2.png b/stock_intercompany_transfer/static/description/images/inter_company_transfer2.png new file mode 100644 index 000000000..0ed12885e Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/inter_company_transfer2.png differ diff --git a/stock_intercompany_transfer/static/description/images/inter_company_transfer3.png b/stock_intercompany_transfer/static/description/images/inter_company_transfer3.png new file mode 100644 index 000000000..6533da654 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/inter_company_transfer3.png differ diff --git a/stock_intercompany_transfer/static/description/images/inter_company_transfer4.png b/stock_intercompany_transfer/static/description/images/inter_company_transfer4.png new file mode 100644 index 000000000..ea819fa4d Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/inter_company_transfer4.png differ diff --git a/stock_intercompany_transfer/static/description/images/invoice_stock_move.png b/stock_intercompany_transfer/static/description/images/invoice_stock_move.png new file mode 100644 index 000000000..11d1b194a Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/invoice_stock_move.png differ diff --git a/stock_intercompany_transfer/static/description/images/stock_move_invoice.png b/stock_intercompany_transfer/static/description/images/stock_move_invoice.png new file mode 100644 index 000000000..29b279a12 Binary files /dev/null and b/stock_intercompany_transfer/static/description/images/stock_move_invoice.png differ diff --git a/stock_intercompany_transfer/static/description/index.html b/stock_intercompany_transfer/static/description/index.html new file mode 100644 index 000000000..db60c0e5e --- /dev/null +++ b/stock_intercompany_transfer/static/description/index.html @@ -0,0 +1,517 @@ +
+ cybrosys-logo
+
+
+
+

Inter Company Stock Transfer

+

Automatically create Receipt/Delivery orders if any company validates a + Deliver order/Receipt to the selected company

+
+

Key Highlights

+
    +
  • check + Automatically create Receipt/Delivery orders if any company validates a + Deliver order/Receipt to the selected company +
  • +
  • check + Option to choose whether it can apply to Receipt orders, Delivery Orders or both +
  • +
+
+
+
+
+
+
+
+ +
+
+ +

Overview

+
+

+ Inter Company Stock Transfer module will help to automatically create a Receipt/Delivery order + if any company validates a Deliver order/Receipt to the selected company. +

+
+
+ +

Inter Company Stock Transfer

+
+
    +
  • + check + Automatically create Receipt/Delivery orders if any company validates a + Deliver order/Receipt to the selected company +
  • +
  • + check + Option to choose whether it can apply to Receipt orders, Delivery Orders or both +
  • +
  • + check + Option to choose the destination Warehouse in the selected company. +
  • +
+
+ + +
+
+

Screenshots

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

Suggested Products

+
+ +
+
+

Our Service

+
+ +
+
+
+

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.

+
+
+
+
+
+ +
+
+
+

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/stock_intercompany_transfer/views/res_company_view.xml b/stock_intercompany_transfer/views/res_company_view.xml new file mode 100644 index 000000000..4187222d1 --- /dev/null +++ b/stock_intercompany_transfer/views/res_company_view.xml @@ -0,0 +1,31 @@ + + + + + res.company.stock.inter.company + res.company + + + + + + + + + + + + +
+ +
+
+
+
+
+
+
+
+
\ No newline at end of file