diff --git a/product_create_stock_picking/__init__.py b/product_create_stock_picking/__init__.py
new file mode 100644
index 0000000..899bcc9
--- /dev/null
+++ b/product_create_stock_picking/__init__.py
@@ -0,0 +1,2 @@
+from . import models
+
diff --git a/product_create_stock_picking/__manifest__.py b/product_create_stock_picking/__manifest__.py
new file mode 100644
index 0000000..37b527a
--- /dev/null
+++ b/product_create_stock_picking/__manifest__.py
@@ -0,0 +1,28 @@
+{
+ 'name': 'Product Create Stock Picking',
+ 'category': 'Warehouse',
+ 'summary': 'Add an action to create a stock picking from a selection of products.',
+ 'version': '12.0.0.0.1',
+ 'description': """
+
+Add an action to create a stock picking from a selection of products.
+
+""",
+ 'author': 'Criptomart',
+ 'depends': [
+ 'stock',
+ ],
+ 'external_dependencies': {'python': [], 'bin': []},
+ 'data': [
+ 'data/data.xml',
+ ],
+ 'qweb': [],
+ 'demo': [],
+ 'installable': True,
+ 'auto_install': False,
+ 'application': True,
+ "post_load": None,
+ "pre_init_hook": None,
+ "post_init_hook": None,
+ "uninstall_hook": None,
+}
diff --git a/product_create_stock_picking/data/data.xml b/product_create_stock_picking/data/data.xml
new file mode 100644
index 0000000..c015eb1
--- /dev/null
+++ b/product_create_stock_picking/data/data.xml
@@ -0,0 +1,16 @@
+
+
+
+
+ Transfiere éstos productos
+ ir.actions.server
+
+ code
+ action =records.create_stock_picking()
+
+ action
+
+
+
+
+
diff --git a/product_create_stock_picking/models/__init__.py b/product_create_stock_picking/models/__init__.py
new file mode 100644
index 0000000..09ff977
--- /dev/null
+++ b/product_create_stock_picking/models/__init__.py
@@ -0,0 +1,2 @@
+from . import product_template
+
diff --git a/product_create_stock_picking/models/product_template.py b/product_create_stock_picking/models/product_template.py
new file mode 100644
index 0000000..5559b65
--- /dev/null
+++ b/product_create_stock_picking/models/product_template.py
@@ -0,0 +1,46 @@
+# Copyright (C) 2021: Criptomart (https://criptomart.net)
+# @author Santi Noreña ()
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+#import logging
+
+from odoo import tools, models, fields, api, _
+
+#_logger = logging.getLogger(__name__)
+
+class ProductTemplate(models.Model):
+ _inherit = "product.template"
+
+ @api.multi
+ def create_stock_picking(self):
+ picking_vals = self.env['stock.picking'].default_get(self.env['stock.picking']._fields.keys())
+ picking_vals.update({
+ 'picking_type_id' : self.env.ref('stock.picking_type_internal').id,
+ 'location_id': self.env.ref('stock.stock_location_stock').id,
+ 'location_dest_id': self.env.ref('stock.stock_location_stock').id,
+ })
+ picking = self.env['stock.picking'].create(picking_vals)
+
+ for p in self:
+ _logger.warning("product : %s" %p.name)
+ move_vals = {
+ 'name': p.name,
+ 'product_id': p.id,
+ 'product_uom_qty': p.qty_available,
+ 'product_uom': p.uom_id.id,
+ 'picking_id': picking.id,
+ 'location_id': self.env.ref('stock.stock_location_stock').id,
+ 'location_dest_id': self.env.ref('stock.stock_location_stock').id,
+ 'state': 'waiting',
+ 'procure_method': 'make_to_order',
+ }
+ picking.move_lines = [(0, 0, move_vals)]
+
+ views = [(self.env.ref('stock.view_picking_form').id, 'form')]
+ return {
+ 'type': 'ir.actions.act_window',
+ 'res_model': 'stock.picking',
+ 'res_id': picking.id,
+ 'target': 'current',
+ 'views': views,
+ }