Skip to content

Commit 09d5836

Browse files
committed
[IMP] account: add a label on the invoice list view to show sending status
It would be easier for the user to see which invoices are sent or not in his list view task id: 5231300
1 parent 9ae5720 commit 09d5836

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

addons/account/models/account_move.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,7 @@ def _sequence_year_range_monthly_regex(self):
614614
tracking=True,
615615
help="It indicates that the invoice/payment has been sent or the PDF has been generated.",
616616
)
617+
is_move_sent_label = fields.Char(string="Invoice Sent", compute="_compute_is_move_sent_label")
617618
is_being_sent = fields.Boolean(
618619
help="Is the move being sent asynchronously",
619620
compute='_compute_is_being_sent'
@@ -765,6 +766,14 @@ def init(self):
765766
# COMPUTE METHODS
766767
# -------------------------------------------------------------------------
767768

769+
@api.depends('is_move_sent')
770+
def _compute_is_move_sent_label(self):
771+
for move in self:
772+
if move.is_move_sent:
773+
move.is_move_sent_label = "Sent"
774+
else:
775+
move.is_move_sent_label = "Not Sent"
776+
768777
@api.depends('move_type', 'partner_id')
769778
def _compute_invoice_default_sale_person(self):
770779
# We want to modify the sale person only when we don't have one and if the move type corresponds to this condition

addons/account/views/account_move_views.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,13 @@
549549
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
550550
optional="show"
551551
/>
552+
<field name="is_move_sent_label"
553+
string="Send Status"
554+
widget="badge"
555+
decoration-success="is_move_sent"
556+
decoration-danger="not is_move_sent"
557+
optional="hide"
558+
/>
552559
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
553560
<field name="abnormal_amount_warning" column_invisible="1"/>
554561
<field name="abnormal_date_warning" column_invisible="1"/>

0 commit comments

Comments
 (0)