-
Notifications
You must be signed in to change notification settings - Fork 72
[FIX]stock_ux: origin description + product name #856
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
base: 19.0
Are you sure you want to change the base?
Conversation
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.
Pull request overview
Este PR añade una nueva opción de configuración que permite incluir el nombre del producto junto con la descripción de origen en los comprobantes de transferencia, complementando la funcionalidad existente delivery_slip_use_origin.
Changes:
- Se añade un nuevo campo booleano de configuración
delivery_slip_add_product_nameenres.config.settings - Se modifica la lógica de
_get_aggregated_propertiespara combinar el nombre del producto con la descripción limpia cuando la nueva opción está activa - Se incrementa la versión del módulo de 19.0.1.1.0 a 19.0.1.2.0
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| stock_ux/manifest.py | Incrementa la versión del módulo de 19.0.1.1.0 a 19.0.1.2.0 para reflejar la nueva funcionalidad |
| stock_ux/models/res_config_settings.py | Agrega el campo de configuración delivery_slip_add_product_name con su parámetro correspondiente |
| stock_ux/views/res_config_settings_views.xml | Añade el campo de configuración en la vista, anidado condicionalmente bajo delivery_slip_use_origin |
| stock_ux/models/stock_move_line.py | Implementa la lógica para combinar nombre de producto y descripción limpia cuando ambas opciones están activas |
|
|
||
| name = clean_description if clean_description else origin_description | ||
| if add_product_name and clean_description and clean_description != origin_description: | ||
| name = f"{product.name} {'-'} {clean_description}" |
Copilot
AI
Jan 19, 2026
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.
El formato de la cadena incluye un guión entre espacios innecesarios. La expresión f"{product.name} {'-'} {clean_description}" genera algo como "Producto - Descripción", pero debería ser simplemente f"{product.name} - {clean_description}" para evitar la redundancia de espacios alrededor del guión.
| name = f"{product.name} {'-'} {clean_description}" | |
| name = f"{product.name} - {clean_description}" |
| add_product_name = ( | ||
| self.env["ir.config_parameter"].sudo().get_param("stock_ux.delivery_slip_add_product_name", "False") == "True" | ||
| ) |
Copilot
AI
Jan 19, 2026
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.
Se está llamando a get_param() con sudo() dentro de un método que puede ejecutarse múltiples veces durante la agregación de líneas. Esto puede impactar el rendimiento. Considera almacenar el resultado en una variable fuera del loop o en el contexto si este método se llama repetidamente para múltiples líneas de movimiento.
ccd675f to
53f29b4
Compare

No description provided.