Conversation
Currently translated at 100.0% (6 of 6 strings) Translation: maintenance-12.0/maintenance-12.0-maintenance_equipment_contract Translate-URL: https://translation.odoo-community.org/projects/maintenance-12-0/maintenance-12-0-maintenance_equipment_contract/pt_BR/
Currently translated at 100.0% (8 of 8 strings) Translation: maintenance-13.0/maintenance-13.0-maintenance_equipment_contract Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_equipment_contract/es/
Currently translated at 100.0% (8 of 8 strings) Translation: maintenance-13.0/maintenance-13.0-maintenance_equipment_contract Translate-URL: https://translation.odoo-community.org/projects/maintenance-13-0/maintenance-13-0-maintenance_equipment_contract/it/
Currently translated at 100.0% (8 of 8 strings) Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_contract Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_contract/it/
Currently translated at 100.0% (8 of 8 strings) Translation: maintenance-16.0/maintenance-16.0-maintenance_equipment_contract Translate-URL: https://translation.odoo-community.org/projects/maintenance-16-0/maintenance-16-0-maintenance_equipment_contract/pt_BR/
BhaveshHeliconia
suggested changes
Aug 26, 2026
| @api.depends("contract_ids") | ||
| def _compute_contract_count(self): | ||
| for record in self: | ||
| record.contract_count = len(record.contract_ids.ids) |
Contributor
There was a problem hiding this comment.
Suggested change
| record.contract_count = len(record.contract_ids.ids) | |
| record.contract_count = len(record.contract_ids) |
| ] | ||
| action["res_id"] = self.contract_ids.id | ||
| action["context"] = { | ||
| "default_equipment_ids": self.ids, |
Contributor
There was a problem hiding this comment.
Suggested change
| "default_equipment_ids": self.ids, | |
| "default_equipment_ids": [Command.link(self.id)],, |
Comment on lines
+8
to
+11
| class TestEquipmentContract(TransactionCase): | ||
| def setUp(self): | ||
| super().setUp() | ||
| self.partner = self.env["res.partner"].create({"name": "Test partner"}) |
Contributor
There was a problem hiding this comment.
Suggested change
| class TestEquipmentContract(TransactionCase): | |
| def setUp(self): | |
| super().setUp() | |
| self.partner = self.env["res.partner"].create({"name": "Test partner"}) | |
| class TestEquipmentContract(Basecommon): | |
| @classmethod | |
| def setUpClass(cls): | |
| super().setUpClass() |
Borruso
force-pushed
the
19.0-mig-maintenance_equipment_contract
branch
from
August 26, 2026 09:01
64daec0 to
6468c16
Compare
BhaveshHeliconia
approved these changes
Aug 26, 2026
BhaveshHeliconia
left a comment
Contributor
There was a problem hiding this comment.
Code review LGTM!
Just minor suggestion
| @classmethod | ||
| def setUpClass(cls): | ||
| super().setUpClass() | ||
| cls.partner = cls.env["res.partner"].create({"name": "Test partner"}) |
Contributor
There was a problem hiding this comment.
Suggested change
| cls.partner = cls.env["res.partner"].create({"name": "Test partner"}) |
No need to create a res.partner record when using BaseCommon, as it is already provided by the base class.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#513