Skip to content

[17.0][IMP] tracking_manager: Properties compatibility #3311

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

Merged
merged 2 commits into from
Jun 19, 2025

Conversation

victoralmau
Copy link
Member

@victoralmau victoralmau commented Jun 17, 2025

Properties compatibility

ejemplo

@Tecnativa TT56736

@OCA-git-bot
Copy link
Contributor

Hi @Kev-Roche, @sebastienbeau,
some modules you are maintaining are being modified, check this out!

@victoralmau victoralmau force-pushed the 17.0-imp-tracking_manager-TT56736 branch from 0afdfd6 to 2a10ad7 Compare June 17, 2025 08:27
victoralmau added a commit to Tecnativa/odoo that referenced this pull request Jun 17, 2025
Related to OCA/server-tools#3311

Example use case:
- Add tracking to property fields
- You want to create as many mail.tracking.value records as there are fields defined and changed.

TT56736
@victoralmau victoralmau force-pushed the 17.0-imp-tracking_manager-TT56736 branch 3 times, most recently from 3ba54b2 to 8245775 Compare June 18, 2025 10:15
@pedrobaeza pedrobaeza added this to the 17.0 milestone Jun 18, 2025
@pedrobaeza
Copy link
Member

Testing on runboat adding a property in CRM leads, I have this error:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 1941, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/odoo/service/model.py", line 154, in retrying
    env.cr.flush()  # submit the changes to the database
  File "/opt/odoo/odoo/sql_db.py", line 138, in flush
    self.precommit.run()
  File "/opt/odoo/odoo/tools/misc.py", line 1227, in run
    func()
  File "/opt/odoo/addons/mail/models/mail_thread.py", line 530, in _track_finalize
    tracking = records.with_context(context)._message_track(fnames, initial_values)
  File "/opt/odoo/addons/mail/models/mail_thread.py", line 612, in _message_track
    tracking[record.id] = record._mail_track(tracked_fields, initial_values_dict[record.id])
  File "/mnt/data/odoo-addons-dir/tracking_manager_domain/models/models.py", line 35, in _mail_track
    tracking_value_field_ids = [
  File "/mnt/data/odoo-addons-dir/tracking_manager_domain/models/models.py", line 36, in <listcomp>
    tracking_value_id[2]["field_id"] for tracking_value_id in tracking_value_ids
KeyError: 'field_id'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPCError@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2940:319
    makeErrorFromResponse@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2943:163
    jsonrpc/promise</<@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2947:34
    

@victoralmau
Copy link
Member Author

Testing on runboat adding a property in CRM leads, I have this error:

Traceback (most recent call last):
  File "/opt/odoo/odoo/http.py", line 1941, in _serve_db
    return service_model.retrying(self._serve_ir_http, self.env)
  File "/opt/odoo/odoo/service/model.py", line 154, in retrying
    env.cr.flush()  # submit the changes to the database
  File "/opt/odoo/odoo/sql_db.py", line 138, in flush
    self.precommit.run()
  File "/opt/odoo/odoo/tools/misc.py", line 1227, in run
    func()
  File "/opt/odoo/addons/mail/models/mail_thread.py", line 530, in _track_finalize
    tracking = records.with_context(context)._message_track(fnames, initial_values)
  File "/opt/odoo/addons/mail/models/mail_thread.py", line 612, in _message_track
    tracking[record.id] = record._mail_track(tracked_fields, initial_values_dict[record.id])
  File "/mnt/data/odoo-addons-dir/tracking_manager_domain/models/models.py", line 35, in _mail_track
    tracking_value_field_ids = [
  File "/mnt/data/odoo-addons-dir/tracking_manager_domain/models/models.py", line 36, in <listcomp>
    tracking_value_id[2]["field_id"] for tracking_value_id in tracking_value_ids
KeyError: 'field_id'

The above server error caused the following client error:
RPC_ERROR: Odoo Server Error
    RPCError@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2940:319
    makeErrorFromResponse@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2943:163
    jsonrpc/promise</<@http://oca-server-tools-17-0-pr3311-8245775d4c6d.runboat.odoo-community.org/web/assets/0788929/web.assets_web.min.js:2947:34
    

The error seems to be related to tracking_manager_domain, I will check it.

@victoralmau victoralmau force-pushed the 17.0-imp-tracking_manager-TT56736 branch 2 times, most recently from d314280 to f8414a2 Compare June 18, 2025 12:36
@victoralmau
Copy link
Member Author

Fixed.

@victoralmau victoralmau force-pushed the 17.0-imp-tracking_manager-TT56736 branch 2 times, most recently from 222dd79 to 30365cd Compare June 18, 2025 15:48
@victoralmau victoralmau marked this pull request as ready for review June 19, 2025 06:05
@victoralmau victoralmau changed the title [17.0][WIP] tracking_manager: Properties compatibility [17.0][IMP] tracking_manager: Properties compatibility Jun 19, 2025
Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Tested on runboat

@victoralmau victoralmau force-pushed the 17.0-imp-tracking_manager-TT56736 branch from 30365cd to 0fab01c Compare June 19, 2025 06:51
@pedrobaeza
Copy link
Member

/ocabot merge minor

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 17.0-ocabot-merge-pr-3311-by-pedrobaeza-bump-minor, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 3189979 into OCA:17.0 Jun 19, 2025
7 of 9 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at d04d1f3. Thanks a lot for contributing to OCA. ❤️

@pedrobaeza pedrobaeza deleted the 17.0-imp-tracking_manager-TT56736 branch June 19, 2025 11:22
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