Skip to content

[FIX] partner_state: keep standard fields in the chatter - #156

Closed
fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-126800-ced-9955-fw
Closed

fw-bot-adhoc wants to merge 1 commit into
ingadhoc:19.0from
adhoc-dev:19.0-18.0-h-126800-ced-9955-fw

Conversation

@fw-bot-adhoc

Copy link
Copy Markdown

Ticket: https://www.adhoc.inc/odoo/helpdesk.ticket/126800

Qué cambia

  • _track_get_fields: arranca de lo que Odoo registra por defecto y suma los campos con Cambios? (filtrados con fields_get(), como hace mail). Nunca saca un campo estándar.
  • Se quita el override de _message_track. Desde [FIX]partner_state: log to chatter fields marked with changes=True #144 dejaba pasar al chatter solo los campos con Cambios?, así que una base sin líneas en Campos de Estados no registraba ningún cambio de contactos.
  • Pantalla de Campos de Estados: la columna Cambios? muestra un campo calculado (chatter_tracking). Si el campo elegido tiene seguimiento nativo (ir.model.fields.tracking), aparece tildado y de solo lectura. En los demás campos lee y escribe changes, como antes. Las líneas existentes se ven bien sin script de migración.
  • Traducción al español de la columna y del texto de ayuda.
  • README: explica las opciones de Campos de Estados y lista los campos que Odoo registra por defecto en contactos. Corrige la ruta del menú (está en Contactos > Configuración).

El paso a Potencial (Seguir?) no cambia: lo maneja write() con check_fields("track").

Cómo se probó

  • tests/test_partner_state_tracking.py: sin líneas se registra un campo estándar; con Cambios? se registra un campo que Odoo no registra y un contacto aprobado sigue aprobado; sin Cambios? un campo estándar se sigue registrando; la columna queda tildada en un campo estándar y escribe changes en otro.
  • En rojo, rompiendo de a una cosa: con el seguimiento de 18.0 actual fallan los tres casos del chatter; si Cambios? devuelve a Potencial falla el caso del aprobado; sin el inverso de la columna, o sin el seguimiento nativo en su cálculo, falla el caso que corresponde.
  • Suite del módulo en una base local con demo data: 0 failed, 0 error(s) of 6 tests, sin warnings.
  • Navegador (Playwright, base local 18.0 en español): la columna se llama "Cambios?", en "Nombre" está tildada y fija, en "Activo" es editable; al agregar Vendedor queda fija y tildada; al agregar Referencia se puede destildar y se guarda con changes = False; cambiar el email de un contacto deja registro en el chatter. Sin errores de consola, JS ni HTTP.

19.0

El forward-port va a tener conflicto en _track_get_fields, porque en 19.0 el método es distinto (no tiene _message_track). Al resolverlo conviene limpiar el write() de 19.0, que arma initial_values y state_fields_to_track sin usarlos.

Forward-Port-Of: #153

@roboadhoc

Copy link
Copy Markdown

Pull request status dashboard

@fw-bot-adhoc

Copy link
Copy Markdown
Author

@ced-adhoc @mav-adhoc cherrypicking of pull request #153 failed.

stdout:

Auto-merging partner_state/i18n/es.po
Auto-merging partner_state/models/res_partner.py
CONFLICT (content): Merge conflict in partner_state/models/res_partner.py

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

:shipit: you can use git-fw to re-do the forward-port for you locally.

⚠️ after resolving this conflict, you will need to merge it via @roboadhoc.

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

"Changes?" now only adds fields to the chatter. Fields that Odoo tracks
by default are always tracked, with or without lines in Partner State
Fields. Before, the _message_track override only logged the fields with
"Changes?", so a database without lines logged no partner change.

The "Changes?" column now shows a computed field: it is checked and read
only for fields with native tracking, and it writes the stored value for
the other fields. Existing lines show the right value without a migration.

The README explains the options of Partner State Fields and lists the
fields that Odoo tracks on contacts by default.

In 19.0, also drop the unused initial_values and state_fields_to_track
from write().

X-original-commit: ed6f85d
@ced-adhoc
ced-adhoc force-pushed the 19.0-18.0-h-126800-ced-9955-fw branch from 92f5166 to 9c6bdc0 Compare October 20, 2026 14:38
@les-adhoc

Copy link
Copy Markdown
Contributor

@roboadhoc r+ bump

roboadhoc pushed a commit that referenced this pull request Oct 20, 2026
"Changes?" now only adds fields to the chatter. Fields that Odoo tracks
by default are always tracked, with or without lines in Partner State
Fields. Before, the _message_track override only logged the fields with
"Changes?", so a database without lines logged no partner change.

The "Changes?" column now shows a computed field: it is checked and read
only for fields with native tracking, and it writes the stored value for
the other fields. Existing lines show the right value without a migration.

The README explains the options of Partner State Fields and lists the
fields that Odoo tracks on contacts by default.

In 19.0, also drop the unused initial_values and state_fields_to_track
from write().

closes #156

X-original-commit: ed6f85d
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
Signed-off-by: Luciano Esperlazza <les@adhoc.inc>
roboadhoc added a commit that referenced this pull request Oct 20, 2026
@roboadhoc roboadhoc closed this Oct 20, 2026
@roboadhoc
roboadhoc deleted the 19.0-18.0-h-126800-ced-9955-fw branch October 20, 2026 16:01
les-adhoc pushed a commit to adhoc-dev/partner that referenced this pull request Oct 20, 2026
"Changes?" now only adds fields to the chatter. Fields that Odoo tracks
by default are always tracked, with or without lines in Partner State
Fields. Before, the _message_track override only logged the fields with
"Changes?", so a database without lines logged no partner change.

The "Changes?" column now shows a computed field: it is checked and read
only for fields with native tracking, and it writes the stored value for
the other fields. Existing lines show the right value without a migration.

The README explains the options of Partner State Fields and lists the
fields that Odoo tracks on contacts by default.

In 19.0, also drop the unused initial_values and state_fields_to_track
from write().

closes ingadhoc#156

X-original-commit: ed6f85d
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
Signed-off-by: Luciano Esperlazza <les@adhoc.inc>

In 20.0, without mail_tracking the tracking is only rendered in the
message body, so the test reads the field labels from there. The README
also lists the related fields that 20 tracks with the name.

Cherry-picked from ff015cb (19.0).
les-adhoc pushed a commit to adhoc-dev/partner that referenced this pull request Oct 21, 2026
"Changes?" now only adds fields to the chatter. Fields that Odoo tracks
by default are always tracked, with or without lines in Partner State
Fields. Before, the _message_track override only logged the fields with
"Changes?", so a database without lines logged no partner change.

The "Changes?" column now shows a computed field: it is checked and read
only for fields with native tracking, and it writes the stored value for
the other fields. Existing lines show the right value without a migration.

The README explains the options of Partner State Fields and lists the
fields that Odoo tracks on contacts by default.

In 19.0, also drop the unused initial_values and state_fields_to_track
from write().

closes ingadhoc#156

X-original-commit: ed6f85d
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
Signed-off-by: Luciano Esperlazza <les@adhoc.inc>

In 20.0, without mail_tracking the tracking is only rendered in the
message body, so the test reads the field labels from there. The README
also lists the related fields that 20 tracks with the name.

Cherry-picked from ff015cb (19.0).
roboadhoc pushed a commit that referenced this pull request Nov 2, 2026
"Changes?" now only adds fields to the chatter. Fields that Odoo tracks
by default are always tracked, with or without lines in Partner State
Fields. Before, the _message_track override only logged the fields with
"Changes?", so a database without lines logged no partner change.

The "Changes?" column now shows a computed field: it is checked and read
only for fields with native tracking, and it writes the stored value for
the other fields. Existing lines show the right value without a migration.

The README explains the options of Partner State Fields and lists the
fields that Odoo tracks on contacts by default.

In 19.0, also drop the unused initial_values and state_fields_to_track
from write().

closes #156

X-original-commit: ed6f85d
Signed-off-by: Matias Velazquez <mav@adhoc.com.ar>
Signed-off-by: Luciano Esperlazza <les@adhoc.inc>

In 20.0, without mail_tracking the tracking is only rendered in the
message body, so the test reads the field labels from there. The README
also lists the related fields that 20 tracks with the name.

Cherry-picked from ff015cb (19.0).

Part-of: #154
Signed-off-by: Juan Carreras <jc@adhoc.com.ar>

This branch was previously deployed

1 inactive deployment
merge — 9c6bdc06 Deployed Oct 20, 2026 by roboadhoc
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.

4 participants