Skip to content

[16.0][ADD] budget: add budget selection widget#583

Open
n3n wants to merge 8 commits into16.0from
16.0-add-budget-selection-widget
Open

[16.0][ADD] budget: add budget selection widget#583
n3n wants to merge 8 commits into16.0from
16.0-add-budget-selection-widget

Conversation

@n3n
Copy link
Member

@n3n n3n commented Mar 11, 2026

Summary

Add a reusable OWL view widget + TransientModel wizard for selecting budget codes. This allows consumer modules to replace inline field groups with a single <widget name="budget_selection"/> element.

What's included

  • Wizard (budget.selection.wizard): Transient model with budget fields and action_apply() method that writes budget_account_id + analytic_distribution JSON to parent record
  • OWL Widget: Displays selected budget info and opens wizard via modal dialog with pre-filled defaults
  • Wizard View: Form view with budget selection fields (activity/department/fund/source/budget_account) and footer buttons
  • Integration: Updated purchase_request_budget view to use new widget

Test plan

  • Install/upgrade budget module
  • Open a form view using <widget name="budget_selection"/>
  • Verify budget info displays correctly in read mode
  • Enter edit mode, click button to open wizard
  • Select budget codes, save, verify form updates

n3n added 8 commits March 11, 2026 18:04
Add a reusable OWL view widget + TransientModel wizard for selecting
budget codes, replacing inline field groups in consumer views.
- Move button above table, use btn-primary style
- Reorder wizard fields: activity/department/fund/source before budget_account
- Add py-2 padding to table rows
- Extract _getDisplayName helper to reduce duplication
Add exception rule validation to the shared budget selection wizard,
so all consumer models using the widget get the same validation rules.
Add budget.selection.mixin with action_select_budget() method and wire
it into purchase.request tree view with เลือก/แก้ไข buttons.
Extract budget validation logic into a reusable mixin so that any model
inheriting it can use the same checks in its own exception rules.
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.

1 participant