Skip to content

Commit 4e59de7

Browse files
committed
[IMP] account: more visibility about the sent status of invoice
With the evolution of the electronic invoicing, but also in general, it's a good idea to show more easily when an invoice is sent or not by the send & print. User can easily see the difference between invoices which are Sent or not. task-4908889
1 parent 6819f50 commit 4e59de7

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

addons/account/models/account_move.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -603,6 +603,12 @@ def _sequence_year_range_monthly_regex(self):
603603
tracking=True,
604604
help="It indicates that the invoice/payment has been sent or the PDF has been generated.",
605605
)
606+
607+
move_sent_state = fields.Selection(
608+
selection=[('not_sent', "Not Sent"), ('sent', "Sent")],
609+
compute='_compute_move_sent_state',
610+
)
611+
606612
is_being_sent = fields.Boolean(
607613
help="Is the move being sent asynchronously",
608614
compute='_compute_is_being_sent'
@@ -1724,6 +1730,11 @@ def _compute_narration(self):
17241730
del context
17251731
move.narration = narration or False
17261732

1733+
@api.depends('is_move_sent')
1734+
def _compute_move_sent_state(self):
1735+
for move in self:
1736+
move.move_sent_state = 'sent' if move.is_move_sent else 'not_sent'
1737+
17271738
def _get_partner_credit_warning_exclude_amount(self):
17281739
# to extend in module 'sale'; see there for details
17291740
self.ensure_one()

addons/account/views/account_move_views.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,12 @@
548548
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
549549
optional="show"
550550
/>
551+
<field name="move_sent_state"
552+
widget="badge"
553+
string="Move Sent?"
554+
decoration-info="move_sent_state == 'not_sent'"
555+
decoration-success="move_sent_state == 'sent'"
556+
optional="hide"/>
551557
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>
552558
<field name="abnormal_amount_warning" column_invisible="1"/>
553559
<field name="abnormal_date_warning" column_invisible="1"/>

0 commit comments

Comments
 (0)