Skip to content

Commit

Permalink
[IMP] l10n_it_fatturapa_out: Show E-invoice fields only for outbound …
Browse files Browse the repository at this point in the history
…invoices
  • Loading branch information
SirTakobi authored and SirAionTech committed Jun 10, 2024
1 parent ef28190 commit aadf836
Showing 1 changed file with 59 additions and 9 deletions.
68 changes: 59 additions & 9 deletions l10n_it_fatturapa_out/views/account_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
<field name="inherit_id" ref="account.view_invoice_tree" />
<field name="arch" type="xml">
<xpath expr="//field[@name='state']" position="before">
<field name="fatturapa_state" />
<field
name="fatturapa_state"
invisible="context.get('default_move_type') not in ('out_invoice', 'in_refund')"
/>
</xpath>
</field>
</record>
Expand All @@ -24,27 +27,60 @@
type="action"
string="Export E-invoice"
class="oe_highlight"
attrs="{'invisible': ['|', '|', ('fatturapa_attachment_out_id', '!=', False), ('state' ,'!=', 'posted'), ('electronic_invoice_subjected', '=', False)]}"
attrs="{
'invisible': [
'|',
('move_type', 'not in', ('out_invoice', 'in_refund')),
'|',
'|',
('fatturapa_attachment_out_id', '!=', False),
('state' ,'!=', 'posted'),
('electronic_invoice_subjected', '=', False),
],
}"
/>
<button
name="%(action_wizard_export_fatturapa_regenerate)d"
type="action"
string="Re-Export E-invoice"
class="oe_highlight"
attrs="{'invisible': ['|', '|', ('fatturapa_attachment_out_id', '=', False), ('state' ,'!=', 'posted'), ('fatturapa_state', 'not in', ['error'])]}"
attrs="{
'invisible': [
'|',
('move_type', 'not in', ('out_invoice', 'in_refund')),
'|',
'|',
('fatturapa_attachment_out_id', '=', False),
('state' ,'!=', 'posted'),
('fatturapa_state', 'not in', ['error']),
],
}"
/>
</button>
<field name="partner_id" position="after">
<field name="electronic_invoice_subjected" invisible="1" />
</field>
<xpath expr="//field[@name='invoice_date']" position="after">
<field name="fatturapa_state" />
<field
name="fatturapa_state"
attrs="{
'invisible': [
('move_type', 'not in', ('out_invoice', 'in_refund')),
],
}"
/>
</xpath>

<xpath expr="//notebook" position="inside">
<page
string="Related Documents"
attrs="{'invisible': [('electronic_invoice_subjected', '=', False)]}"
attrs="{
'invisible': [
'|',
('move_type', 'not in', ('out_invoice', 'in_refund')),
('electronic_invoice_subjected', '=', False),
],
}"
>
<field name="related_documents" nolabel="1">
<tree editable="bottom">
Expand All @@ -62,8 +98,15 @@
</page>
<page
string="Electronic Invoice"
attrs="{'invisible': [('electronic_invoice_subjected', '=', False),
('fatturapa_attachment_out_id', '=', False)]}"
attrs="{
'invisible': [
'|',
('move_type', 'not in', ('out_invoice', 'in_refund')),
'&amp;',
('electronic_invoice_subjected', '=', False),
('fatturapa_attachment_out_id', '=', False),
],
}"
>
<group>
<group string="Results">
Expand All @@ -77,8 +120,15 @@
</page>
<page
string="Electronic Invoice Attachments"
attrs="{'invisible': [('electronic_invoice_subjected', '=', False),
('fatturapa_attachment_out_id', '=', False)]}"
attrs="{
'invisible': [
'|',
('move_type', 'not in', ('out_invoice', 'in_refund')),
'&amp;',
('electronic_invoice_subjected', '=', False),
('fatturapa_attachment_out_id', '=', False),
],
}"
>
<field name="fatturapa_doc_attachments" nolabel="1">
<tree>
Expand Down

0 comments on commit aadf836

Please sign in to comment.