Skip to content

Commit

Permalink
[IMP] l10n_ar_stock: add the possibility of force arba cuit and password
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelZilli committed Sep 29, 2022
1 parent 763bb4c commit 1515906
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions l10n_ar_stock/models/res_company.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(_(
Expand All @@ -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' % (
Expand Down
4 changes: 4 additions & 0 deletions l10n_ar_stock/models/stock_book.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
)
1 change: 1 addition & 0 deletions l10n_ar_stock/views/stock_book_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<field name="l10n_ar_cai_due" attrs="{'invisible': [('lines_per_voucher', '!=', 0)]}"/>
<field name="report_partner_id"/>
<field name="report_signature_section"/>
<field name="arba_cot" attrs="{'invisible': [('report_partner_id', '==', False)]}"/>
</field>
</field>
</record>
Expand Down

0 comments on commit 1515906

Please sign in to comment.