Skip to content

16.0 mig animal owner#2265

Open
gzoccarato wants to merge 24 commits intoOCA:16.0from
gzoccarato:16.0-mig-animal_owner
Open

16.0 mig animal owner#2265
gzoccarato wants to merge 24 commits intoOCA:16.0from
gzoccarato:16.0-mig-animal_owner

Conversation

@gzoccarato
Copy link

Migration of animal_owner to version 16.0

max3903 and others added 24 commits January 20, 2026 10:25
Currently translated at 83.3% (5 of 6 strings)

Translation: partner-contact-12.0/partner-contact-12.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-animal_owner/es/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/
Currently translated at 22.2% (2 of 9 strings)

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/fr/
Currently translated at 33.3% (3 of 9 strings)

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/fr/
Currently translated at 100.0% (9 of 9 strings)

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/es/
Currently translated at 88.8% (8 of 9 strings)

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/it/
Currently translated at 100.0% (9 of 9 strings)

Translation: partner-contact-14.0/partner-contact-14.0-animal_owner
Translate-URL: https://translation.odoo-community.org/projects/partner-contact-14-0/partner-contact-14-0-animal_owner/it/
Copy link

@luisDIXMIT luisDIXMIT left a comment

Choose a reason for hiding this comment

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

Code reviewed and tested on Runboat, LGTM! Please separate the version change from the pre-commit improvements into a new migration commit. The PR title must be [16.0] [MIG] animal_owner: Migration to 16.0. It’s a convention.

Copy link

@marcos-mendez marcos-mendez left a comment

Choose a reason for hiding this comment

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

Automated Review -- Tests Failed

1. Root Cause of the Test Failure

The test failure is caused by a database connection error during the Odoo server startup, not due to any code logic in the animal_owner module. This is likely due to a misconfiguration or transient issue in the test environment (e.g., runboat infrastructure).

2. Suggested Fix

There is no code fix needed for the animal_owner module itself. The error occurs before the module is even loaded, as the database connection fails. However, to ensure robustness, the PR should be retested after confirming that the environment is stable.

3. Additional Code Issues

There are no real bugs in the provided code. All patterns used are valid for Odoo 16.0 and OCA standards:

  • Use of _inherit with fields.Many2one is correct.
  • The _compute_animal_count method and action_view_animals are standard Odoo practices.
  • The animal_ids and animal_count fields are correctly defined with proper dependencies and store logic.
  • No extensibility hooks are improperly implemented.

4. Test Improvements

To better cover this module, consider adding the following test cases in a tests/ directory using TransactionCase or SavepointCase:

Suggested Test Cases:

  1. Test animal_count computation:
    • Create a partner and associate multiple animals.
    • Verify animal_count is correctly computed.
  2. Test action_view_animals:
    • Test that the action opens the correct view based on number of animals (list vs form).
    • Ensure domain filtering works when multiple animals are present.
  3. Test partner_id field on animal model:
    • Create an animal and assign an owner.
    • Verify the relationship is correctly stored and retrieved.

OCA Testing Patterns:

  • Use TransactionCase for tests that require database transactions.
  • Use SavepointCase if you need to isolate test data (e.g., for performance or data integrity).
  • Tag tests appropriately using @tag('post_install', 'long_running') if needed.

Example snippet:

def test_animal_count_computation(self):
    partner = self.env['res.partner'].create({'name': 'Test Owner'})
    animal1 = self.env['animal'].create({'name': 'Fluffy', 'partner_id': partner.id})
    animal2 = self.env['animal'].create({'name': 'Buddy', 'partner_id': partner.id})
    self.assertEqual(partner.animal_count, 2)

This would ensure that the logic for linking animals to partners and computing counts is thoroughly tested.


⏰ This PR has been open for 54 days.
💤 Last activity was 34 days ago.

Every ignored PR is a contributor who might not come back. Review time matters. (OCA Aging Report)


Reciprocal Review Request

Hi everyone! I found some test failures on this PR and left detailed feedback above. I am happy to discuss or help debug. In the meantime, if any of you get a chance, I would appreciate a look at my open PR(s):

My open PRs across OCA:

Reviewing each other's work helps the whole community move forward. Thank you!


Environment via OCA Neural Reviewer: Minikube + K8s Job + oca-ci/py3.10-odoo16.0 | Odoo 16.0
Automated review by OCA Neural Reviewer + qwen3-coder:30b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.