From 6a8e31f8787b7c2d2ce4d45042d68250044c8f3b Mon Sep 17 00:00:00 2001 From: Virginia Date: Thu, 29 Jan 2026 16:42:11 -0300 Subject: [PATCH 1/3] Update project.toml from template --- .copier-answers.yml | 2 +- .github/workflows/pre-commit.yml | 7 ++++++- .pre-commit-config.yaml | 2 ++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.copier-answers.yml b/.copier-answers.yml index 67ad86e4..7490032c 100644 --- a/.copier-answers.yml +++ b/.copier-answers.yml @@ -1,5 +1,5 @@ # Do NOT update manually; changes here will be overwritten by Copier -_commit: 2f2f7c4 +_commit: a740779 _src_path: https://github.com/ingadhoc/addons-repo-template.git description: ADHOC Odoo purchase Modules is_private: false diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml index 349c52d8..baa05dbf 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/pre-commit.yml @@ -6,8 +6,13 @@ name: pre-commit on: push: - branches: "[0-9][0-9].0" + branches: + - "1[8-9].0" + - "[2-9][0-9].0" pull_request_target: + branches: + - "1[8-9].0*" + - "[2-9][0-9].0*" jobs: pre-commit: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index fc269814..c4be55ff 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -29,6 +29,8 @@ repos: - id: check-docstring-first - id: check-executables-have-shebangs - id: check-merge-conflict + args: ['--assume-in-merge'] + exclude: '\.rst$' - id: check-symlinks - id: check-xml - id: check-yaml From c857ca26e6cd49d3c3e50d27a4100b72a83fc848 Mon Sep 17 00:00:00 2001 From: adhoc-cicd-bot <116299102+adhoc-cicd-bot@users.noreply.github.com> Date: Wed, 18 Feb 2026 14:44:05 -0300 Subject: [PATCH 2/3] [UPD] Copilot instructions --- .github/copilot-instructions.md | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index a30ad3cf..783d6e4d 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -38,8 +38,6 @@ * Confirmar que todos los archivos usados (vistas, seguridad, datos, reportes, wizards) estén referenciados en el manifest. * Verificar dependencias declaradas: que no falten módulos requeridos ni se declaren innecesarios. -* **Regla de versión (obligatoria):** - Solo sugerir bump de versión si el `__manifest__.py` no incrementa `version` y se modificó la estructura de un modelo, una vista, o algún record .xml (ej. cambios en definición de campos, vistas XML, datos XML, seguridad). * Solo hacerlo una vez por revisión, aunque haya múltiples archivos afectados. --- @@ -61,7 +59,6 @@ * Verificar los archivos `ir.model.access.csv` para nuevos modelos: deben tener permisos mínimos necesarios. * No proponer abrir acceso global sin justificación. -* Si se agregan nuevos modelos o campos de control de acceso, **recordar el bump de versión** (ver sección de manifest). * Si se cambian `record rules`, revisar especialmente combinaciones multi-compañía y multi-website. ### Seguridad y rendimiento del ORM @@ -86,7 +83,7 @@ ## Cambios estructurales y scripts de migración – **cuestiones generales** -Cuando el diff sugiera **cambios de estructura de datos**, **siempre evaluar** si corresponde proponer un **script de migración** en `migrations/` (pre/post/end) **y recordar el bump de versión**. +Cuando el diff sugiera **cambios de estructura de datos**, **siempre evaluar** si corresponde proponer un **script de migración** en `migrations/` (pre/post/end). ### Reglas generales de estructura de `migrations/` @@ -283,7 +280,6 @@ def migrate(cr, registry): | ------------------ | -------------------------------------------------------------------------------------------------------- | | Modelos | Relaciones válidas; constraints; uso adecuado de `@api.depends`; `super()` correcto | | Vistas XML | Herencias correctas; campos válidos; adaptación a cambios de versión (p.ej. `` vs ``) | -| Manifest | **Bump de versión obligatorio** si hay cambios estructurales en modelos/vistas/records .xml; archivos referenciados | | Seguridad | Accesos mínimos necesarios; reglas revisadas | | Migraciones | **Si hay cambios estructurales, sugerir script en `migrations/` (pre/post/end)** y describir qué hace | | Rendimiento / ORM | Evitar loops costosos; no SQL innecesario; aprovechar las optimizaciones del ORM de la versión | @@ -291,15 +287,6 @@ def migrate(cr, registry): --- -## Heurística práctica para el bump de versión (general) - -* **SI** el diff modifica la estructura de un modelo, una vista, o algún record .xml (ej. cambios en definición de campos, vistas XML, datos XML, seguridad) - **Y** `__manifest__.py` no cambia `version` → **Sugerir bump**. -* **SI** hay scripts `migrations/pre_*.py` o `migrations/post_*.py` nuevos → **Sugerir al menos minor bump**. -* **SI** hay cambios que rompen compatibilidad (renombres, cambios de tipo con impacto, limpieza masiva de datos) → **Sugerir minor/major** según impacto. - ---- - ## Estilo del feedback (general) * Ser breve, claro y útil. Ejemplos: @@ -307,7 +294,7 @@ def migrate(cr, registry): * “El campo `partner_id` no se encuentra referenciado en la vista.” * “Este método redefine `write()` sin usar `super()`.” * “Tip: hay un error ortográfico en el nombre del parámetro.” - * **Bump + migración:** “Se renombra `old_ref` → `new_ref`: falta **bump de versión** y **pre-script** en `migrations/` para copiar valores antes del upgrade; añadir **post-script** para recompute del stored.” + * **Migración:** “Se renombra `old_ref` → `new_ref`: falta **pre-script** en `migrations/` para copiar valores antes del upgrade; añadir **post-script** para recompute del stored.” * Evitar explicaciones largas o reescrituras completas salvo que el cambio sea claro y necesario. * Priorizar comentarios en forma de **lista corta de puntos** (3–7 ítems) y frases breves en lugar de bloques de texto extensos. @@ -316,10 +303,10 @@ def migrate(cr, registry): ## Resumen operativo para Copilot -1. **Detecta cambios estructurales en modelos, vistas o records .xml → exige bump de `version` en `__manifest__.py` si no está incrementada.** -2. **Si hay cambio estructural (según la lista actualizada) → propone y describe script(s) de migración en `migrations/` (pre/post/end)**, con enfoque idempotente y en lotes. -3. Distingue entre: +1. **Si hay cambio estructural (según la lista actualizada) → propone y describe script(s) de migración en `migrations/` (pre/post/end)**, con enfoque idempotente y en lotes. +2. Distingue entre: * **cuestiones generales** (válidas para cualquier versión), * y **matices específicos de Odoo 18** (por ejemplo, uso de ``, passkeys, tours y comportamiento del framework). -4. Mantén el feedback **concreto, breve y accionable**. \ No newline at end of file + +3. Mantén el feedback **concreto, breve y accionable**. \ No newline at end of file From 43234e1ffbe27060fc536a9e8fc6c02c45c15b0d Mon Sep 17 00:00:00 2001 From: mav-adhoc Date: Fri, 13 Feb 2026 17:07:43 -0300 Subject: [PATCH 3/3] [IMP]purchase_ux: improve purchase bill line match view closes ingadhoc/purchase#300 Signed-off-by: Juan Carreras --- purchase_ux/__manifest__.py | 3 +- purchase_ux/i18n/es.po | 5 +++ purchase_ux/models/__init__.py | 1 + purchase_ux/models/account_move.py | 12 ++++++ .../models/purchase_bill_line_match.py | 39 +++++++++++++++++++ purchase_ux/models/purchase_order.py | 12 ++++++ .../views/purchase_bill_line_match_views.xml | 29 ++++++++++++++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 purchase_ux/models/purchase_bill_line_match.py create mode 100644 purchase_ux/views/purchase_bill_line_match_views.xml diff --git a/purchase_ux/__manifest__.py b/purchase_ux/__manifest__.py index 26512b00..4ff796ca 100644 --- a/purchase_ux/__manifest__.py +++ b/purchase_ux/__manifest__.py @@ -19,7 +19,7 @@ ############################################################################## { "name": "Purchase UX", - "version": "18.0.1.1.0", + "version": "18.0.1.2.0", "category": "Purchases", "sequence": 14, "summary": "", @@ -41,6 +41,7 @@ "views/purchase_line_views.xml", "views/product_template_views.xml", "views/product_supplierinfo_views.xml", + "views/purchase_bill_line_match_views.xml", ], "demo": [ "demo/purchase_order_demo.xml", diff --git a/purchase_ux/i18n/es.po b/purchase_ux/i18n/es.po index b748c789..68013208 100644 --- a/purchase_ux/i18n/es.po +++ b/purchase_ux/i18n/es.po @@ -380,3 +380,8 @@ msgstr "o" #: model:ir.model,name:purchase_ux.model_purchase_order_line_add_to_invoice msgid "purchase.order.line.add_to_invoice" msgstr "" + +#. module: purchase_ux +#: model:ir.model,name:purchase_ux.model_purchase_bill_line_match +msgid "Received" +msgstr "Recibido" diff --git a/purchase_ux/models/__init__.py b/purchase_ux/models/__init__.py index 58cc98e1..2717a6d4 100644 --- a/purchase_ux/models/__init__.py +++ b/purchase_ux/models/__init__.py @@ -6,3 +6,4 @@ from . import purchase_order from . import purchase_order_line from . import product_template +from . import purchase_bill_line_match diff --git a/purchase_ux/models/account_move.py b/purchase_ux/models/account_move.py index 90d95d76..f949196a 100644 --- a/purchase_ux/models/account_move.py +++ b/purchase_ux/models/account_move.py @@ -82,3 +82,15 @@ def update_prices_with_supplier_cost(self): def get_product_lines_to_update(self): return self.with_company(self.company_id.id).invoice_line_ids.filtered(lambda x: x.product_id and x.price_unit) + + def action_purchase_matching(self): + result = super().action_purchase_matching() + result["context"] = result.get("context", {}) + result["context"].update( + { + "search_default_pol_id": 1, + "search_default_not_invoiced": 1, + "search_default_current_invoice": 1, + } + ) + return result diff --git a/purchase_ux/models/purchase_bill_line_match.py b/purchase_ux/models/purchase_bill_line_match.py new file mode 100644 index 00000000..ab14d400 --- /dev/null +++ b/purchase_ux/models/purchase_bill_line_match.py @@ -0,0 +1,39 @@ +############################################################################## +# For copyright and license notices, see __manifest__.py file in module root +# directory +############################################################################## +from odoo import api, fields, models + + +class PurchaseBillLineMatch(models.Model): + _inherit = "purchase.bill.line.match" + + reference_description = fields.Char( + string="Description", + compute="_compute_reference_description", + ) + + qty_received = fields.Float( + string="Received", + related="pol_id.qty_received", + readonly=True, + ) + + @api.depends("pol_id", "product_id", "display_name") + def _compute_reference_description(self): + for rec in self: + if rec.pol_id and rec.product_id: + pol_name = rec.pol_id.name or "" + product_name = rec.product_id.display_name or "" + if pol_name.startswith(product_name): + remaining = pol_name[len(product_name) :].strip() + if remaining: + rec.reference_description = f"{product_name} - {remaining}" + else: + rec.reference_description = product_name + else: + rec.reference_description = pol_name + elif rec.pol_id: + rec.reference_description = rec.pol_id.name + else: + rec.reference_description = rec.display_name diff --git a/purchase_ux/models/purchase_order.py b/purchase_ux/models/purchase_order.py index 569bb419..c5a6056f 100644 --- a/purchase_ux/models/purchase_order.py +++ b/purchase_ux/models/purchase_order.py @@ -129,3 +129,15 @@ def _prepare_invoice(self): if self.internal_notes: result["internal_notes"] = self.internal_notes return result + + def action_bill_matching(self): + result = super().action_bill_matching() + result["context"] = result.get("context", {}) + result["context"].update( + { + "search_default_pol_id": 1, + "search_default_not_invoiced": 1, + "search_default_current_invoice": 1, + } + ) + return result diff --git a/purchase_ux/views/purchase_bill_line_match_views.xml b/purchase_ux/views/purchase_bill_line_match_views.xml new file mode 100644 index 00000000..6ccf14cb --- /dev/null +++ b/purchase_ux/views/purchase_bill_line_match_views.xml @@ -0,0 +1,29 @@ + + + + purchase.bill.line.match.list + purchase.bill.line.match + + + + + + + + + + + + + purchase.bill.line.match.search + purchase.bill.line.match + + + + + + + + + +