Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IMP] l10n_ar_stock: add the possibility of force arba cuit and password #107

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_ar_stock/__manifest__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
'name': 'Remitos, COT y demas ajustes de stock para Argentina',
'version': '13.0.1.21.0',
'version': '13.0.1.22.0',
'category': 'Localization/Argentina',
'sequence': 14,
'author': 'ADHOC SA',
Expand Down
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_arba_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_arba_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',
)
4 changes: 2 additions & 2 deletions l10n_ar_stock/models/stock_picking.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def get_arba_file_data(
raise UserError(_(
'Los remitos seleccionados deben pertenecer a la misma '
'compañía'))
cuit = company.partner_id.ensure_vat()
cuit = self._context.get('force_arba_cuit') or company.partner_id.ensure_vat()
cuit_carrier = carrier_partner.ensure_vat()

if cuit_carrier == cuit and not patente_vehiculo:
Expand Down Expand Up @@ -248,7 +248,7 @@ def get_arba_file_data(
cuit,

# ORIGEN_RAZON_SOCIAL
company.name[:50],
self._context.get('force_arba_name') or company.name[:50],

# EMISOR_TENEDOR: 0=no, 1=si
# TODO implementar
Expand Down
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