-
-
Notifications
You must be signed in to change notification settings - Fork 309
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
[14.0][MIG] l10n_it_fatturapa_out_triple_discount #3681
Changes from all commits
3cade46
fe85f2e
9d1be02
6606e0f
92f8eb7
818bbc7
2b178bd
009e56c
56fe5dc
68db54c
c1b458f
50a99d6
8f1fdb9
99d3e3b
c07d867
64d51d5
ac80434
c251aa9
ec71d58
2606fec
1908593
958d820
360a60b
81f0da8
42b71eb
384ed28
d85268d
8dd0e03
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,12 +174,19 @@ def get_all_taxes(record): | |
wiz = self.env["wizard.export.fatturapa"] | ||
return wiz.getAllTaxes(record) | ||
|
||
def get_importo(line): | ||
str_number = str(line.discount) | ||
def get_importo(line, discount_field="discount"): | ||
str_number = str(line[discount_field]) | ||
number = str_number[::-1].find(".") | ||
if number <= 2: | ||
return False | ||
return line.price_unit * line.discount / 100 | ||
if discount_field == "discount2": | ||
price_unit = line.price_unit * (1 - line.discount / 100) | ||
return price_unit * line[discount_field] / 100 | ||
elif discount_field == "discount3": | ||
price_unit = line.price_unit * (1 - line.discount / 100) | ||
price_unit = price_unit * (1 - line.discount2 / 100) | ||
return price_unit * line[discount_field] / 100 | ||
return line.price_unit * line[discount_field] / 100 | ||
Comment on lines
+182
to
+189
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Questo codice serve solo nel caso in cui sia installato account_invoice_triple_discount che non è una dipendenza del modulo l10n_it_fatturapa_out, si può spostare in l10n_it_fatturapa_out_triple_discount? |
||
|
||
def get_importo_totale(invoice): | ||
# wrapper to a method in wizard (for better overriding) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
====================================================== | ||
ITA - Fattura elettronica - Integrazione sconto triplo | ||
====================================================== | ||
|
||
.. | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! This file is generated by oca-gen-addon-readme !! | ||
!! changes will be overwritten. !! | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
!! source digest: sha256:3652bd491ec5c99bbb9371877cd7903143ccbfc4a86053fd8f157a9f7fadca9c | ||
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | ||
|
||
.. |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/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 | ||
:target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_triple_discount | ||
:alt: OCA/l10n-italy | ||
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png | ||
:target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_fatturapa_out_triple_discount | ||
:alt: Translate me on Weblate | ||
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png | ||
:target: https://runboat.odoo-community.org/builds?repo=OCA/l10n-italy&target_branch=14.0 | ||
:alt: Try me on Runboat | ||
|
||
|badge1| |badge2| |badge3| |badge4| |badge5| | ||
|
||
**Italiano** | ||
|
||
Questo modulo consente di generare correttamente la fattura elettronica (XML) quando il modulo account_invoice_triple_discount è installato. | ||
|
||
**English** | ||
|
||
The module allows to use correctly generate the Electronic Invoice (XML) when the module account_invoice_triple_discount is installed. | ||
|
||
**Table of contents** | ||
|
||
.. contents:: | ||
:local: | ||
|
||
Bug Tracker | ||
=========== | ||
|
||
Bugs are tracked on `GitHub Issues <https://github.com/OCA/l10n-italy/issues>`_. | ||
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 | ||
`feedback <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_fatturapa_out_triple_discount%0Aversion:%2014.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. | ||
|
||
Do not contact contributors directly about support or help with technical issues. | ||
|
||
Credits | ||
======= | ||
|
||
Authors | ||
~~~~~~~ | ||
|
||
* Agile Business Group | ||
|
||
Contributors | ||
~~~~~~~~~~~~ | ||
|
||
* Simone Rubino | ||
* Alex Comba <[email protected]> | ||
|
||
Maintainers | ||
~~~~~~~~~~~ | ||
|
||
This module is maintained by the OCA. | ||
|
||
.. image:: https://odoo-community.org/logo.png | ||
:alt: Odoo Community Association | ||
:target: https://odoo-community.org | ||
|
||
OCA, or the Odoo Community Association, is a nonprofit organization whose | ||
mission is to support the collaborative development of Odoo features and | ||
promote its widespread use. | ||
|
||
This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_fatturapa_out_triple_discount>`_ project on GitHub. | ||
|
||
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. È possibile ripristinare i test automatici del modulo? |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2019 Simone Rubino - Agile Business Group | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). | ||
|
||
{ | ||
"name": "ITA - Fattura elettronica - Integrazione sconto triplo", | ||
"summary": "Modulo ponte tra emissione fatture elettroniche e sconto triplo", | ||
"version": "14.0.1.0.0", | ||
"development_status": "Beta", | ||
"category": "Hidden", | ||
"website": "https://github.com/OCA/l10n-italy" | ||
"/tree/12.0/l10n_it_fatturapa_out_triple_discount", | ||
"author": "Agile Business Group, Odoo Community Association (OCA)", | ||
"license": "AGPL-3", | ||
"auto_install": True, | ||
"depends": [ | ||
"l10n_it_fatturapa_out", | ||
"account_invoice_triple_discount", | ||
], | ||
"data": [ | ||
"data/invoice_it_template.xml", | ||
], | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<odoo> | ||
<template | ||
id="account_invoice_line_it_triple_discount" | ||
inherit_id="l10n_it_fatturapa_out.account_invoice_line_it_sconto_maggiorazione" | ||
> | ||
<xpath expr="//ScontoMaggiorazione" position="after"> | ||
<t | ||
t-set="importo2" | ||
t-value="get_importo(line, discount_field='discount2')" | ||
/> | ||
<t | ||
t-set="importo3" | ||
t-value="get_importo(line, discount_field='discount3')" | ||
/> | ||
<ScontoMaggiorazione t-if="line.discount2 != 0 or importo2 != 0"> | ||
<!-- [2.2.1.10] --> | ||
<t t-if="importo"> | ||
<Tipo t-if="importo2 > 0">SC</Tipo> | ||
<Tipo t-if="importo2 <= 0">MG</Tipo> | ||
<Importo t-esc="format_numbers(abs(importo2))" /> | ||
</t> | ||
<t t-else=""> | ||
<Tipo t-if="line.discount2 > 0">SC</Tipo> | ||
<Tipo t-if="line.discount2 <= 0">MG</Tipo> | ||
<Percentuale t-esc="format_numbers_two(abs(line.discount2))" /> | ||
Comment on lines
+20
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Il modulo nella Anche perché lo sconto triplo potrebbe portare un importo scontato diverso a seconda di come vengono applicati gli sconti, ad esempio additivo o moltiplicativo o chissà cos'altro ci si può inventare con gli override di https://github.com/OCA/account-invoicing/blob/bab944e76aa71c3f300695fc90a4656a9055da4e/account_invoice_triple_discount/models/account_move_line.py#L97 |
||
</t> | ||
</ScontoMaggiorazione> | ||
<ScontoMaggiorazione t-if="line.discount3 != 0 or importo3 != 0"> | ||
<!-- [2.2.1.10] --> | ||
<t t-if="importo"> | ||
<Tipo t-if="importo3 > 0">SC</Tipo> | ||
<Tipo t-if="importo3 <= 0">MG</Tipo> | ||
<Importo t-esc="format_numbers(abs(importo3))" /> | ||
</t> | ||
<t t-else=""> | ||
<Tipo t-if="line.discount3 > 0">SC</Tipo> | ||
<Tipo t-if="line.discount3 <= 0">MG</Tipo> | ||
<Percentuale t-esc="format_numbers_two(abs(line.discount3))" /> | ||
</t> | ||
</ScontoMaggiorazione> | ||
Comment on lines
+15
to
+40
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. È possibile evitare di ripetere lo stesso markup più volte? |
||
</xpath> | ||
</template> | ||
</odoo> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * l10n_it_fatturapa_out_triple_discount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"PO-Revision-Date: 2023-04-26 16:05+0000\n" | ||
"Last-Translator: mymage <[email protected]>\n" | ||
"Language-Team: none\n" | ||
"Language: it\n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: nplurals=2; plural=n != 1;\n" | ||
"X-Generator: Weblate 4.14.1\n" | ||
|
||
#. module: l10n_it_fatturapa_out_triple_discount | ||
#: model:ir.model,name:l10n_it_fatturapa_out_triple_discount.model_wizard_export_fatturapa | ||
msgid "Export E-invoice" | ||
msgstr "Esporta e-fattura" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Translation of Odoo Server. | ||
# This file contains the translation of the following modules: | ||
# * l10n_it_fatturapa_out_triple_discount | ||
# | ||
msgid "" | ||
msgstr "" | ||
"Project-Id-Version: Odoo Server 12.0\n" | ||
"Report-Msgid-Bugs-To: \n" | ||
"Last-Translator: <>\n" | ||
"Language-Team: \n" | ||
"MIME-Version: 1.0\n" | ||
"Content-Type: text/plain; charset=UTF-8\n" | ||
"Content-Transfer-Encoding: \n" | ||
"Plural-Forms: \n" | ||
|
||
#. module: l10n_it_fatturapa_out_triple_discount | ||
#: model:ir.model,name:l10n_it_fatturapa_out_triple_discount.model_wizard_export_fatturapa | ||
msgid "Export E-invoice" | ||
msgstr "" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* Simone Rubino | ||
* Alex Comba <[email protected]> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
**Italiano** | ||
|
||
Questo modulo consente di generare correttamente la fattura elettronica (XML) quando il modulo account_invoice_triple_discount è installato. | ||
|
||
**English** | ||
|
||
The module allows to use correctly generate the Electronic Invoice (XML) when the module account_invoice_triple_discount is installed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In questo commit ci sono anche modifiche a un altro modulo, è possibile avere commit che modificano un solo modulo? Vedi https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst#commit-message, in particolare: