Skip to content

[18.0][IMP] maintenance_equipment_contract: Access requests from contract in order to verify that all has been processed - #594

Open
deeniiz wants to merge 4 commits into
OCA:18.0from
nuobit:18.0-fwp-14.0-maintenance_equipment_contract
Open

deeniiz wants to merge 4 commits into
OCA:18.0from
nuobit:18.0-fwp-14.0-maintenance_equipment_contract

Conversation

@deeniiz

@deeniiz deeniiz commented Sep 21, 2026

Copy link
Copy Markdown

Forward port of #364, #170 and #222 from 14.0

etobella and others added 4 commits September 21, 2026 10:15
…n order to verify that all has been processed

(cherry picked from commit 31e7641)
[ported to 18.0: attrs replaced by the invisible attribute, contributors entry moved to CONTRIBUTORS.md, README regenerated]
@OCA-git-bot OCA-git-bot added series:18.0 mod:maintenance_equipment_contract Module maintenance_equipment_contract labels Sep 21, 2026
@deeniiz

deeniiz commented Sep 21, 2026

Copy link
Copy Markdown
Author

@eantones , can you please review it?

@dalonsod dalonsod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Only code review, see comments

<field
name="groups"
eval="[
(4,ref('maintenance.group_equipment_manager'))]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Use Command.link instead

widget="many2many_tags"
options="{'no_create_edit': True}"
/>
<field name="equipment_count" invisible="1" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

For 18.0 this field is no longer required, as Odoo will automatically add it to view.

@api.depends("equipment_ids")
def _compute_equipment_count(self):
for record in self:
record.equipment_count = len(record.equipment_ids)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is right and will work in a normal scenario. Anyway, a good and optional improvement here could be moved to a search_count or something like that. Once done, this field could be securely added to e.g. list view, without lack of performance.

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

Labels

mod:maintenance_equipment_contract Module maintenance_equipment_contract series:18.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants