summaryrefslogtreecommitdiff
path: root/addons/l10n_it_edi
diff options
context:
space:
mode:
authorAnkita Raval <anr@odoo.com>2019-10-30 06:11:02 +0000
committerJigar Vaghela <jva@odoo.com>2020-02-19 09:09:20 +0000
commitd675dbaa4c7174591e0e7c1a3caf3e76877312ce (patch)
tree40840df0a36cb9a6ba3b918835da2a40a07e3a3b /addons/l10n_it_edi
parent8f6bf2087e50020bfad4e336b1d4c5a98a4fa84f (diff)
[IMP] account,* : Change type field to move_type in account.move
task-id: 2028z813
Diffstat (limited to 'addons/l10n_it_edi')
-rw-r--r--addons/l10n_it_edi/models/account_invoice.py12
-rw-r--r--addons/l10n_it_edi/views/l10n_it_view.xml14
2 files changed, 13 insertions, 13 deletions
diff --git a/addons/l10n_it_edi/models/account_invoice.py b/addons/l10n_it_edi/models/account_invoice.py
index 387e6655289..b09bf002b96 100644
--- a/addons/l10n_it_edi/models/account_invoice.py
+++ b/addons/l10n_it_edi/models/account_invoice.py
@@ -161,7 +161,7 @@ class AccountMove(models.Model):
invoice.l10n_it_einvoice_name = report_name
data = b"<?xml version='1.0' encoding='UTF-8'?>" + invoice._export_as_xml()
- description = _('Italian invoice: %s') % invoice.type
+ description = _('Italian invoice: %s') % invoice.move_type
invoice.l10n_it_einvoice_id = self.env['ir.attachment'].create({
'name': report_name,
'res_id': invoice.id,
@@ -226,9 +226,9 @@ class AccountMove(models.Model):
if len(self.commercial_partner_id.l10n_it_pa_index or '1') == 6:
formato_trasmissione = "FPA12"
- if self.type == 'out_invoice':
+ if self.move_type == 'out_invoice':
document_type = 'TD01'
- elif self.type == 'out_refund':
+ elif self.move_type == 'out_refund':
document_type = 'TD04'
else:
document_type = 'TD0X'
@@ -320,9 +320,9 @@ class AccountMove(models.Model):
elements = tree.xpath('//DatiGeneraliDocumento/TipoDocumento', namespaces=tree.nsmap)
if elements and elements[0].text and elements[0].text == 'TD01':
- self_ctx = self.with_context(default_type='in_invoice')
+ self_ctx = self.with_context(default_move_type='in_invoice')
elif elements and elements[0].text and elements[0].text == 'TD04':
- self_ctx = self.with_context(default_type='in_refund')
+ self_ctx = self.with_context(default_move_type='in_refund')
else:
_logger.info(_('Document type not managed: %s.') % (elements[0].text))
@@ -361,7 +361,7 @@ class AccountMove(models.Model):
elif elements and elements[0].text and elements[0].text == 'TD04':
type = 'in_refund'
# self could be a single record (editing) or be empty (new).
- with Form(self.with_context(default_type=type)) as invoice_form:
+ with Form(self.with_context(default_move_type=type)) as invoice_form:
message_to_log = []
# Partner (first step to avoid warning 'Warning! You must first select a partner.'). <1.2>
diff --git a/addons/l10n_it_edi/views/l10n_it_view.xml b/addons/l10n_it_edi/views/l10n_it_view.xml
index 7f3a1f51297..fb4aedb7cd0 100644
--- a/addons/l10n_it_edi/views/l10n_it_view.xml
+++ b/addons/l10n_it_edi/views/l10n_it_view.xml
@@ -153,31 +153,31 @@
<data>
<xpath expr="//button[@name='preview_invoice']" position="after">
<button name="post" type="object" icon="fa-envelope-o" class="btn btn-primary" string="Resend"
- attrs="{'invisible': ['|', ('type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'invalid')]}"/>
+ attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'invalid')]}"/>
</xpath>
- <xpath expr="//field[@name='type']" position="before">
+ <xpath expr="//field[@name='move_type']" position="before">
<div class="alert alert-success" role="alert"
- attrs="{'invisible': ['|', ('type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', 'not in', ['delivered', 'delivered_accepted', 'delivered_refused', 'delivered_expired', 'failed_delivery'])]}">
+ attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', 'not in', ['delivered', 'delivered_accepted', 'delivered_refused', 'delivered_expired', 'failed_delivery'])]}">
<i class="fa fa-check" aria-label="Delivered" title="Delivered"></i> <field name="l10n_it_send_state" readonly="1"/>
</div>
<div class="alert alert-warning" role="alert"
- attrs="{'invisible': ['|', ('type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'sent')]}">
+ attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'sent')]}">
<i class="fa fa-paper-plane-o"/> E-Invoice sent, waiting for a response
</div>
<div class="alert alert-danger" role="alert"
- attrs="{'invisible': ['|', ('type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'invalid')]}">
+ attrs="{'invisible': ['|', ('move_type', 'not in', ('out_invoice', 'out_refund')), ('l10n_it_send_state', '!=', 'invalid')]}">
<i class="fa fa-exclamation-triangle"/> E-Invoice check failed. You can modify the invoice, and resend it.
</div>
</xpath>
<xpath expr="//page[@name='other_info']" position="after">
<page string="Electronic Invoicing"
name="electronic_invoicing"
- attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}">
+ attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund'))]}">
<group>
<group>
<field name="l10n_it_stamp_duty"/>
<field name="l10n_it_ddt_id"
- attrs="{'invisible': [('type', 'not in', ('out_invoice', 'out_refund'))]}"/>
+ attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund'))]}"/>
</group>
</group>
</page>