diff options
| author | Ivan Yelizariev <iel@odoo.com> | 2020-12-15 13:35:14 +0000 |
|---|---|---|
| committer | Ivan Yelizariev <iel@odoo.com> | 2020-12-17 12:11:02 +0000 |
| commit | d393467886be1bd356a135e3fdc1ebb304c6614c (patch) | |
| tree | 1c345ecfaee89bbadf9051a4d690727b950f393c /addons | |
| parent | cc531a07002fd8642f53e77c0fa52a49753e9df8 (diff) | |
[FIX] account_edi: hide alert when there are no web services
this is more safe way than previously applied in
https://github.com/odoo/odoo/pull/62939
because it doesn't require ``-u account_edi`` in cases when it worked
correctly, i.e. when _compute_edi_web_services_to_process is called, but
computes empty string value.
Additionally, it fixes same problem in account.payment model.
---
opw-2414500
closes odoo/odoo#63397
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/account_edi/models/account_move.py | 2 | ||||
| -rw-r--r-- | addons/account_edi/views/account_move_views.xml | 2 | ||||
| -rw-r--r-- | addons/account_edi/views/account_payment_views.xml | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/addons/account_edi/models/account_move.py b/addons/account_edi/models/account_move.py index 95b279414cf..46d8e1d67b7 100644 --- a/addons/account_edi/models/account_move.py +++ b/addons/account_edi/models/account_move.py @@ -55,7 +55,7 @@ class AccountMove(models.Model): for move in self: to_process = move.edi_document_ids.filtered(lambda d: d.state in ['to_send', 'to_cancel']) format_web_services = to_process.edi_format_id.filtered(lambda f: f._needs_web_services()) - move.edi_web_services_to_process = ', '.join(f.name for f in format_web_services) or False + move.edi_web_services_to_process = ', '.join(f.name for f in format_web_services) @api.depends('restrict_mode_hash_table', 'state') def _compute_show_reset_to_draft_button(self): diff --git a/addons/account_edi/views/account_move_views.xml b/addons/account_edi/views/account_move_views.xml index 1a0d8f8e7d9..b52ca353e0f 100644 --- a/addons/account_edi/views/account_move_views.xml +++ b/addons/account_edi/views/account_move_views.xml @@ -24,7 +24,7 @@ </xpath> <xpath expr="//header" position="after"> <div class="alert alert-info" role="alert" style="margin-bottom:0px;" - attrs="{'invisible': [('edi_web_services_to_process', '=', False)]}"> + attrs="{'invisible': [('edi_web_services_to_process', 'in', ['', False])]}"> <div>The invoice will be sent asynchronously to : <field name="edi_web_services_to_process" class="oe_inline"/> </div> diff --git a/addons/account_edi/views/account_payment_views.xml b/addons/account_edi/views/account_payment_views.xml index 8f2983f019a..b077de4a509 100644 --- a/addons/account_edi/views/account_payment_views.xml +++ b/addons/account_edi/views/account_payment_views.xml @@ -16,7 +16,7 @@ <field name="arch" type="xml"> <xpath expr="//header" position="after"> <div class="alert alert-info" role="alert" style="margin-bottom:0px;" - attrs="{'invisible': ['|', ('edi_web_services_to_process', '=', ''), ('state', '=', 'draft')]}"> + attrs="{'invisible': ['|', ('edi_web_services_to_process', 'in', ['', False]), ('state', '=', 'draft')]}"> <div>The payment will be sent asynchronously to : <field name="edi_web_services_to_process" class="oe_inline"/> </div> |
