Skip to content

Commit 64cc296

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

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

addons/account/models/account_move.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,12 @@ 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=[('sent', "Sent"), ('not_sent', "Not sent")],
345+
compute='_compute_is_sent',
346+
copy=False,
347+
store=True
348+
)
343349

344350
# === Date fields === #
345351
invoice_date = fields.Date(
@@ -781,6 +787,11 @@ def _compute_invoice_default_sale_person(self):
781787
else:
782788
move.invoice_user_id = False
783789

790+
@api.depends('is_move_sent')
791+
def _compute_is_sent(self):
792+
for move in self:
793+
move.invoice_sent_status = 'sent' if move.is_move_sent else 'not_sent'
794+
784795
@api.depends('sending_data')
785796
def _compute_is_being_sent(self):
786797
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)