Skip to content

Commit a25648d

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. task-4908852
1 parent 6819f50 commit a25648d

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

addons/account/models/account_move.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,14 @@ def _sequence_year_range_monthly_regex(self):
605605
)
606606
is_being_sent = fields.Boolean(
607607
help="Is the move being sent asynchronously",
608-
compute='_compute_is_being_sent'
608+
compute='_compute_is_being_sent',
609+
)
610+
send_status_display = fields.Selection(
611+
selection=[
612+
('sent', 'Sent'),
613+
('not_sent', 'Not Sent'),
614+
],
615+
compute='_compute_send_status_display'
609616
)
610617

611618
invoice_user_id = fields.Many2one(
@@ -774,6 +781,11 @@ def _compute_invoice_default_sale_person(self):
774781
def _compute_is_being_sent(self):
775782
for move in self:
776783
move.is_being_sent = bool(move.sending_data)
784+
785+
@api.depends('is_move_sent')
786+
def _compute_send_status_display(self):
787+
for move in self:
788+
move.send_status_display = 'sent' if move.is_move_sent else 'not_sent'
777789

778790
def _compute_payment_reference(self):
779791
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)