diff --git a/stock_intercompany_transfer/README.rst b/stock_intercompany_transfer/README.rst new file mode 100644 index 000000000..7e1ee2d6d --- /dev/null +++ b/stock_intercompany_transfer/README.rst @@ -0,0 +1,53 @@ +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.svg + :target: https://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 + +Configuration +============= +No additional configurations needed. + +Company +------- +* `Cybrosys Techno Solutions `__ + +License +------- +General Public License, Version 3 (AGPL v3). +(https://www.gnu.org/licenses/agpl-3.0-standalone.html) + +Credits +------- +* Developer: + (V15) Midilaj V K, + (V16) Pranav T V, + (V17) Jumana Haseen, + (V18) Manasa T P +Contact : 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/stock_intercompany_transfer/__init__.py b/stock_intercompany_transfer/__init__.py new file mode 100644 index 000000000..91cca6012 --- /dev/null +++ b/stock_intercompany_transfer/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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 +from . import wizard diff --git a/stock_intercompany_transfer/__manifest__.py b/stock_intercompany_transfer/__manifest__.py new file mode 100644 index 000000000..f5d5d1713 --- /dev/null +++ b/stock_intercompany_transfer/__manifest__.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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': '18.0.1.0.0', + 'category': 'Inventory', + '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""", + 'author': 'Cybrosys Techno Solutions', + 'company': 'Cybrosys Techno Solutions', + 'maintainer': 'Cybrosys Techno Solutions', + 'website': "https://www.cybrosys.com", + 'depends': ['stock', 'account'], + 'data': [ + 'views/res_company_views.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..0ff6b8623 --- /dev/null +++ b/stock_intercompany_transfer/doc/RELEASE_NOTES.md @@ -0,0 +1,6 @@ +## Module + +#### 08.11.2024 +#### Version 18.0.1.0.0 +##### ADD +- Initial Commit for Inter Company Stock Transfer diff --git a/stock_intercompany_transfer/models/__init__.py b/stock_intercompany_transfer/models/__init__.py new file mode 100644 index 000000000..7b8a6c702 --- /dev/null +++ b/stock_intercompany_transfer/models/__init__.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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..b113e1a8e --- /dev/null +++ b/stock_intercompany_transfer/models/res_company.py @@ -0,0 +1,84 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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 api, fields, models, _ + + +class ResCompany(models.Model): + """Inherits 'res.company' and adds fields""" + _inherit = 'res.company' + + enable_inter_company_transfer = fields.Boolean(string='Inter Company ' + 'Transfer', + copy=False, + help="Enable/disable inter " + "company transfer to" + "select " + "delivery/receipts.") + destination_warehouse_id = fields.Many2one('stock.warehouse', + string='Warehouse', + help="Select the destination" + " warehouse of the" + " company.") + 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', + help="Message shown on selecting the type " + "of orders.") + + @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): + """Function to execute on changing the boolean field Inter Company + transfer to search for the warehouse""" + 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..a91899ad9 --- /dev/null +++ b/stock_intercompany_transfer/models/stock_picking.py @@ -0,0 +1,142 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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, _ +from odoo.exceptions import UserError + + +class StockPickingInherit(models.Model): + """This class inherits 'stock.picking' and adds required fields """ + _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") + is_backorder_button_clicked = fields.Boolean(default=False, + string='Backorder' + ' Button Clicked') + + def button_validate(self): + """Creating the internal transfer if it is not created + from another picking""" + active_move = [] + greater_quantity = [] + for move in self.move_ids: + if move.quantity != 0.0: + if (move.quantity < move.product_uom_qty or + move.quantity > move.product_uom_qty): + active_move.append(move.id) + if move.quantity > move.product_uom_qty: + greater_quantity.append(move.id) + if len(greater_quantity) == self.move_ids.search_count([( + 'picking_id', '=', self.id)]): + if not self.auto_generated: + self.create_intercompany_transfer() + if not self.move_ids.search( + [('picking_id', '=', self.id), ('quantity', '=', 0.0)]): + if not active_move: + if not self.auto_generated: + self.create_intercompany_transfer() + return super(StockPickingInherit, self).button_validate() + + 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_ids: + lines = self.move_line_ids.filtered( + lambda x: x.product_id == move.product_id) + done_qty = sum(lines.mapped('quantity')) + if not done_qty: + done_qty = sum(lines.move_id.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/assets/cybro-icon.png b/stock_intercompany_transfer/static/description/assets/cybro-icon.png new file mode 100755 index 000000000..06e73e11d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/cybro-icon.png differ diff --git a/stock_intercompany_transfer/static/description/assets/cybro-odoo.png b/stock_intercompany_transfer/static/description/assets/cybro-odoo.png new file mode 100755 index 000000000..ed02e07a4 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/cybro-odoo.png differ diff --git a/stock_intercompany_transfer/static/description/assets/h2.png b/stock_intercompany_transfer/static/description/assets/h2.png new file mode 100755 index 000000000..0bfc4707d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/h2.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/arrows-repeat.svg b/stock_intercompany_transfer/static/description/assets/icons/arrows-repeat.svg new file mode 100755 index 000000000..1d7efabc5 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/arrows-repeat.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-1.png b/stock_intercompany_transfer/static/description/assets/icons/banner-1.png new file mode 100755 index 000000000..c180db172 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/banner-1.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-2.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-2.svg new file mode 100755 index 000000000..e606d97d9 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-2.svg @@ -0,0 +1,73 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-bg.png b/stock_intercompany_transfer/static/description/assets/icons/banner-bg.png new file mode 100755 index 000000000..a8238d3c0 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/banner-bg.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-bg.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-bg.svg new file mode 100755 index 000000000..b1378103e --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-bg.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-call.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-call.svg new file mode 100755 index 000000000..96c687e81 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-call.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-mail.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-mail.svg new file mode 100755 index 000000000..cbf0d158d --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-mail.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-pattern.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-pattern.svg new file mode 100755 index 000000000..9c1c7e101 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-pattern.svg @@ -0,0 +1,343 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/banner-promo.svg b/stock_intercompany_transfer/static/description/assets/icons/banner-promo.svg new file mode 100755 index 000000000..d52791b11 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/banner-promo.svg @@ -0,0 +1,147 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/brand-pair.svg b/stock_intercompany_transfer/static/description/assets/icons/brand-pair.svg new file mode 100755 index 000000000..d8db7fc1e --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/brand-pair.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/check.png b/stock_intercompany_transfer/static/description/assets/icons/check.png new file mode 100755 index 000000000..c8e85f51d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/check.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/chevron.png b/stock_intercompany_transfer/static/description/assets/icons/chevron.png new file mode 100755 index 000000000..2089293d6 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/chevron.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/close-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/close-icon.svg new file mode 100755 index 000000000..df8cce37a --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/close-icon.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/cogs.png b/stock_intercompany_transfer/static/description/assets/icons/cogs.png new file mode 100755 index 000000000..95d0bad62 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/cogs.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/collabarate-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/collabarate-icon.svg new file mode 100755 index 000000000..dd4e10518 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/collabarate-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/consultation.png b/stock_intercompany_transfer/static/description/assets/icons/consultation.png new file mode 100755 index 000000000..8319d4baa Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/consultation.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/cybro-logo.png b/stock_intercompany_transfer/static/description/assets/icons/cybro-logo.png new file mode 100755 index 000000000..ff4b78220 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/cybro-logo.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/down.svg b/stock_intercompany_transfer/static/description/assets/icons/down.svg new file mode 100755 index 000000000..f21c36271 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/down.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/stock_intercompany_transfer/static/description/assets/icons/ecom-black.png b/stock_intercompany_transfer/static/description/assets/icons/ecom-black.png new file mode 100755 index 000000000..a9385ff13 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/ecom-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/education-black.png b/stock_intercompany_transfer/static/description/assets/icons/education-black.png new file mode 100755 index 000000000..3eb09b27b Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/education-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/faq.png b/stock_intercompany_transfer/static/description/assets/icons/faq.png new file mode 100755 index 000000000..4250b5b81 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/faq.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/feature-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/feature-icon.svg new file mode 100755 index 000000000..fa0ea6850 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/feature-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/feature.png b/stock_intercompany_transfer/static/description/assets/icons/feature.png new file mode 100755 index 000000000..ac7a785c0 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/feature.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/gear.svg b/stock_intercompany_transfer/static/description/assets/icons/gear.svg new file mode 100755 index 000000000..0cc66b6ea --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/gear.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/hero.gif b/stock_intercompany_transfer/static/description/assets/icons/hero.gif new file mode 100644 index 000000000..e2c4eaeab Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/hero.gif differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/hire-odoo.svg b/stock_intercompany_transfer/static/description/assets/icons/hire-odoo.svg new file mode 100755 index 000000000..e1ac089b0 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/hire-odoo.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/hotel-black.png b/stock_intercompany_transfer/static/description/assets/icons/hotel-black.png new file mode 100755 index 000000000..130f613be Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/hotel-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/license.png b/stock_intercompany_transfer/static/description/assets/icons/license.png new file mode 100755 index 000000000..a5869797e Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/license.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/life-ring-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/life-ring-icon.svg new file mode 100755 index 000000000..3ae6e1d89 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/life-ring-icon.svg @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/lifebuoy.png b/stock_intercompany_transfer/static/description/assets/icons/lifebuoy.png new file mode 100755 index 000000000..658d56ccc Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/lifebuoy.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/mail.svg b/stock_intercompany_transfer/static/description/assets/icons/mail.svg new file mode 100755 index 000000000..1eedde695 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/mail.svg @@ -0,0 +1,3 @@ + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/manufacturing-black.png b/stock_intercompany_transfer/static/description/assets/icons/manufacturing-black.png new file mode 100755 index 000000000..697eb0e9f Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/manufacturing-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/notes.png b/stock_intercompany_transfer/static/description/assets/icons/notes.png new file mode 100755 index 000000000..ee5e95404 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/notes.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/notification icon.svg b/stock_intercompany_transfer/static/description/assets/icons/notification icon.svg new file mode 100755 index 000000000..053189973 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/notification icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/odoo-consultancy.svg b/stock_intercompany_transfer/static/description/assets/icons/odoo-consultancy.svg new file mode 100755 index 000000000..e05f65bde --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/odoo-consultancy.svg @@ -0,0 +1,4 @@ + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/odoo-licencing.svg b/stock_intercompany_transfer/static/description/assets/icons/odoo-licencing.svg new file mode 100755 index 000000000..2606c88b0 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/odoo-licencing.svg @@ -0,0 +1,3 @@ + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/odoo-logo.png b/stock_intercompany_transfer/static/description/assets/icons/odoo-logo.png new file mode 100755 index 000000000..0e4d0eb5a Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/odoo-logo.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/patter.svg b/stock_intercompany_transfer/static/description/assets/icons/patter.svg new file mode 100755 index 000000000..25c9c0a8f --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/patter.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/pattern1.png b/stock_intercompany_transfer/static/description/assets/icons/pattern1.png new file mode 100755 index 000000000..09ab0fb2d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/pattern1.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/pos-black.png b/stock_intercompany_transfer/static/description/assets/icons/pos-black.png new file mode 100755 index 000000000..97c0f90c1 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/pos-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/puzzle-piece-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/puzzle-piece-icon.svg new file mode 100755 index 000000000..3e9ad9373 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/puzzle-piece-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/puzzle.png b/stock_intercompany_transfer/static/description/assets/icons/puzzle.png new file mode 100755 index 000000000..65cf854e7 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/puzzle.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/replace-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/replace-icon.svg new file mode 100755 index 000000000..d0e3a7af1 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/replace-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/restaurant-black.png b/stock_intercompany_transfer/static/description/assets/icons/restaurant-black.png new file mode 100755 index 000000000..4a35eb939 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/restaurant-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/screenshot-main.png b/stock_intercompany_transfer/static/description/assets/icons/screenshot-main.png new file mode 100755 index 000000000..575f8e676 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/screenshot-main.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/screenshot.png b/stock_intercompany_transfer/static/description/assets/icons/screenshot.png new file mode 100755 index 000000000..cef272529 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/screenshot.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/service-black.png b/stock_intercompany_transfer/static/description/assets/icons/service-black.png new file mode 100755 index 000000000..301ab51cb Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/service-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/skype-fill.svg b/stock_intercompany_transfer/static/description/assets/icons/skype-fill.svg new file mode 100755 index 000000000..c17423639 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/skype-fill.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/skype.png b/stock_intercompany_transfer/static/description/assets/icons/skype.png new file mode 100755 index 000000000..51b409fb3 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/skype.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/skype.svg b/stock_intercompany_transfer/static/description/assets/icons/skype.svg new file mode 100755 index 000000000..df3dad39b --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/skype.svg @@ -0,0 +1,3 @@ + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/star-1.svg b/stock_intercompany_transfer/static/description/assets/icons/star-1.svg new file mode 100755 index 000000000..7e55ab162 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/star-1.svg @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/star-2.svg b/stock_intercompany_transfer/static/description/assets/icons/star-2.svg new file mode 100755 index 000000000..5ae9f507a --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/star-2.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/support.png b/stock_intercompany_transfer/static/description/assets/icons/support.png new file mode 100755 index 000000000..4f18b8b82 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/support.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/test-1 - Copy.png b/stock_intercompany_transfer/static/description/assets/icons/test-1 - Copy.png new file mode 100755 index 000000000..f6a902663 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/test-1 - Copy.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/test-1.png b/stock_intercompany_transfer/static/description/assets/icons/test-1.png new file mode 100755 index 000000000..0908add2b Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/test-1.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/test-2.png b/stock_intercompany_transfer/static/description/assets/icons/test-2.png new file mode 100755 index 000000000..4671fe91e Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/test-2.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/trading-black.png b/stock_intercompany_transfer/static/description/assets/icons/trading-black.png new file mode 100755 index 000000000..9398ba2f1 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/trading-black.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/training.png b/stock_intercompany_transfer/static/description/assets/icons/training.png new file mode 100755 index 000000000..884ca024d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/training.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/translate.svg b/stock_intercompany_transfer/static/description/assets/icons/translate.svg new file mode 100755 index 000000000..af9c8a1aa --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/translate.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/update.png b/stock_intercompany_transfer/static/description/assets/icons/update.png new file mode 100755 index 000000000..ecbc5a01a Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/update.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/user.png b/stock_intercompany_transfer/static/description/assets/icons/user.png new file mode 100755 index 000000000..6ffb23d9f Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/user.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/video.png b/stock_intercompany_transfer/static/description/assets/icons/video.png new file mode 100755 index 000000000..576705b17 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/video.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/whatsapp.png b/stock_intercompany_transfer/static/description/assets/icons/whatsapp.png new file mode 100755 index 000000000..d513a5356 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/whatsapp.png differ diff --git a/stock_intercompany_transfer/static/description/assets/icons/wrench-icon.svg b/stock_intercompany_transfer/static/description/assets/icons/wrench-icon.svg new file mode 100755 index 000000000..174b5a465 --- /dev/null +++ b/stock_intercompany_transfer/static/description/assets/icons/wrench-icon.svg @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/stock_intercompany_transfer/static/description/assets/icons/wrench.png b/stock_intercompany_transfer/static/description/assets/icons/wrench.png new file mode 100755 index 000000000..6c04dea0f Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/icons/wrench.png differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/1.jpg b/stock_intercompany_transfer/static/description/assets/modules/1.jpg new file mode 100644 index 000000000..3cb15fe01 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/1.jpg differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/2.jpg b/stock_intercompany_transfer/static/description/assets/modules/2.jpg new file mode 100644 index 000000000..662cadcc3 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/2.jpg differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/3.jpg b/stock_intercompany_transfer/static/description/assets/modules/3.jpg new file mode 100644 index 000000000..717a00443 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/3.jpg differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/4.png b/stock_intercompany_transfer/static/description/assets/modules/4.png new file mode 100644 index 000000000..00ebf54ad Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/4.png differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/5.jpg b/stock_intercompany_transfer/static/description/assets/modules/5.jpg new file mode 100644 index 000000000..7c67e2eec Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/5.jpg differ diff --git a/stock_intercompany_transfer/static/description/assets/modules/6.gif b/stock_intercompany_transfer/static/description/assets/modules/6.gif new file mode 100644 index 000000000..a35ece8df Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/modules/6.gif differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/1.png b/stock_intercompany_transfer/static/description/assets/screenshots/1.png new file mode 100644 index 000000000..4fe5cd9a7 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/1.png differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/2.png b/stock_intercompany_transfer/static/description/assets/screenshots/2.png new file mode 100644 index 000000000..84c55c586 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/2.png differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/3.png b/stock_intercompany_transfer/static/description/assets/screenshots/3.png new file mode 100644 index 000000000..bef8abc0d Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/3.png differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/4.png b/stock_intercompany_transfer/static/description/assets/screenshots/4.png new file mode 100644 index 000000000..a12ffaeed Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/4.png differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/5.png b/stock_intercompany_transfer/static/description/assets/screenshots/5.png new file mode 100644 index 000000000..40f3740f6 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/5.png differ diff --git a/stock_intercompany_transfer/static/description/assets/screenshots/6.png b/stock_intercompany_transfer/static/description/assets/screenshots/6.png new file mode 100644 index 000000000..39deaf503 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/screenshots/6.png differ diff --git a/stock_intercompany_transfer/static/description/assets/y18.jpg b/stock_intercompany_transfer/static/description/assets/y18.jpg new file mode 100755 index 000000000..eea1714f2 Binary files /dev/null and b/stock_intercompany_transfer/static/description/assets/y18.jpg differ diff --git a/stock_intercompany_transfer/static/description/banner.png b/stock_intercompany_transfer/static/description/banner.png new file mode 100644 index 000000000..bf98aa6df 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..941d96f79 Binary files /dev/null and b/stock_intercompany_transfer/static/description/icon.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..e7424407c --- /dev/null +++ b/stock_intercompany_transfer/static/description/index.html @@ -0,0 +1,946 @@ + + + + + + Inter Company Stock Transfer + + + + + + + + + + +
+
+ + + +
+
+ Community +
+
+ Enterprise +
+
+ Odoo.sh +
+
+
+ +
+
+
+
+

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

+

Inter Company Stock Transfer +

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

Key + Highlights

+
+
+
+
+ +
+
+ Multi-Company Support +
+

+ Easily manage stock transfers across multiple companies, allowing for real-time visibility and control.

+
+
+
+
+
+ +
+
+ Automated Workflow +
+

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

+
+
+
+
+ +
+
+
+ Inter Company Stock Transfer +

+ Are you ready to make your business more + organized? +
Improve now! +

+ +
+
+ +
+
+
+ + + + +
+
+ +
+
+
+
+ acc_bg +
+ +
+
+
+
+

+ Configure Transfer Options. + +

+
+
+

+ From Companies > Inter Company Transfer tab, configure the transfer options. From here it can choose whether it can apply to Receipt orders, Delivery Orders or both. Also it is possible to choose the company warehouse. For the Company 'My Company (San Francisco)' the transfer will be applied on Receipts. So if any company creates a Receipt Order for 'My Company (San Francisco)' a Delivery order will automatically create in this company. +

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

+ Configure Transfer Options in My Company(Chicago). + +

+
+
+

+ Enable both companies for creating transfer. +

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

+ + Create Receipt Order + +

+
+
+

+ Create a Receipt Order for My Company (San Francisco) and Click the button 'Mark as Todo', then validate the Receipt Order. +

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

+ Delivery order generated in My Company (Chicago) + +

+
+

+ By Validating the Receipt a Delivery order is automatically created in the destination company. +

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

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

+
+ +
+
+
+
+
+
+ +
+

+ Option to choose the destination Warehouse in the selected company.

+
+
+
+
+
+
+
+ +
+

+ Option to choose whether it can apply to Receipt orders, Delivery Orders or both. +

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

+ The app facilitates the transfer of stock between different companies or branches within Odoo, streamlining the process and ensuring accurate inventory management.

+
+
+ +
+ +
+

+ You can configure multiple companies in Odoo's settings and enable the inter-company transfer feature in the companies -> inter-company tab. +

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

+ Latest Release 18.0.1.0.0 +

+ + 8th November, 2024 + +
+
+
+
+
+ Add +
+
+
+
    +
  • + Initial Commit +
  • + +
+
+
+
+
+
+
+
+
+
+ + + +
+

+ Related Products +

+ +
+ + +
+

+ Our Services

+ +
+ +
+
+ .... +
+
+ +
+ + +
+
+ + + + + + diff --git a/stock_intercompany_transfer/views/res_company_views.xml b/stock_intercompany_transfer/views/res_company_views.xml new file mode 100644 index 000000000..af28b6909 --- /dev/null +++ b/stock_intercompany_transfer/views/res_company_views.xml @@ -0,0 +1,35 @@ + + + + + res.company.view.form.inherit.stock.inter.company + res.company + + + + + + + + + + + +
+
+
+ +
+
+
+
+
+
+
+
+
+
diff --git a/stock_intercompany_transfer/wizard/__init__.py b/stock_intercompany_transfer/wizard/__init__.py new file mode 100644 index 000000000..aa59c4ad9 --- /dev/null +++ b/stock_intercompany_transfer/wizard/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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 stock_backorder_confirmation diff --git a/stock_intercompany_transfer/wizard/stock_backorder_confirmation.py b/stock_intercompany_transfer/wizard/stock_backorder_confirmation.py new file mode 100644 index 000000000..b310d305b --- /dev/null +++ b/stock_intercompany_transfer/wizard/stock_backorder_confirmation.py @@ -0,0 +1,82 @@ +# -*- coding: utf-8 -*- +################################################################################ +# +# Cybrosys Technologies Pvt. Ltd. +# +# Copyright (C) 2024-TODAY Cybrosys Technologies () +# Author: Manasa T P () +# +# 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 fields, models + + +class StockBackorderConfirmation(models.TransientModel): + """This class inherits 'stock.backorder.confirmation' and adds + required fields """ + _inherit = 'stock.backorder.confirmation' + + stock_id = fields.Many2one('stock.picking', string="Stock", + help="Stock") + + def process(self): + """Initialize variables to store pickings to be done and not to be done + Iterate through backorder_confirmation_line_ids to categorize pickings, + Get pickings to be validated from the context,Retrieve pickings to + validate from the context,If there are pickings_not_to_do, + check quantities and update context, If pickings_to_validate + are not auto-generated, create Inter company transfer""" + pickings_to_do = self.env['stock.picking'] + pickings_not_to_do = self.env['stock.picking'] + for line in self.backorder_confirmation_line_ids: + if line.to_backorder is True: + pickings_to_do |= line.picking_id + else: + pickings_not_to_do |= line.picking_id + pickings_to_validate = self.env.context.get( + 'button_validate_picking_ids') + if pickings_to_validate: + pickings_to_validate = self.env['stock.picking'].browse( + pickings_to_validate).with_context(skip_backorder=True) + if pickings_not_to_do: + self._check_less_quantities_than_expected(pickings_not_to_do) + pickings_to_validate = pickings_to_validate.with_context( + picking_ids_not_to_backorder=pickings_not_to_do.ids) + result_validate = pickings_to_validate.button_validate() + result_transfer = '' + if not pickings_to_validate.auto_generated: + result_transfer = pickings_to_validate.create_intercompany_transfer() + pickings_to_validate.write( + {'is_backorder_button_clicked': True}) + return result_validate, result_transfer + return True + + def process_cancel_backorder(self): + """ Retrieve pickings to be validated from the context,If + pickings_to_validate_ids is specified, validate and cancel backorders""" + pickings_to_validate_ids = self.env.context.get( + 'button_validate_picking_ids') + if pickings_to_validate_ids: + pickings_to_validate = self.env['stock.picking'].browse( + pickings_to_validate_ids) + self._check_less_quantities_than_expected(pickings_to_validate) + result_validate = pickings_to_validate.with_context( + skip_backorder=True, + picking_ids_not_to_backorder=self.pick_ids.ids).button_validate() + result_transfer = '' + if not pickings_to_validate.auto_generated: + result_transfer = pickings_to_validate.create_intercompany_transfer() + return result_validate, result_transfer + return True