Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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'
Expand Down
11 changes: 11 additions & 0 deletions addons/account/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,12 @@
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
optional="show"
/>
<field name="send_status"
widget="badge"
decoration-success="send_status == 'sent'"
decoration-muted="send_status == 'not_sent'"
optional="hide"
/>
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
<field name="abnormal_amount_warning" column_invisible="1"/>
<field name="abnormal_date_warning" column_invisible="1"/>
Expand Down Expand Up @@ -1599,6 +1605,11 @@
domain="[('is_move_sent', '=', False)]"
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
/>
<filter name="sent"
string="Sent"
domain="[('is_move_sent', '=', True)]"
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
/>
<separator/>
<filter name="out_invoice"
string="Invoices"
Expand Down