diff --git a/purchase_collective/__manifest__.py b/purchase_collective/__manifest__.py
index 64d287a..47c99f6 100644
--- a/purchase_collective/__manifest__.py
+++ b/purchase_collective/__manifest__.py
@@ -31,6 +31,7 @@ El Usuario que crea la orden es el encargado de distribuir los productos al rest
'views/actions.xml',
'views/menus.xml',
'views/partner_node_views.xml',
+ 'views/partner_net_views.xml',
],
'demo': [],
'installable': True,
diff --git a/purchase_collective/models/__init__.py b/purchase_collective/models/__init__.py
index ffc4025..59a30b9 100644
--- a/purchase_collective/models/__init__.py
+++ b/purchase_collective/models/__init__.py
@@ -1,3 +1,4 @@
from . import purchase_collective
from . import sale_order
from . import partner_node
+from . import partner_network
diff --git a/purchase_collective/models/partner_network.py b/purchase_collective/models/partner_network.py
new file mode 100644
index 0000000..0fa7f7a
--- /dev/null
+++ b/purchase_collective/models/partner_network.py
@@ -0,0 +1,25 @@
+# Copyright (C) 2022: Criptomart ()
+# @author: Criptomart ()
+# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
+
+#import logging
+
+from odoo import models, fields, api
+from odoo.exceptions import ValidationError, Warning
+
+#_logger = logging.getLogger(__name__)
+
+class PartnerNetwork(models.Model):
+ _inherit = 'partner.network'
+
+ wh_id = fields.Many2one('stock.warehouse', string="Almacén asociado", help='El almacén central donde recibe productos la red y se redistribuye a los nodos.')
+
+ @api.model
+ def create(self, vals):
+ if vals.get('wh_id', False) == False:
+ vals['wh_id'] = self.env['stock.warehouse'].create({
+ 'name': vals.get('name'),
+ 'code': vals.get('name')[4:]
+ }).id
+ return super().create(vals)
+
diff --git a/purchase_collective/views/partner_net_views.xml b/purchase_collective/views/partner_net_views.xml
new file mode 100644
index 0000000..9c67e3d
--- /dev/null
+++ b/purchase_collective/views/partner_net_views.xml
@@ -0,0 +1,28 @@
+
+
+
+
+
+ partner.net.form.wh.view
+ partner.network
+
+
+
+
+
+
+
+
+
+ partner.net.tree.wh.view
+ partner.network
+
+
+
+
+
+
+
+
+
+