Skip to content

Commit 60de458

Browse files
committed
[IMP] account: added sent status filter and list view
At the current version the user is not able to see invoice status in list view, and is also not able to filter invoices based on their status, thus the change in the invoice list view filters to enable the user to perform those operations. task: 5231339
1 parent 9ae5720 commit 60de458

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

addons/account/models/account_move.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,13 @@ 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+
move_sent_selection = fields.Selection(
618+
selection=[
619+
('sent', 'Sent'),
620+
('not_sent', 'Not Sent'),
621+
],
622+
compute='compute_move_sent_selection',
623+
)
617624
is_being_sent = fields.Boolean(
618625
help="Is the move being sent asynchronously",
619626
compute='_compute_is_being_sent'
@@ -848,6 +855,11 @@ def _get_valid_journal_types(self):
848855
elif self.origin_payment_id or self.statement_line_id or self.env.context.get('is_payment') or self.env.context.get('is_statement_line'):
849856
return ['bank', 'cash', 'credit']
850857
return ['general']
858+
859+
@api.depends('is_move_sent')
860+
def compute_move_sent_selection(self):
861+
for move in self:
862+
move.move_sent_selection = 'sent' if move.is_move_sent else 'not_sent'
851863

852864
def _search_default_journal(self):
853865
if self.statement_line_ids.statement_id.journal_id:

addons/account/views/account_move_views.xml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,12 @@
549549
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
550550
optional="show"
551551
/>
552+
<field name="move_sent_selection"
553+
widget="badge"
554+
string="Sent"
555+
decoration-success="move_sent_selection == 'sent'"
556+
decoration-danger="move_sent_selection == 'not_sent'"
557+
optional="hide"/>
552558
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
553559
<field name="abnormal_amount_warning" column_invisible="1"/>
554560
<field name="abnormal_date_warning" column_invisible="1"/>
@@ -1595,10 +1601,15 @@
15951601
groups="account.group_account_secured,base.group_no_one"/>
15961602
<separator/>
15971603
<filter name="not_sent"
1598-
string="Not Sent"
1604+
string="Not Sent invoices"
15991605
domain="[('is_move_sent', '=', False)]"
16001606
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
16011607
/>
1608+
<filter name="sent"
1609+
string="Sent invoices"
1610+
domain="[('is_move_sent', '=', True)]"
1611+
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
1612+
/>
16021613
<separator/>
16031614
<filter name="out_invoice"
16041615
string="Invoices"

0 commit comments

Comments
 (0)