Skip to content

Commit 011e0b2

Browse files
committed
[IMP] account: add more visibility about the sent status of invoices
In the account module, we want to help customers visualize which invoice has been sent or not. task-5231288
1 parent 9d695bb commit 011e0b2

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

addons/account/models/account_move.py

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -614,13 +614,13 @@ def _sequence_year_range_monthly_regex(self):
614614
tracking=True,
615615
help="It indicates that the invoice/payment has been sent or the PDF has been generated.",
616616
)
617-
is_move_sent_string = fields.Selection(
617+
is_move_sent_value = fields.Selection(
618618
selection=[
619-
("sent", "Sent"),
620-
("not_sent", "Not Sent")
619+
('sent', "Sent"),
620+
('not_sent', "Not Sent")
621621
],
622622
copy=False,
623-
compute="_compute_is_move_sent_string"
623+
compute='_compute_is_move_sent_value'
624624
)
625625
is_being_sent = fields.Boolean(
626626
help="Is the move being sent asynchronously",
@@ -849,12 +849,9 @@ def _compute_journal_id(self):
849849
move.journal_id = move._search_default_journal()
850850

851851
@api.depends('is_move_sent')
852-
def _compute_is_move_sent_string(self):
852+
def _compute_is_move_sent_value(self):
853853
for move in self:
854-
if move.is_move_sent:
855-
move.is_move_sent_string = "sent"
856-
else:
857-
move.is_move_sent_string = "not_sent"
854+
move.is_move_sent_value = 'sent' if move.is_move_sent else 'not_sent'
858855

859856
def _get_valid_journal_types(self):
860857
if self.is_sale_document(include_receipts=True):

addons/account/views/account_move_views.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -549,11 +549,11 @@
549549
invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'"
550550
optional="show"
551551
/>
552-
<field name="is_move_sent_string"
552+
<field name="is_move_sent_value"
553553
string="Sent"
554554
widget="badge"
555-
decoration-danger="is_move_sent_string == 'not_sent'"
556-
decoration-success="is_move_sent_string == 'sent'"
555+
decoration-danger="is_move_sent_value == 'not_sent'"
556+
decoration-success="is_move_sent_value == 'sent'"
557557
optional="hide"
558558
/>
559559
<field name="move_type" column_invisible="context.get('default_move_type', True)"/>

0 commit comments

Comments
 (0)