forked from OCA/l10n-italy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by tafaRU
- Loading branch information
Showing
34 changed files
with
485 additions
and
219 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# Copyright 2019 Roberto Fichera <[email protected]> | ||
# Copyright 2022 Marco Colombo <[email protected]> | ||
# License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). | ||
|
||
from odoo import _, api, fields, models | ||
from odoo.exceptions import ValidationError | ||
|
||
_DEFAULT_XML_DIVISA_VALUE = "force_eur" | ||
|
||
|
||
class ResCompany(models.Model): | ||
_inherit = "res.company" | ||
|
@@ -15,6 +18,15 @@ class ResCompany(models.Model): | |
"in a single XML file. 0=Unlimited", | ||
) | ||
|
||
xml_divisa_value = fields.Selection( | ||
[ | ||
("keep_orig", "Keep original"), | ||
("force_eur", "Force euro"), | ||
], | ||
string="XML Divisa value", | ||
default=_DEFAULT_XML_DIVISA_VALUE, | ||
) | ||
|
||
@api.constrains("max_invoice_in_xml") | ||
def _validate_max_invoice_in_xml(self): | ||
if self.max_invoice_in_xml < 0: | ||
|
@@ -33,12 +45,20 @@ class AccountConfigSettings(models.TransientModel): | |
related="company_id.max_invoice_in_xml", readonly=False | ||
) | ||
|
||
xml_divisa_value = fields.Selection( | ||
related="company_id.xml_divisa_value", readonly=False | ||
) | ||
|
||
@api.onchange("company_id") | ||
def onchange_company_id(self): | ||
res = super(AccountConfigSettings, self).onchange_company_id() | ||
if self.company_id: | ||
company = self.company_id | ||
self.max_invoice_in_xml = company.max_invoice_in_xml or 0 | ||
self.xml_divisa_value = ( | ||
company.xml_divisa_value or _DEFAULT_XML_DIVISA_VALUE | ||
) | ||
else: | ||
self.max_invoice_in_xml = 0 | ||
self.xml_divisa_value = _DEFAULT_XML_DIVISA_VALUE | ||
return res |
104 changes: 0 additions & 104 deletions
104
l10n_it_fatturapa_out/tests/data/IT06363391001_00009.xml
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.