Skip to content

Commit

Permalink
[FIX] budget_control: flush module when precommit for check budget
Browse files Browse the repository at this point in the history
  • Loading branch information
Saran440 committed Aug 2, 2024
1 parent 721ec3e commit b94ce8b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions budget_control/models/budget_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,8 @@ def check_budget_precommit(self, doclines, doc_type="account"):
budget_move = line.with_context(force_commit=True).commit_budget()
if budget_move:
budget_moves.append(budget_move)
# Update database, so we can check budget with query
budget_move.flush_model()
# Check Budget
self.env["budget.period"].check_budget(doclines, doc_type=doc_type)
# Remove commits
Expand Down
2 changes: 2 additions & 0 deletions budget_control/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
string="Budget Figure"
width="10px"
widget="popover_widget"
attrs="{'invisible': [('analytic_distribution', '=', False)]}"
groups="budget_control.group_budget_control_user"
/>
</xpath>
Expand Down Expand Up @@ -84,6 +85,7 @@
string="Budget Figure"
width="10px"
widget="popover_widget"
attrs="{'invisible': [('analytic_distribution', '=', False)]}"
groups="budget_control.group_budget_control_user"
/>
</xpath>
Expand Down

0 comments on commit b94ce8b

Please sign in to comment.