From 9148960174bdb0abbee6a5b7403a8f48104a1dde Mon Sep 17 00:00:00 2001 From: Vincent Schippefilt Date: Tue, 15 May 2018 15:07:07 +0200 Subject: [PATCH] [IMP] account_budget: complete review of the module * budgetary position nor analytic account aren't required anymore (although one of the 2 have to be given) * by extension, the computation of practical amount is not either based on the analytic lines or the account.move.line * usability improved (for eaxmple: there's a button to open the list of items on which the practical amount computation is done) * addition of a pivot and graph views of the budget lines Was PR: #22342 Was task: 31995 --- addons/account/models/account_move.py | 2 +- .../views/res_config_settings_views.xml | 2 +- addons/account_budget/__manifest__.py | 25 +- .../data/account_budget_demo.xml | 204 +++++- .../account_budget/models/account_budget.py | 227 +++++-- addons/account_budget/tests/common.py | 74 +- .../tests/test_theoreticalamount.py | 127 ++-- .../views/account_budget_views.xml | 630 ++++++++++-------- 8 files changed, 802 insertions(+), 489 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 18c4c9f8846..b8efdff9ebf 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -468,7 +468,7 @@ class AccountMoveLine(models.Model): analytic_line_ids = fields.One2many('account.analytic.line', 'move_id', string='Analytic lines', oldname="analytic_lines") tax_ids = fields.Many2many('account.tax', string='Taxes') tax_line_id = fields.Many2one('account.tax', string='Originator tax', ondelete='restrict') - analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account') + analytic_account_id = fields.Many2one('account.analytic.account', string='Analytic Account', index=True) analytic_tag_ids = fields.Many2many('account.analytic.tag', string='Analytic Tags') company_id = fields.Many2one('res.company', related='account_id.company_id', string='Company', store=True, readonly=True) counterpart = fields.Char("Counterpart", compute='_get_counterpart', help="Compute the counter part accounts of this journal item for this journal entry. This can be needed in reports.") diff --git a/addons/account/views/res_config_settings_views.xml b/addons/account/views/res_config_settings_views.xml index 2c23fdf635b..c92d484504e 100644 --- a/addons/account/views/res_config_settings_views.xml +++ b/addons/account/views/res_config_settings_views.xml @@ -384,7 +384,7 @@