diff --git a/odex25_accounting/account_budget_custom/models/account_budget.py b/odex25_accounting/account_budget_custom/models/account_budget.py index 6db482737..5680a46f1 100644 --- a/odex25_accounting/account_budget_custom/models/account_budget.py +++ b/odex25_accounting/account_budget_custom/models/account_budget.py @@ -83,7 +83,7 @@ class CrossoveredBudgetLines(models.Model): for rec in self: orders = self.env['purchase.order.line'].search( [('account_analytic_id', '=', rec.analytic_account_id.id), - ('order_id.state', 'in', ['purchase'])]).mapped('order_id') + ('order_id.state', 'in', ['purchase','done'])]).mapped('order_id') total_orders = sum(orders.mapped('amount_total')) invoiced = self.env['account.move'].search( [('purchase_id', 'in', orders.ids), ('state', 'not in', ['draft', 'cancel'])]).mapped('amount_total') diff --git a/odex25_accounting/exp_budget_check/models/account_budget.py b/odex25_accounting/exp_budget_check/models/account_budget.py index 76345a6cb..94878cb33 100644 --- a/odex25_accounting/exp_budget_check/models/account_budget.py +++ b/odex25_accounting/exp_budget_check/models/account_budget.py @@ -14,7 +14,7 @@ class CrossoveredBudgetLines(models.Model): for rec in self: orders = self.env['purchase.order.line'].search( [('account_analytic_id', '=', rec.analytic_account_id.id), - ('order_id.state', 'in', ['purchase'])]).mapped('order_id') + ('order_id.state', 'in', ['purchase','done'])]).mapped('order_id') total_orders = sum(orders.mapped('amount_total')) invoiced = self.env['account.move'].search( [('purchase_id', 'in', orders.ids), ('state', 'not in', ['draft', 'cancel'])]).mapped('amount_total')