Skip to content

Commit 811bd7b

Browse files
committed
[IMP] account: add invoice sent status column and filter
Improved the invoice list view by adding a new column indicating whether each invoice has been sent. This gives users better visibility into communication status at a glance. Also introduced a filter to allow users to easily search for sent or unsent invoices, improving usability during follow-up or audit tasks.
1 parent 6819f50 commit 811bd7b

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

addons/account/models/account_move.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -607,6 +607,10 @@ def _sequence_year_range_monthly_regex(self):
607607
help="Is the move being sent asynchronously",
608608
compute='_compute_is_being_sent'
609609
)
610+
send_status_display = fields.Char(
611+
string='Send Status Display',
612+
compute='_compute_send_status_display',
613+
)
610614

611615
invoice_user_id = fields.Many2one(
612616
string='Salesperson',
@@ -774,6 +778,11 @@ def _compute_invoice_default_sale_person(self):
774778
def _compute_is_being_sent(self):
775779
for move in self:
776780
move.is_being_sent = bool(move.sending_data)
781+
782+
@api.depends('is_move_sent')
783+
def _compute_send_status_display(self):
784+
for move in self:
785+
move.send_status_display = _('Sent') if move.is_move_sent else _('Not Sent')
777786

778787
def _compute_payment_reference(self):
779788
for move in self.filtered(lambda m: (

addons/account/views/account_move_views.xml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,14 @@
548548
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
549549
optional="show"
550550
/>
551+
<field name="send_status_display"
552+
string="Send Status"
553+
widget="badge"
554+
decoration-danger="is_move_sent == False"
555+
decoration-success="is_move_sent == True"
556+
invisible="state == 'draft'"
557+
optional="hide"
558+
/>
551559
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
552560
<field name="abnormal_amount_warning" column_invisible="1"/>
553561
<field name="abnormal_date_warning" column_invisible="1"/>
@@ -1581,8 +1589,13 @@
15811589
<filter name="not_secured" string="Not Secured" domain="[('secured', '=', False), ('state', '=', 'posted')]"
15821590
groups="account.group_account_secured,base.group_no_one"/>
15831591
<separator/>
1592+
<filter name="sent"
1593+
string="Sent Invoices"
1594+
domain="[('is_move_sent', '=', True)]"
1595+
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
1596+
/>
15841597
<filter name="not_sent"
1585-
string="Not Sent"
1598+
string="Not Sent Invoices"
15861599
domain="[('is_move_sent', '=', False)]"
15871600
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
15881601
/>

0 commit comments

Comments
 (0)