Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 8 additions & 12 deletions l10n_it_vat_settlement_communication/README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
.. image:: https://odoo-community.org/readme-banner-image
:target: https://odoo-community.org/get-involved?utm_source=readme
:alt: Odoo Community Association

====================================
ITA - Comunicazione liquidazione IVA
====================================
Expand All @@ -17,7 +13,7 @@ ITA - Comunicazione liquidazione IVA
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/license-AGPL--3-blue.png
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github
Expand Down Expand Up @@ -61,9 +57,9 @@ escludere il valore dell'imposta.
Usage
=====

- Creare una nuova comunicazione.
- Nel "Quadro VP" aggiungere una voce selezionando in alto la
liquidazione, precedentemente creata, da inserire.
- Creare una nuova comunicazione.
- Nel "Quadro VP" aggiungere una voce selezionando in alto la
liquidazione, precedentemente creata, da inserire.

Bug Tracker
===========
Expand All @@ -86,10 +82,10 @@ Authors
Contributors
------------

- Alessandro Camilli
- Lorenzo Battistini
- Lara Baggio
- `Nextev Srl <https://nextev.it>`__ odoo@nextev.it
- Alessandro Camilli
- Lorenzo Battistini
- Lara Baggio
- `Nextev Srl <https://nextev.it>`__ odoo@nextev.it

Maintainers
-----------
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_vat_settlement_communication/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "ITA - Comunicazione liquidazione IVA",
"summary": "Comunicazione liquidazione IVA ed esportazione file xml"
"conforme alle specifiche dell'Agenzia delle Entrate",
"version": "18.0.1.0.1",
"version": "18.0.1.0.2",
"category": "Account",
"author": "Openforce di Camilli Alessandro, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/l10n-italy",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,13 @@ def _default_company(self):
company_id = self._context.get("company_id", self.env.company.id)
return company_id

@api.constrains("identificativo")
def _check_identificativo(self):
domain = [("identificativo", "=", self.identificativo)]
dichiarazioni = self.search(domain)
if len(dichiarazioni) > 1:
raise ValidationError(
self.env._("Communication with identifier {} already exists").format(
self.identificativo
)
)
_sql_constraints = [
(
"unique_identificativo_per_company",
"UNIQUE(company_id, identificativo)",
"Communication with this identifier already exists for the company.",
),
]

def _compute_name(self):
for dich in self:
Expand All @@ -52,11 +49,13 @@ def _compute_name(self):
dich.name = name

def _get_identificativo(self):
dichiarazioni = self.search([])
if dichiarazioni:
return len(dichiarazioni) + 1
else:
return 1
company_id = self._context.get("company_id", self.env.company.id)
last = self.search(
[("company_id", "=", company_id)],
order="identificativo desc",
limit=1,
)
return (last.identificativo or 0) + 1

company_id = fields.Many2one(
"res.company", string="Company", required=True, default=_default_company
Expand Down
28 changes: 11 additions & 17 deletions l10n_it_vat_settlement_communication/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>README.rst</title>
<title>ITA - Comunicazione liquidazione IVA</title>
<style type="text/css">

/*
Expand Down Expand Up @@ -360,21 +360,16 @@
</style>
</head>
<body>
<div class="document">
<div class="document" id="ita-comunicazione-liquidazione-iva">
<h1 class="title">ITA - Comunicazione liquidazione IVA</h1>


<a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
<img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
</a>
<div class="section" id="ita-comunicazione-liquidazione-iva">
<h1>ITA - Comunicazione liquidazione IVA</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:7726bc879478d9950cf5864854b51db64c583ce368ca9b079e992e5e5e330fe9
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_settlement_communication"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_vat_settlement_communication"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-italy/tree/18.0/l10n_it_vat_settlement_communication"><img alt="OCA/l10n-italy" src="https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-italy-18-0/l10n-italy-18-0-l10n_it_vat_settlement_communication"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>Comunicazione liquidazione IVA ed export file XML, conforme alle
specifiche dell’’Agenzia delle Entrate.</p>
<p>I dati possono essere caricati da liquidazioni IVA effettuate in odoo
Expand All @@ -394,7 +389,7 @@ <h1>ITA - Comunicazione liquidazione IVA</h1>
</ul>
</div>
<div class="section" id="configuration">
<h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
<h1><a class="toc-backref" href="#toc-entry-1">Configuration</a></h1>
<p>Nella scheda dell’imposta è possibile configurare “Escludere dalle
operazioni attive / passive” e/o “Escludere dall’IVA esigibile /
detratta”.</p>
Expand All @@ -406,31 +401,31 @@ <h2><a class="toc-backref" href="#toc-entry-1">Configuration</a></h2>
escludere il valore dell’imposta.</p>
</div>
<div class="section" id="usage">
<h2><a class="toc-backref" href="#toc-entry-2">Usage</a></h2>
<h1><a class="toc-backref" href="#toc-entry-2">Usage</a></h1>
<ul class="simple">
<li>Creare una nuova comunicazione.</li>
<li>Nel “Quadro VP” aggiungere una voce selezionando in alto la
liquidazione, precedentemente creata, da inserire.</li>
</ul>
</div>
<div class="section" id="bug-tracker">
<h2><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h2>
<h1><a class="toc-backref" href="#toc-entry-3">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/l10n-italy/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_vat_settlement_communication%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h2><a class="toc-backref" href="#toc-entry-4">Credits</a></h2>
<h1><a class="toc-backref" href="#toc-entry-4">Credits</a></h1>
<div class="section" id="authors">
<h3><a class="toc-backref" href="#toc-entry-5">Authors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-5">Authors</a></h2>
<ul class="simple">
<li>Openforce di Camilli Alessandro</li>
</ul>
</div>
<div class="section" id="contributors">
<h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Alessandro Camilli</li>
<li>Lorenzo Battistini</li>
Expand All @@ -439,7 +434,7 @@ <h3><a class="toc-backref" href="#toc-entry-6">Contributors</a></h3>
</ul>
</div>
<div class="section" id="maintainers">
<h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
<h2><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org">
<img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
Expand All @@ -452,6 +447,5 @@ <h3><a class="toc-backref" href="#toc-entry-7">Maintainers</a></h3>
</div>
</div>
</div>
</div>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# Copyright 2023 Tony Masci (Rapsodoo)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

from psycopg2 import IntegrityError

from odoo import fields
from odoo.exceptions import UserError, ValidationError
from odoo.tests import Form, tagged
from odoo.tools import mute_logger

from odoo.addons.l10n_it_account_vat_period_end_settlement.tests.common import (
TestVATStatementCommon,
Expand Down Expand Up @@ -168,10 +171,11 @@ def test_identificativo(self):

self.assertEqual(comunicazione_liquidazione.identificativo, 2)

with self.assertRaises(ValidationError):
vals = self.get_vals_comunicazione_liquidazione()
vals["identificativo"] = 2
self.env["comunicazione.liquidazione"].create(vals)
with self.assertRaises(IntegrityError), mute_logger("odoo.sql_db"):
with self.env.cr.savepoint():
vals = self.get_vals_comunicazione_liquidazione()
vals["identificativo"] = 2
self.env["comunicazione.liquidazione"].create(vals)

comunicazione_liquidazione = self.env["comunicazione.liquidazione"].create(
self.get_vals_comunicazione_liquidazione()
Expand Down
Loading