Skip to content

[18.0][MIG] payment_redsys: Migration to 18.0 #4065

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

Open
wants to merge 57 commits into
base: 18.0
Choose a base branch
from

Conversation

jordi-josc
Copy link

No description provided.

sergio-teruel and others added 30 commits March 10, 2025 12:54
* Corregido error en caso de que refence no este
  informado, al renderizar la plantilla del boton de pago.
* Corregido error que no permite pagar por transferencia al instalar
  el modulo payment_redsys
* Añadidas descripciones de los productos de la cesta a la clave 'DS_Merchant_ProductDescription'.
* Make quotation sending optional
  when a transaction ends without error website_sale module already sends an e-mail with the confirmed order, so it May not be necessary to send another e-mail with the same order unconfirmed.
* Add more Redsys frontend languages
* Remove options tab
* Send quotation e-mail invoking force_quotation_send() instead of action_quotation_send() + send_mail()

  * The function send_mail() does not respect the context language so the email is always sent in English.
  * It's not necessary to create the function send_mail() to sent an email when exists the method force_quotation_send().

* Add detailed error info
…r payment + Default values for urk_KO and url_OK + option to print print sale report. Delete url_ok and url_ko fields + Redondeo de merchant_amount
The discount is shown on the order summary if the current user is a member of sale.group_discount_per_so_line group

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex

OCA Transbot updated translations from Transifex
[IMP] payment_redsys: Allow partial payment by percent
Includes to allow show order for unauthenticated users
When we have an order sequence of length six (SO123456), the signature process fails with the following message:

Server Error:
We are not able to redirect you to the payment form. 'str' object has no attribute 'decode'
Currently translated at 71.6% (48 of 67 strings)

Translation: l10n-spain-12.0/l10n-spain-12.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-payment_redsys/es/

Translated using Weblate (Spanish)

Currently translated at 100.0% (67 of 67 strings)

Translation: l10n-spain-12.0/l10n-spain-12.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-payment_redsys/es/

Translated using Weblate (Spanish)

Currently translated at 100.0% (67 of 67 strings)

Translation: l10n-spain-12.0/l10n-spain-12.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-12-0/l10n-spain-12-0-payment_redsys/es/
Currently translated at 100.0% (47 of 47 strings)

Translation: l10n-spain-13.0/l10n-spain-13.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-13-0/l10n-spain-13-0-payment_redsys/es/
Currently translated at 97.9% (46 of 47 strings)

Translation: l10n-spain-13.0/l10n-spain-13.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-13-0/l10n-spain-13-0-payment_redsys/ca/
…jecutar post procesado al recibir el formulario POST de Redsys + Avoid execute method por non Redsys acquirer
Currently translated at 100.0% (46 of 46 strings)

Translation: l10n-spain-14.0/l10n-spain-14.0-payment_redsys
Translate-URL: https://translation.odoo-community.org/projects/l10n-spain-14-0/l10n-spain-14-0-payment_redsys/ca/
@pedrobaeza pedrobaeza changed the title 18.0 mig payment redsys [18.0][MIG] payment_redsys: Migration to 18.0 Mar 10, 2025
@pedrobaeza
Copy link
Member

/ocabot migration payment_redsys

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Mar 10, 2025
@OCA-git-bot OCA-git-bot mentioned this pull request Mar 10, 2025
40 tasks
@@ -42,7 +42,7 @@ def _redsys_get_api_url(self):
"Terminal", default="1", required_if_provider="redsys"
)
redsys_currency = fields.Char(
"Currency", default="978", required_if_provider="redsys"
"Currency Redsys", default="978", required_if_provider="redsys"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Para que Redsys Currency sea la etiqueta:

Suggested change
"Currency Redsys", default="978", required_if_provider="redsys"
default="978", required_if_provider="redsys"

@jordi-josc jordi-josc force-pushed the 18.0-mig-payment_redsys branch from 1b37768 to 1672d96 Compare March 11, 2025 10:17
@jordi-josc jordi-josc requested a review from pedrobaeza March 11, 2025 10:21
@jordi-josc jordi-josc force-pushed the 18.0-mig-payment_redsys branch 6 times, most recently from 8ddabad to 7762dd1 Compare April 2, 2025 14:26
@jordi-josc
Copy link
Author

Hola @pedrobaeza. He actualizado el código optimizando cada detalle. Espero tu review.

"author": "Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-spain",
"depends": ["payment"],
"depends": ["payment", "sale"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por qué se añade la dependencia sale?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Porque en el archivo “payment_provider.py” en las lineas 189-195 se usa el modelo de “sale.order”. Si el
modulo de “sale” no esta instalado, no funcionaria.

def _product_description(self, order_ref):
sale_order = self.env["sale.order"].search([("name", "=", order_ref)])
res = ""
if sale_order:
description = "|".join(x.name for x in sale_order.order_line)
res = description[:125]
return res

@@ -2,12 +2,6 @@
<!-- Copyright 2016-2017 Tecnativa - Sergio Teruel
License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl-3). -->
<odoo noupdate="1">
<record id="payment_method_redsys" model="account.payment.method">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Por qué se quita este método y no el de Bizum? No deberían ir los dos de la misma forma?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, ya que redsys es un “account.payment.method” que no es usado para pagar, sino para cosas como
contabilidad por ejemplo. Al no verlo necessario, lo que quitado. Si queremos pagar tenemos que usar
“payment.method”.

@@ -1,252 +0,0 @@
# Translation of Odoo Server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

El archivo .pot no debería desaparecer, si no si acaso actualizarse.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahora ya te lo he subido, error mio quitarlo.

_inherit = "account.payment.method"

@api.model
def _get_payment_method_information(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto por qué se elimina?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Se elimina ya que hay un metodo en odoo standard que hace lo mismo:
https://github.com/odoo/odoo/blob/18.0/addons/account_payment/models/account_payment_method.py#L11

@antelo
Copy link

antelo commented Apr 7, 2025

Hola, que tal vais con esta migración? os puedo echar una mano?

@jordi-josc
Copy link
Author

Hola @antelo, por ahora voy bien, ¡si necesito ayuda te aviso!

@jordi-josc jordi-josc force-pushed the 18.0-mig-payment_redsys branch from 7762dd1 to aeaeec6 Compare April 11, 2025 08:18
return self._redsys_get_api_url()

def _product_description(self, order_ref):
sale_order = self.env["sale.order"].search([("name", "=", order_ref)])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Esto no debería estar en este módulo. Si acaso, en un módulo de extensión, u obtenido de otro lado. @sergio-teruel por qué añadiste esto directamente rompiendo las dependencias?

@acysos
Copy link
Member

acysos commented Jun 4, 2025

/ocabot migration l10n_es_vat_book

@OCA-git-bot
Copy link
Contributor

The migration issue (#3754) has not been updated to reference the current pull request because a previous pull request (#4098) is not closed.
Perhaps you should check that there is no duplicate work.
CC @IsabelAForgeFlow

@jordi-josc
Copy link
Author

Hola @pedrobaeza ¿Este módulo como ha quedado?

@pedrobaeza
Copy link
Member

@jordi-josc debes hacer rebase y resolver los conflictos, y luego, hay que eliminar la parte que mira a sale.order, porque el módulo no debe depender de sale.

@pedrobaeza
Copy link
Member

/ocabot migration payment_redsys

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.