Skip to content

Commit 339af48

Browse files
committed
fix(cr): fix pre-commit CI failures and address review comments
- Fix ruff E501: break long domain strings in add_member, change_hoh, transfer_member - Fix ruff F841: prefix unused variables with _ in test files - Fix ruff E741: rename lambda l to ln in wizard files - Fix ruff format: auto-format all Python files - Fix eslint: remove unused import (onWillUnmount), unused param (action), add parseInt radix, move inline comment - Fix prettier: reformat XML/JS files - Fix oca-checks: add default_types.xml to manifest data - Fix B017: use ValidationError instead of blind Exception in test - Address Gemini review: remove downloadUrl from fileViewer.open()
1 parent c66e9c0 commit 339af48

59 files changed

Lines changed: 1744 additions & 986 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

spp_change_request_v2/__manifest__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@
5656
# Data
5757
"data/dms_directories.xml",
5858
"data/sequences.xml",
59+
"data/default_types.xml",
5960
"data/event_types.xml",
6061
"data/user_roles.xml",
6162
],

spp_change_request_v2/data/default_types.xml

Lines changed: 107 additions & 50 deletions
Large diffs are not rendered by default.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8" ?>
22
<odoo>
33
<!-- Parent DMS Directory for all Change Requests -->
44
<record id="dms_directory_change_request_root" model="spp.dms.directory">
55
<field name="name">Change Request</field>
6-
<field name="is_root_directory" eval="True"/>
6+
<field name="is_root_directory" eval="True" />
77
</record>
88
</odoo>

spp_change_request_v2/data/event_types.xml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
<field name="code">cr_audit</field>
77
<field name="category">manual</field>
88
<field name="target_type">both</field>
9-
<field name="description">Audit trail events for change request state transitions</field>
9+
<field
10+
name="description"
11+
>Audit trail events for change request state transitions</field>
1012
</record>
1113

1214
<!-- Event Type for CR Conflict Detection -->
@@ -15,7 +17,8 @@
1517
<field name="code">cr_conflict</field>
1618
<field name="category">manual</field>
1719
<field name="target_type">both</field>
18-
<field name="description">Audit trail events for conflict detection and resolution</field>
20+
<field
21+
name="description"
22+
>Audit trail events for conflict detection and resolution</field>
1923
</record>
20-
2124
</odoo>

spp_change_request_v2/data/sequences.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<field name="code">spp.change.request</field>
77
<field name="prefix">CR/%(year)s/</field>
88
<field name="padding">5</field>
9-
<field name="company_id" eval="False"/>
9+
<field name="company_id" eval="False" />
1010
</record>
11-
1211
</odoo>

spp_change_request_v2/data/user_roles.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ Part of OpenSPP. See LICENSE file for full copyright and licensing details.
55
User roles for Change Request module.
66
-->
77
<odoo noupdate="1">
8-
98
<!-- CR Requestor Role -->
109
<!-- For users who can create and submit change requests -->
1110
<record id="global_role_cr_requestor" model="res.users.role">
1211
<field name="name">CR Requestor</field>
1312
<field name="role_type">global</field>
14-
<field name="comment">Can create and submit change requests for approval.</field>
13+
<field
14+
name="comment"
15+
>Can create and submit change requests for approval.</field>
1516
<field
1617
name="implied_ids"
1718
eval="[
@@ -53,5 +54,4 @@ User roles for Change Request module.
5354
]"
5455
/>
5556
</record>
56-
5757
</odoo>

spp_change_request_v2/details/add_member.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ class SPPCRDetailAddMember(models.Model):
2929
relationship_id = fields.Many2one(
3030
"spp.vocabulary.code",
3131
string="Relationship to Head",
32-
domain="[('vocabulary_id.namespace_uri', '=', 'urn:openspp:vocab:group-membership-type'), ('code', '!=', 'head')]",
32+
domain="[('vocabulary_id.namespace_uri', '=', 'urn:openspp:vocab:group-membership-type'),"
33+
" ('code', '!=', 'head')]",
3334
tracking=True,
3435
)
3536
id_number = fields.Char(string="ID Number", tracking=True)

spp_change_request_v2/details/change_hoh.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class SPPCRDetailChangeHOH(models.Model):
4141
previous_head_new_role_id = fields.Many2one(
4242
"spp.vocabulary.code",
4343
string="Previous Head's New Role",
44-
domain="[('vocabulary_id.namespace_uri', '=', 'urn:openspp:vocab:group-membership-type'), ('code', '!=', 'head')]",
44+
domain="[('vocabulary_id.namespace_uri', '=', 'urn:openspp:vocab:group-membership-type'),"
45+
" ('code', '!=', 'head')]",
4546
tracking=True,
4647
help="The new role for the previous head (e.g., Spouse, Other Adult)",
4748
)

spp_change_request_v2/details/merge_registrants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def _check_registrant_types(self):
132132
for dup in rec.duplicate_registrant_ids:
133133
if dup.is_group != primary_is_group:
134134
raise ValidationError(
135-
"Cannot merge individuals with groups. " "All registrants must be of the same type."
135+
"Cannot merge individuals with groups. All registrants must be of the same type."
136136
)
137137
if dup.id == rec.primary_registrant_id.id:
138138
raise ValidationError("Primary registrant cannot be in the duplicates list.")

spp_change_request_v2/details/split_household.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ def _check_minimum_remaining(self):
243243
)
244244
if len(rec.members_to_split_ids) >= total:
245245
raise ValidationError(
246-
"Cannot move all members. At least one member must remain " "in the source household."
246+
"Cannot move all members. At least one member must remain in the source household."
247247
)
248248

249249
@api.onchange("copy_address")

0 commit comments

Comments
 (0)