Skip to content

Commit

Permalink
IMP l10n_it_vat_registries allowing to show full contact address in r…
Browse files Browse the repository at this point in the history
…eport
  • Loading branch information
eLBati committed Feb 16, 2024
1 parent 94c6063 commit b34343f
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 2 deletions.
1 change: 1 addition & 0 deletions l10n_it_vat_registries/models/account_tax_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ class AccountTaxRegistry(models.Model):
"Layout",
required=True,
)
show_full_contact_addess = fields.Boolean()
1 change: 1 addition & 0 deletions l10n_it_vat_registries/models/vat_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def _get_report_values(self, docids, data=None):
"compute_totals_tax": self._compute_totals_tax,
"l10n_it_count_fiscal_page_base": data["form"]["fiscal_page_base"],
"only_totals": data["form"]["only_totals"],
"show_full_contact_addess": data["form"]["show_full_contact_addess"],
"date_format": date_format,
"year_footer": data["form"]["year_footer"],
}
Expand Down
12 changes: 10 additions & 2 deletions l10n_it_vat_registries/report/report_registro_iva.xml
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,18 @@
/></td>
</t>
<!-- Ragione sociale -->
<td class="left_without_line_bold"><div
<td class="left_without_line_bold">
<div
t-if="not show_full_contact_addess"
style="page-break-inside: avoid"
t-esc="move.partner_id.name"
/></td>
/>
<div
t-if="show_full_contact_addess"
style="page-break-inside: avoid"
t-esc="move.partner_id.contact_address"
/>
</td>
<!-- PIVA -->
<td class="left_without_line_bold"><div
style="page-break-inside: avoid"
Expand Down
1 change: 1 addition & 0 deletions l10n_it_vat_registries/views/account_tax_registry_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<group>
<field name="name" />
<field name="layout_type" />
<field name="show_full_contact_addess" />
</group>
<separator string="Journals" />
<field name="journal_ids" />
Expand Down
3 changes: 3 additions & 0 deletions l10n_it_vat_registries/wizard/print_registro_iva.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class WizardRegistroIva(models.TransientModel):
required=True,
default="customer",
)
show_full_contact_addess = fields.Boolean()
tax_registry_id = fields.Many2one("account.tax.registry", "VAT registry")
journal_ids = fields.Many2many(
"account.journal",
Expand All @@ -41,6 +42,7 @@ class WizardRegistroIva(models.TransientModel):
def on_change_tax_registry_id(self):
self.journal_ids = self.tax_registry_id.journal_ids
self.layout_type = self.tax_registry_id.layout_type
self.show_full_contact_addess = self.tax_registry_id.show_full_contact_addess

@api.onchange("date_range_id")
def on_change_date_range_id(self):
Expand Down Expand Up @@ -96,6 +98,7 @@ def print_registro(self):
else:
datas_form["tax_registry_name"] = ""
datas_form["only_totals"] = wizard.only_totals
datas_form["show_full_contact_addess"] = wizard.show_full_contact_addess
# report_name = 'l10n_it_vat_registries.report_registro_iva'
report_name = "l10n_it_vat_registries.action_report_registro_iva"
datas = {"ids": move_ids, "model": "account.move", "form": datas_form}
Expand Down
1 change: 1 addition & 0 deletions l10n_it_vat_registries/wizard/print_registro_iva.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
/>
<group string="Layout">
<field name="layout_type" />
<field name="show_full_contact_addess" />
<field name="only_totals" />
<field name="fiscal_page_base" />
</group>
Expand Down

0 comments on commit b34343f

Please sign in to comment.