summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Frantzen (bfr) <bfr@odoo.com>2021-01-13 15:06:26 +0000
committerBenjamin Frantzen (bfr) <bfr@odoo.com>2021-03-03 13:11:12 +0000
commit22edc603cc8fd0ac29fbbc074b25ce31a5b7e270 (patch)
tree38f8350d5deeebf10c2c3bd725eecb658e9639e8
parentfa7db335922780709216ea50559f818a5b50beeb (diff)
[IMP] account_edi: visual improvements on account.move and account.invoice.send
- don't show Electronic Invoicing field on account.move view if no EDI require web-service Backport of https://github.com/odoo/odoo/pull/64493 (TASK ID: 2439258) - don't show account_edi_format field on account_invoice_send closes odoo/odoo#67049 Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
-rw-r--r--addons/account_edi/models/account_move.py2
-rw-r--r--addons/account_edi/views/account_move_views.xml3
-rw-r--r--addons/account_edi/views/account_payment_views.xml3
-rw-r--r--addons/account_edi/wizard/account_invoice_send_views.xml3
4 files changed, 5 insertions, 6 deletions
diff --git a/addons/account_edi/models/account_move.py b/addons/account_edi/models/account_move.py
index b69cf611e5b..3faa9e144a2 100644
--- a/addons/account_edi/models/account_move.py
+++ b/addons/account_edi/models/account_move.py
@@ -29,7 +29,7 @@ class AccountMove(models.Model):
@api.depends('edi_document_ids.state')
def _compute_edi_state(self):
for move in self:
- all_states = set(move.edi_document_ids.mapped('state'))
+ all_states = set(move.edi_document_ids.filtered(lambda d: d.edi_format_id._needs_web_services()).mapped('state'))
if all_states == {'sent'}:
move.edi_state = 'sent'
elif all_states == {'cancelled'}:
diff --git a/addons/account_edi/views/account_move_views.xml b/addons/account_edi/views/account_move_views.xml
index 34debc4fb85..2b043ba5061 100644
--- a/addons/account_edi/views/account_move_views.xml
+++ b/addons/account_edi/views/account_move_views.xml
@@ -39,8 +39,7 @@
</xpath>
<xpath expr="//div[@name='journal_div']" position="after">
<field name="edi_document_ids" invisible="1" />
- <field name="edi_state" invisible="1" />
- <field name="edi_state" attrs="{'invisible': ['|', ('edi_document_ids', '=', []), ('state', '=', 'draft')]}"/>
+ <field name="edi_state" attrs="{'invisible': ['|', ('edi_state', '=', False), ('state', '=', 'draft')]}"/>
</xpath>
<xpath expr="//page[@id='other_tab']" position="after">
<page id="edi_documents" string="EDI Documents" groups="base.group_no_one" attrs="{'invisible': [('edi_document_ids', '=', [])]}">
diff --git a/addons/account_edi/views/account_payment_views.xml b/addons/account_edi/views/account_payment_views.xml
index b077de4a509..9e46cff31db 100644
--- a/addons/account_edi/views/account_payment_views.xml
+++ b/addons/account_edi/views/account_payment_views.xml
@@ -31,8 +31,7 @@
</xpath>
<xpath expr="//field[@name='journal_id']" position="after">
<field name="edi_document_ids" invisible="1" />
- <field name="edi_state" invisible="1" />
- <field name="edi_state" attrs="{'invisible': ['|', ('edi_document_ids', '=', []), ('state', '=', 'draft')]}"/>
+ <field name="edi_state" attrs="{'invisible': ['|', ('edi_state', '=', False), ('state', '=', 'draft')]}"/>
</xpath>
<xpath expr="//group[@name='group3']" position="after">
<group groups="base.group_no_one">
diff --git a/addons/account_edi/wizard/account_invoice_send_views.xml b/addons/account_edi/wizard/account_invoice_send_views.xml
index fe1c1b15920..510cb7f588d 100644
--- a/addons/account_edi/wizard/account_invoice_send_views.xml
+++ b/addons/account_edi/wizard/account_invoice_send_views.xml
@@ -2,12 +2,13 @@
<odoo>
<data>
<record model="ir.ui.view" id="account_invoice_send_inherit_account_wizard_form">
+ <!-- Deprecated, the field is now invisible. This view will be removed in future versions. -->
<field name="name">account.invoice.send.form.inherited.edi</field>
<field name="model">account.invoice.send</field>
<field name="inherit_id" ref="account.account_invoice_send_wizard_form"/>
<field name="arch" type="xml">
<xpath expr="//div[@name='mail_form']" position='before'>
- <div name="edi_format_option" attrs="{'invisible':[('edi_format_ids', '=', [])]}">
+ <div name="edi_format_option" invisible='1'>
<group>
<label for="edi_format_ids"/>
<div class="oe_inline">