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
13 changes: 13 additions & 0 deletions addons/account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,14 @@ def _sequence_year_range_monthly_regex(self):
tracking=True,
help="It indicates that the invoice/payment has been sent or the PDF has been generated.",
)
is_move_sent_value = fields.Selection(
selection=[
('sent', "Sent"),
('not_sent', "Not Sent")
],
copy=False,
compute='_compute_is_move_sent_value'
)
is_being_sent = fields.Boolean(
help="Is the move being sent asynchronously",
compute='_compute_is_being_sent'
Expand Down Expand Up @@ -840,6 +848,11 @@ def _compute_journal_id(self):
for move in self.filtered(lambda r: r.journal_id.type not in r._get_valid_journal_types()):
move.journal_id = move._search_default_journal()

@api.depends('is_move_sent')
def _compute_is_move_sent_value(self):
for move in self:
move.is_move_sent_value = 'sent' if move.is_move_sent else 'not_sent'

def _get_valid_journal_types(self):
if self.is_sale_document(include_receipts=True):
return ['sale']
Expand Down
13 changes: 12 additions & 1 deletion addons/account/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,13 @@
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
optional="show"
/>
<field name="is_move_sent_value"
string="Sent"
widget="badge"
decoration-danger="is_move_sent_value == 'not_sent'"
decoration-success="is_move_sent_value == '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 @@ -1595,10 +1602,14 @@
groups="account.group_account_secured,base.group_no_one"/>
<separator/>
<filter name="not_sent"
string="Not Sent"
string="Not Sent Invoices"
domain="[('is_move_sent', '=', False)]"
invisible="context.get('default_move_type') in ('in_invoice', 'in_refund', 'in_receipt')"
/>
<filter name="sent"
string="Sent Invoices"
domain="[('is_move_sent', '=', True)]"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the not_sent filter, why not using the invisible 👀

/>
<separator/>
<filter name="out_invoice"
string="Invoices"
Expand Down