From 151590684288c76323b002f4537aa2acab9bc090 Mon Sep 17 00:00:00 2001 From: Joel Zilli Date: Thu, 22 Sep 2022 12:11:23 -0300 Subject: [PATCH] [IMP] l10n_ar_stock: add the possibility of force arba cuit and password --- l10n_ar_stock/models/res_company.py | 4 ++-- l10n_ar_stock/models/stock_book.py | 4 ++++ l10n_ar_stock/views/stock_book_views.xml | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) 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 @@ +