Skip to content

Commit 3cfd6a9

Browse files
committed
[IMP] account: add sent status column and filters on invoice list
To improve traceability for users, it is now necessary to easily see which invoices have been sent, especially with the rise of electronic invoicing. This commit adds the 'sent' status as an optional column in the invoice list view. It also introduces two new search filters: 'Sent Invoices' and 'Not Sent Invoices' to quickly track documents that need to be dispatched. task-5231314
1 parent 9ae5720 commit 3cfd6a9

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
@@ -549,6 +549,7 @@
549549
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
550550
optional="show"
551551
/>
552+
<field name="invoice_sent_status" string="Sent" optional="hide" widget="badge" decoration-success="is_move_sent" decoration-warning="not is_move_sent"/>
552553
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
553554
<field name="abnormal_amount_warning" column_invisible="1"/>
554555
<field name="abnormal_date_warning" column_invisible="1"/>
@@ -1594,6 +1595,15 @@
15941595
<filter name="not_secured" string="Not Secured" domain="[('secured', '=', False), ('state', '=', 'posted')]"
15951596
groups="account.group_account_secured,base.group_no_one"/>
15961597
<separator/>
1598+
<filter name="invoice_sent_status"
1599+
string="Sent invoices"
1600+
domain="[('invoice_sent_status', '=', 'sent')]"
1601+
/>
1602+
<filter name="invoice_sent_status"
1603+
string="Not sent invoices"
1604+
domain="[('invoice_sent_status', '=', 'not_sent')]"
1605+
/>
1606+
<separator/>
15971607
<filter name="not_sent"
15981608
string="Not Sent"
15991609
domain="[('is_move_sent', '=', False)]"

0 commit comments

Comments
 (0)