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

[FW][FIX] sale_order_type_automation and _stock_voucher: picking refactoring #1121

Closed

Conversation

fw-bot-adhoc
Copy link
Contributor

Refactorización sale_order_type_automation para hacerlo heredable y se cambia lo siguiente:

  • Necesitamos ordenar también por ID a los pickings debido a que si es una entrega en 3 pasos necesitamos que se haga en orden. El primer elemento (x.state != 'assigned') prioriza los pickings asignados, ya que False (asignados) se evalúa antes que True (no asignados). El segundo elemento (x.id) ordena los pickings dentro de cada grupo por ID en orden ascendente.
  • Agrego método extra _process_pickings para heredarlo desde otros módulos
  • Agrego el res = run_picking_automation() ya que quizás necesitemos devolver una acción lo podemos hacer con eso pisando el return que viene

Refactorización sale_order_type_automation_stock_voucher para utilizar los métodos heredables anteriores y se cambia lo siguiente:

  • No vuelvo a recorrer el for (como se hacía antes de este cambio) ya que utilizo el _process_picking
  • Antes de agregar nuevo método puedo reutilizar el run_picking_automation para devolver las acciones de impresión de voucher
  • Anexo al punto anterior necesité agregar soft_reload para actualizar la SO ya que sino quedaba sin recargar los nuevos datos y parecía que no se hubiera confirmado (bug)

Forward-Port-Of: #1120

@roboadhoc
Copy link

@fw-bot-adhoc
Copy link
Contributor Author

@lef-adhoc @matiasperalta1 cherrypicking of pull request #1120 failed.

stdout:

Auto-merging sale_order_type_automation/models/sale_order.py
CONFLICT (content): Merge conflict in sale_order_type_automation/models/sale_order.py

stderr:

19:41:46.551496 git.c:444               trace: built-in: git cherry-pick 224a545c5a4ad95bd239f6e3a4f4fab737e7a34d
error: could not apply 224a545c... [REF] sale_order_type_automation: refactoring to make inheritable
hint: after resolving the conflicts, mark the corrected paths
hint: with 'git add <paths>' or 'git rm <paths>'
hint: and commit the result with 'git commit'
----------
status:

Either perform the forward-port manually (and push to this branch, proceeding as usual) or close this PR (maybe?).

In the former case, you may want to edit this PR message as well.

More info at https://github.com/odoo/odoo/wiki/Mergebot#forward-port

@lef-adhoc lef-adhoc force-pushed the 18.0-17.0-h-86915-lef-XgRt-fw branch from 1ba9fe7 to 2988173 Compare February 6, 2025 13:54
@lef-adhoc
Copy link
Contributor

@roboadhoc r+

@roboadhoc roboadhoc closed this in 2eddcf6 Feb 6, 2025
@lef-adhoc lef-adhoc deleted the 18.0-17.0-h-86915-lef-XgRt-fw branch February 6, 2025 16:03
@roboadhoc roboadhoc added the 17.1 label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants