[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#63543 X-original-commit: d393467886be1bd356a135e3fdc1ebb304c6614c Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com> Signed-off-by: Ivan Yelizariev // IEL <yelizariev@users.noreply.github.com>
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user