-
Notifications
You must be signed in to change notification settings - Fork 116
[IMP] account: add a label on the invoice list view to show sending status #4867
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0-rd-accounting-onboarding-malb
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -614,6 +614,7 @@ def _sequence_year_range_monthly_regex(self): | |
| tracking=True, | ||
| help="It indicates that the invoice/payment has been sent or the PDF has been generated.", | ||
| ) | ||
| is_move_sent_label = fields.Char(string="Invoice Sent", compute="_compute_is_move_sent_label") | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also rule of thumb for the quotes, use double quotes for what the user will see and single for the rest 😄 |
||
| is_being_sent = fields.Boolean( | ||
| help="Is the move being sent asynchronously", | ||
| compute='_compute_is_being_sent' | ||
|
|
@@ -765,6 +766,14 @@ def init(self): | |
| # COMPUTE METHODS | ||
| # ------------------------------------------------------------------------- | ||
|
|
||
| @api.depends('is_move_sent') | ||
| def _compute_is_move_sent_label(self): | ||
| for move in self: | ||
| if move.is_move_sent: | ||
| move.is_move_sent_label = "Sent" | ||
| else: | ||
| move.is_move_sent_label = "Not Sent" | ||
|
Comment on lines
+772
to
+775
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. one line this 😄 |
||
|
|
||
| @api.depends('move_type', 'partner_id') | ||
| def _compute_invoice_default_sale_person(self): | ||
| # We want to modify the sale person only when we don't have one and if the move type corresponds to this condition | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -549,6 +549,13 @@ | |
| invisible="payment_state == 'invoicing_legacy' or move_type == 'entry'" | ||
| optional="show" | ||
| /> | ||
| <field name="is_move_sent_label" | ||
| string="Send Status" | ||
| widget="badge" | ||
| decoration-success="is_move_sent" | ||
| decoration-danger="not is_move_sent" | ||
| optional="hide" | ||
| /> | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check the filter not_sent, might be nice to add one for sent also 👀 |
||
| <field name="move_type" column_invisible="context.get('default_move_type', True)"/> | ||
| <field name="abnormal_amount_warning" column_invisible="1"/> | ||
| <field name="abnormal_date_warning" column_invisible="1"/> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be better to use a selection field don't you think 👀