From 7176d852753d9700965571369e93fcdd29002b49 Mon Sep 17 00:00:00 2001 From: Victor Decleire Date: Tue, 4 Nov 2025 15:43:36 +0100 Subject: [PATCH] [IMP] account: improved send status of invoices visibility When an invoice is sent there is no other way to ee it than in the form view by the button send & print thus I added an optional hide field in the list view that shows the send status and made 2 filters sent and not sent to easily differentiate those invoices task-5231328 --- addons/account/models/account_move.py | 16 +++++++++++++++- addons/account/views/account_move_views.xml | 11 +++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/addons/account/models/account_move.py b/addons/account/models/account_move.py index 16992bfcde100..42e9c6f381b23 100644 --- a/addons/account/models/account_move.py +++ b/addons/account/models/account_move.py @@ -618,7 +618,16 @@ def _sequence_year_range_monthly_regex(self): help="Is the move being sent asynchronously", compute='_compute_is_being_sent' ) - + send_status = fields.Selection( + selection=[ + ('sent', "Sent"), + ('not_sent', "Not sent") + ], + string="Send Status", + compute='_compute_send_status', + readonly=True, + copy=False, + ) invoice_user_id = fields.Many2one( string='Salesperson', comodel_name='res.users', @@ -786,6 +795,11 @@ def _compute_is_being_sent(self): for move in self: move.is_being_sent = bool(move.sending_data) + @api.depends('is_being_sent') + def _compute_send_status(self): + for move in self: + move.send_status = 'sent' if move.is_move_sent else 'not_sent' + def _compute_payment_reference(self): for move in self.filtered(lambda m: ( m.state == 'posted' diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml index 943748227126e..07da794d494e5 100644 --- a/addons/account/views/account_move_views.xml +++ b/addons/account/views/account_move_views.xml @@ -549,6 +549,12 @@ invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'" optional="show" /> + @@ -1599,6 +1605,11 @@ domain="[('is_move_sent', '=', False)]" invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')" /> +