Skip to content

Commit 3ecd648

Browse files
committed
[IMP] account: update the invoices list - show if the invoice is sent or not
1 parent e0a1783 commit 3ecd648

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

addons/account/models/account_move.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,15 @@ def _sequence_year_range_monthly_regex(self):
340340
copy=False,
341341
domain=[('display_type', 'in', ('product', 'line_section', 'line_note'))],
342342
)
343+
invoice_sent_status = fields.Selection(
344+
selection=[
345+
('sent', "Sent"),
346+
('not_sent', "Not sent")
347+
],
348+
compute='_compute_is_sent_status',
349+
copy=False,
350+
store=True
351+
)
343352

344353
# === Date fields === #
345354
invoice_date = fields.Date(
@@ -781,6 +790,11 @@ def _compute_invoice_default_sale_person(self):
781790
else:
782791
move.invoice_user_id = False
783792

793+
@api.depends('is_move_sent')
794+
def _compute_is_sent_status(self):
795+
for move in self:
796+
move.invoice_sent_status = 'sent' if move.is_move_sent else 'not_sent'
797+
784798
@api.depends('sending_data')
785799
def _compute_is_being_sent(self):
786800
for move in self:

addons/account/views/account_move_views.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@
550550
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
551551
optional="show"
552552
/>
553+
<field name="invoice_sent_status" string="Sent" optional="hide" widget="badge" decoration-success="is_move_sent" decoration-warning="not is_move_sent"/>
553554
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
554555
<field name="abnormal_amount_warning" column_invisible="1"/>
555556
<field name="abnormal_date_warning" column_invisible="1"/>
@@ -1595,6 +1596,15 @@
15951596
<filter name="not_secured" string="Not Secured" domain="[('secured', '=', False), ('state', '=', 'posted')]"
15961597
groups="account.group_account_secured,base.group_no_one"/>
15971598
<separator/>
1599+
<filter name="invoice_sent_status"
1600+
string="Sent invoices"
1601+
domain="[('invoice_sent_status', '=', 'sent')]"
1602+
/>
1603+
<filter name="invoice_sent_status"
1604+
string="Not sent invoices"
1605+
domain="[('invoice_sent_status', '=', 'not_sent')]"
1606+
/>
1607+
<separator/>
15981608
<filter name="not_sent"
15991609
string="Not Sent"
16001610
domain="[('is_move_sent', '=', False)]"

0 commit comments

Comments
 (0)