[FIX] account_edi: fix 'send now' visibility in account.move form view
- Before the fix, the banner with the button would show when the move is posted or in creation mode even though no async edi is associated to this move. closes odoo/odoo#62974 X-original-commit: e18c3f023d10944b2cea9cd23703529b41ba48d3 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com> Signed-off-by: bfr-o <bfr-o@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)
|
||||
move.edi_web_services_to_process = ', '.join(f.name for f in format_web_services) or False
|
||||
|
||||
@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', '=', '')]}">
|
||||
attrs="{'invisible': [('edi_web_services_to_process', '=', False)]}">
|
||||
<div>The invoice will be sent asynchronously to :
|
||||
<field name="edi_web_services_to_process" class="oe_inline"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user