diff --git a/l10n_ar_stock/models/res_company.py b/l10n_ar_stock/models/res_company.py
index 4251f731..fc408b6f 100644
--- a/l10n_ar_stock/models/res_company.py
+++ b/l10n_ar_stock/models/res_company.py
@@ -33,7 +33,7 @@ def arba_cot_connect(self):
Method to be called
"""
self.ensure_one()
- cuit = self.partner_id.ensure_vat()
+ cuit = self._context.get('force_cot_cuit') or self.partner_id.ensure_vat()
if not self.arba_cot:
raise UserError(_(
@@ -51,7 +51,7 @@ def arba_cot_connect(self):
# wrapper=None, cacert=None, trace=False, testing=""
arba_cot_url = self.get_arba_cot_login_url(environment_type)
ws.Usuario = cuit
- ws.Password = self.arba_cot
+ ws.Password = self._context.get('force_cot_password') or self.arba_cot
ws.Conectar(url=arba_cot_url)
_logger.info(
'Connection getted to ARBA COT with url "%s" and CUIT %s' % (
diff --git a/l10n_ar_stock/models/stock_book.py b/l10n_ar_stock/models/stock_book.py
index 9cb3b9b4..c61a3e5b 100644
--- a/l10n_ar_stock/models/stock_book.py
+++ b/l10n_ar_stock/models/stock_book.py
@@ -32,3 +32,7 @@ class StockBook(models.Model):
help="Agregar al reporte una sección para añadir firma de confirmación de recepción.",
default=False,
)
+ arba_cot = fields.Char(
+ 'Clave COT',
+ help='Si no está definido, se utilizará el valor del COT de a compañía',
+ )
diff --git a/l10n_ar_stock/views/stock_book_views.xml b/l10n_ar_stock/views/stock_book_views.xml
index 0369bfa0..b13090c8 100644
--- a/l10n_ar_stock/views/stock_book_views.xml
+++ b/l10n_ar_stock/views/stock_book_views.xml
@@ -11,6 +11,7 @@
+