Skip to content
Snippets Groups Projects
Commit 082a3705 authored by Benjamin Frantzen (bfr)'s avatar Benjamin Frantzen (bfr)
Browse files

[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#67282

X-original-commit: 049ccc0257b36bb6c66ffe8a4498857a77498791
Related: odoo/upgrade#2235
Signed-off-by: default avatarLaurent Smet <smetl@users.noreply.github.com>
Signed-off-by: default avatarbfr-o <bfr-o@users.noreply.github.com>
parent 2cdd95f1
Branches
Tags
No related merge requests found
# -*- encoding: utf-8 -*-
from . import models
from . import wizard
......@@ -15,7 +15,6 @@ governements, etc.)
'depends' : ['account'],
'data': [
'security/ir.model.access.csv',
'wizard/account_invoice_send_views.xml',
'views/account_edi_document_views.xml',
'views/account_move_views.xml',
'views/account_payment_views.xml',
......
......@@ -65,7 +65,7 @@
</xpath>
<xpath expr="//div[@name='journal_div']" position="after">
<field name="edi_document_ids" invisible="1" />
<field name="edi_state" attrs="{'invisible': ['|', '|', ('edi_state', '=', False), ('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', '=', [])]}">
......
......@@ -49,7 +49,7 @@
</xpath>
<xpath expr="//field[@name='journal_id']" position="after">
<field name="edi_document_ids" invisible="1" />
<field name="edi_state" attrs="{'invisible': ['|', '|', ('edi_state', '=', False), ('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">
......
from . import account_invoice_send
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
from odoo.exceptions import UserError
import base64
class AccountInvoiceSend(models.TransientModel):
_inherit = 'account.invoice.send'
_description = 'Account Invoice Send'
edi_format_ids = fields.Many2many(related='invoice_ids.journal_id.edi_format_ids', string="Electronic invoicing")
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<record model="ir.ui.view" id="account_invoice_send_inherit_account_wizard_form">
<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', '=', [])]}">
<group>
<label for="edi_format_ids"/>
<div class="oe_inline">
<field name="edi_format_ids"
nolabel="1"
widget="many2many_tags"
placeholder="You can set default electronic invoicing formats on the journal"/>
</div>
</group>
</div>
</xpath>
</field>
</record>
</data>
</odoo>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment