-
Notifications
You must be signed in to change notification settings - Fork 1
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
[FIX] l10n_uy_edi: Fix en el manejo de formatos de reporte #245
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from . import test_check_uy_vat | ||
from . import test_report_params |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
from odoo.tests import common | ||
|
||
|
||
class TestL10nReportParams(common.TransactionCase): | ||
|
||
|
||
def setUp(self): | ||
super().setUp() | ||
|
||
lang_es = self.env['res.lang'].search([['code', '=', 'en_AR']]) | ||
lang_en = self.env['res.lang'].search([['code', '=', 'en_US']]) | ||
self.content = """ | ||
Estimated Net Weight: 25.995,00 Kg | ||
Estimated Gross Weight: 26.774,850 Kg | ||
In 1 x 40 reef | ||
BL Nº: TBI | ||
SHIPPER / MANUFACTURER: C.VALE - COOPERATIVA AGROINDUSTRIAL (SIF 3300) | ||
AV. ARIOSVALDO BITENCOURT, 2000 CENTRO 85950000, PALOTINA - BRASIL | ||
MEANS OF TRANSPORTATION: Sea | ||
ORIGIN: Brazil | ||
PORT OF LOADING: Paranagua - Brazil | ||
PORT OF DISCHARGE: Cebu - Philippines | ||
SHIPMENT DATE: September, 2024 | ||
SALE TERMS: CNF (COST AND FREIGHT) Insurance under responsibility of the buyer | ||
TERMS OF PAYMENT: 100% TT Against copy of original documents | ||
""" | ||
adenda = """ | ||
linea 1 | ||
linea 2 | ||
linea 3 | ||
linea 4 | ||
linea 5 | ||
linea 6 | ||
""" | ||
self.partner_en = self.env['res.partner'].create({ | ||
'name': 'Partner Test Adenda EN', | ||
'lang': lang_en.code | ||
}) | ||
partner_es = self.env['res.partner'].create({ | ||
'name': 'Partner Test Adenda ES', | ||
'lang': lang_es.code | ||
}) | ||
self.move_2 = self.env['account.move'].create({ | ||
'move_type': 'out_invoice', | ||
'l10n_latam_document_type_id': self.env.ref('l10n_uy_account.dc_e_ticket').id, | ||
'partner_id': partner_es.id, | ||
'narration': adenda, | ||
'invoice_date': '2024-01-21', | ||
'date': '2024-01-21', | ||
}) | ||
|
||
def test_reportparams_adenda(self): | ||
"""Creamos este test para los formatos de parametros de reporte""" | ||
|
||
mem-adhoc marked this conversation as resolved.
Show resolved
Hide resolved
mem-adhoc marked this conversation as resolved.
Show resolved
Hide resolved
|
||
#Nos aseguramos que se imprima el reporte en formato estandar | ||
nombreParametros, valoresParametros = self.move_2._get_report_params() | ||
self.assertFalse(nombreParametros) | ||
self.assertFalse(valoresParametros) | ||
|
||
#Agregamos adenda de mas de 6 renglones | ||
self.move_2.narration = self.content | ||
|
||
self.assertEqual(self.move_2._get_report_params(), (['adenda'],['true']), | ||
"El formato de parametros es incorrecto.") | ||
|
||
#Agregamos partner con idioma ingles, adenda y tipo de doc (al cambiar partner se borran los campos) | ||
self.move_2.partner_id = self.partner_en | ||
self.move_2.narration = self.content | ||
self.move_2.l10n_latam_document_type_id = self.env.ref('l10n_uy_account.dc_e_ticket').id | ||
|
||
self.assertEqual(self.move_2._get_report_params(), (['adenda','reporte'], ['true','ingles']), | ||
"El formato de parametros es incorrecto.") | ||
|
||
#Cambiamos el tipo ya que el reporte en ingles no es para e-factura | ||
self.move_2.l10n_latam_document_type_id = self.env.ref('l10n_uy_account.dc_e_inv').id | ||
|
||
self.assertEqual(self.move_2._get_report_params(), (['adenda'], ['true']), | ||
"El formato de parametros es incorrecto.") |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mem-adhoc necesitamos un enlace acá? que pasa si no está disponible o cambia?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pablohmontenegro Pablito esto no es un enlace, basicamente consultamos a la api el formato que necesitamos para informar los campos! no va a cambiar