From 9408e0d9db99dfc64fbdc7fa956753ad5e474e8a Mon Sep 17 00:00:00 2001 From: jbw Date: Tue, 24 Nov 2020 11:42:32 +0000 Subject: [PATCH] [IMP] account: Improve the validation process thanks to the "to check" boolean - keep track of to_check changes in chatter - add "set as checked" button - make the "to_check" field optional in list view - vendor bill / customer invoice : remove "entry" from "cancel entry" button. Task: 2389849 --- addons/account/models/account_move.py | 6 +++++- addons/account/views/account_move_views.xml | 9 ++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index d64cfeda184..1cc71ad27cd 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -152,7 +152,7 @@ class AccountMove(models.Model): ], string='Type', required=True, store=True, index=True, readonly=True, tracking=True, default="entry", change_default=True) type_name = fields.Char('Type Name', compute='_compute_type_name') - to_check = fields.Boolean(string='To Check', default=False, + to_check = fields.Boolean(string='To Check', default=False, tracking=True, help='If this checkbox is ticked, it means that the user was not sure of all the related information at the time of the creation of the move and that the move needs to be checked again.') journal_id = fields.Many2one('account.journal', string='Journal', required=True, readonly=True, states={'draft': [('readonly', False)]}, @@ -2557,6 +2557,10 @@ class AccountMove(models.Model): 'views': [[view_id, 'form']], } + def button_set_checked(self): + for move in self: + move.to_check = False + def button_draft(self): AccountMoveLine = self.env['account.move.line'] excluded_move_ids = [] diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index d16e5842f5a..c4acdc3dc24 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -405,6 +405,7 @@ + @@ -444,6 +445,7 @@ + @@ -567,9 +569,14 @@ attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'in_invoice')), ('state', '!=', 'posted')]}"/>