Skip to content
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][IMP] add ability to set intrastat only for in_ or out_ invoices in l10n_it_intrastat #4256

Open
wants to merge 1 commit into
base: 14.0
Choose a base branch
from

Conversation

sergiocorato
Copy link
Contributor

No description provided.

Copy link

@MaurizioPellegrinet MaurizioPellegrinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test funzionale: OK

@sergiocorato sergiocorato force-pushed the 14.0-imp-l10n_it_intrastat-add-option-by-move-type branch 3 times, most recently from 027bfe1 to fe86928 Compare July 10, 2024 06:58
@sergiocorato
Copy link
Contributor Author

Test funzionale: OK

Grazie, ho fatto delle ulteriori modifiche per un discorso funzionale: ho rimosso il campo Intrastat generico e lasciato solo i due nuovi campi, così che sia chiaro all'utente di cosa sta impostando.
Ho aggiunto uno script di migrazione che va a settare a True i due nuovi campi quando il campo Intrastat è impostato.

Copy link

@MaurizioPellegrinet MaurizioPellegrinet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Conferma alle modifiche: OK

@sergiocorato sergiocorato force-pushed the 14.0-imp-l10n_it_intrastat-add-option-by-move-type branch from fe86928 to 53b8fd7 Compare July 10, 2024 12:22
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 10, 2024
Copy link
Contributor

@SirAionTech SirAionTech left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Grazie della PR!
Ho fatto revisione del codice e provato la migrazione, che però è da modificare perché la versione 14.0.1.4.3 è stata assegnata nel frattempo; quindi
/ocabot rebase

Comment on lines 304 to 306
self.move_type.startswith("out_")
and self.fiscal_position_id.intrastat_sale
or self.move_type.startswith("in_")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Penso sia meglio usare is_purchase_document e is_sale_document, che ne dici?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Giusto

.browse(val["fiscal_position_id"])
.intrastat
if "fiscal_position_id" in val:
fiscal_position_id = self.env["account.fiscal.position"].browse(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potrebbe essere utile

Suggested change
fiscal_position_id = self.env["account.fiscal.position"].browse(
fiscal_position = self.env["account.fiscal.position"].browse(

Per distinguere che le variabili con _id sono degli interi, cosa ne pensi?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Vero

Comment on lines 326 to 328
if val.get("move_type").startswith("out_"):
intrastat = fiscal_position_id.intrastat_sale
elif val.get("move_type").startswith("in_"):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analogamente a quanto suggerito sopra, si potrebbero usare get_sale_types e get_purchase_types, che ne dici?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Meglio

Comment on lines -14 to +15
<field name="intrastat" />
<field name="intrastat_purchase" />
<field name="intrastat_sale" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Il campo rimosso era citato nella documentazione, potresti aggiornarla?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fatto

@@ -65,11 +65,12 @@ def test_invoice_totals(self):
)
self.assertEqual(total_intrastat_amount, invoice.amount_untaxed)

def test_invoice_fiscal_postion(self):
def test_invoice_fiscal_position(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Questo ora è diventato il test per verificare che funzioni intrastat_sale, penso che andrebbe modificata la firma; faresti il test analogo per verificare intrastat_purchase?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fatto

("account_fiscal_position", "intrastat_sale"),
("account_fiscal_position", "intrastat_purchase"),
]:
if not openupgrade.column_exists(env.cr, table, column):
Copy link
Contributor

@SirAionTech SirAionTech Nov 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

column_exists esiste solo per retrocompatibilità, si potrebbe usare invece il metodo omonimo di openupgrade_tools?
Vedi https://github.com/OCA/openupgradelib/blob/8d04b103b70d6927f805b94ef26ecf53b26e51ed/openupgradelib/openupgrade.py#L411

P.S.: esiste anche odoo.tools.sql.column_exists

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok grazie

@OCA-git-bot
Copy link
Contributor

@SirAionTech The rebase process failed, because command git push --force efatto tmp-pr-4256:14.0-imp-l10n_it_intrastat-add-option-by-move-type failed with output:

remote: Permission to efatto/l10n-italy.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/efatto/l10n-italy/': The requested URL returned error: 403

1 similar comment
@OCA-git-bot
Copy link
Contributor

@SirAionTech The rebase process failed, because command git push --force efatto tmp-pr-4256:14.0-imp-l10n_it_intrastat-add-option-by-move-type failed with output:

remote: Permission to efatto/l10n-italy.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/efatto/l10n-italy/': The requested URL returned error: 403

@github-actions github-actions bot removed the stale PR/Issue without recent activity, it'll be soon closed automatically. label Nov 17, 2024
@sergiocorato sergiocorato force-pushed the 14.0-imp-l10n_it_intrastat-add-option-by-move-type branch 3 times, most recently from b7dd497 to 2a0a5fd Compare November 22, 2024 17:14
@sergiocorato sergiocorato force-pushed the 14.0-imp-l10n_it_intrastat-add-option-by-move-type branch 2 times, most recently from f5e4add to 1694d65 Compare November 22, 2024 17:19
@sergiocorato sergiocorato force-pushed the 14.0-imp-l10n_it_intrastat-add-option-by-move-type branch from 1694d65 to c5950a2 Compare November 25, 2024 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants