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')" /> +