-
Notifications
You must be signed in to change notification settings - Fork 1
Add Submit button and statusbar to all detail forms and use Datetime.now() for membership start_date #21
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
Add Submit button and statusbar to all detail forms and use Datetime.now() for membership start_date #21
Changes from 2 commits
6130efd
33dbbc7
ed508f8
9e7eb4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,46 +6,66 @@ | |
| <field name="model">spp.cr.detail.add_member</field> | ||
| <field name="arch" type="xml"> | ||
| <form> | ||
| <header> | ||
| <button | ||
| name="action_submit_for_approval" | ||
| string="Submit for Approval" | ||
| type="object" | ||
| class="btn-primary" | ||
| invisible="approval_state != 'draft'" | ||
| /> | ||
| <button | ||
| name="action_submit_for_approval" | ||
| string="Resubmit for Review" | ||
| type="object" | ||
| class="btn-primary" | ||
| invisible="approval_state != 'revision'" | ||
| /> | ||
| <field | ||
| name="approval_state" | ||
| widget="statusbar" | ||
| statusbar_visible="draft,pending,approved,applied" | ||
| /> | ||
| </header> | ||
|
Comment on lines
+9
to
+29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To improve maintainability and reduce code duplication, consider extracting this common header into a reusable QWeb template. This same header is added to 11 different form views in this PR. By using a template, any future changes to the submission buttons or status bar will only need to be made in one place. You could define the template in a new or existing XML file (e.g., inside a <templates>
<t t-name="spp_change_request_v2.cr_detail_form_header">
<header>
<button
name="action_submit_for_approval"
string="Submit for Approval"
type="object"
class="btn-primary"
invisible="approval_state != 'draft'"
/>
<button
name="action_submit_for_approval"
string="Resubmit for Review"
type="object"
class="btn-primary"
invisible="approval_state != 'revision'"
/>
<field
name="approval_state"
widget="statusbar"
statusbar_visible="draft,pending,approved,applied"
/>
</header>
</t>
</templates>Then, you can replace the |
||
| <sheet> | ||
| <div class="oe_title"> | ||
| <h1>Add Member to Group</h1> | ||
| </div> | ||
|
|
||
| <!-- Target Group --> | ||
| <group string="Target Group"> | ||
| <field name="registrant_id" readonly="1"/> | ||
| <field name="change_request_id" invisible="1"/> | ||
| <field name="registrant_id" readonly="1" /> | ||
| <field name="change_request_id" invisible="1" /> | ||
| </group> | ||
|
|
||
| <!-- Member Details --> | ||
| <group string="New Member Information"> | ||
| <group> | ||
| <field name="given_name" required="1"/> | ||
| <field name="family_name" required="1"/> | ||
| <field name="member_name" readonly="1" force_save="1"/> | ||
| <field name="given_name" required="1" /> | ||
| <field name="family_name" required="1" /> | ||
| <field name="member_name" readonly="1" force_save="1" /> | ||
| </group> | ||
| <group> | ||
| <field name="birthdate"/> | ||
| <field name="gender_id"/> | ||
| <field name="relationship_id"/> | ||
| <field name="birthdate" /> | ||
| <field name="gender_id" /> | ||
| <field name="relationship_id" /> | ||
| </group> | ||
| </group> | ||
|
|
||
| <group string="Contact Information"> | ||
| <group> | ||
| <field name="phone"/> | ||
| <field name="id_number"/> | ||
| <field name="phone" /> | ||
| <field name="id_number" /> | ||
| </group> | ||
| </group> | ||
|
|
||
| <!-- Result (after apply) --> | ||
| <group string="Result" invisible="not created_individual_id"> | ||
| <field name="created_individual_id"/> | ||
| <field name="created_individual_id" /> | ||
| </group> | ||
| </sheet> | ||
| <chatter/> | ||
| <chatter /> | ||
| </form> | ||
| </field> | ||
| </record> | ||
|
|
||
| </odoo> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Statusbar references non-existent "applied" state in approval_state
Low Severity
The statusbar uses
approval_statefield withstatusbar_visible="draft,pending,approved,applied", butapproval_state(fromspp.approval.mixin) only has values:draft,pending,revision,approved,rejected. The valueapplieddoesn't exist in this field. The main change request view correctly usesdisplay_statewhich includesapplied. This inconsistency means detail forms will never display the "Completed" status in their statusbar, even when the change request has been applied.Additional Locations (2)
spp_change_request_v2/views/detail_change_hoh_views.xml#L23-L28spp_change_request_v2/views/detail_create_group_views.xml#L23-L28