Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIG] l10n_it_corrispettivi_fatturapa_out #2979

Merged
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_out/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

{
"name": "ITA - Fattura elettronica - Emissione",
"version": "14.0.3.2.0",
"version": "14.0.3.3.0",
"development_status": "Beta",
"category": "Localization/Italy",
"summary": "Emissione fatture elettroniche",
Expand Down
21 changes: 21 additions & 0 deletions l10n_it_fatturapa_out/migrations/14.0.3.3.0/pre-migration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2023 Simone Rubino - TAKOBI
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from openupgradelib import openupgrade

merged_modules = {
"l10n_it_corrispettivi_fatturapa_out": "l10n_it_fatturapa_out",
}


def migrate(cr, installed_version):
installed_merged_modules = {
old_module: new_module
for old_module, new_module in merged_modules.items()
if openupgrade.is_module_installed(cr, old_module)
}
openupgrade.update_module_names(
cr,
installed_merged_modules.items(),
merge_modules=True,
)
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),
],
}"
>
<group string="Related Documents">
<field name="related_documents" nolabel="1">
Expand All @@ -64,8 +100,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 @@ -79,8 +122,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),
],
}"
>
<group string="Attachments">
<field name="fatturapa_doc_attachments" nolabel="1">
Expand Down