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

[16.0] [MIG] l10n_it_reverse_charge #3566

Merged
merged 61 commits into from
Sep 9, 2023

Conversation

SirAionTech
Copy link
Contributor

Sostituisce #3514.

dcorio and others added 30 commits August 2, 2023 18:17
[IMP] pep8

[FIX] typos and pep8

[IMP] l10n_it_reverse_charge refactoring

[ADD] account_move_skip

[IMP] skip expr

[IMP] i18n

[IMP] tax mapping

[IMP] mandatory fields

[IMP] autohide if == 0

[REM] pdb

[IMP] no need to specify expr

[FIX] write if no credit/debit
[ADD] l10n_it_reverse_charge: add initial draft of README

[ADD] l10n_it_reverse_charge: add note about 'Integrazione IVA'

[ADD] l10n_it_reverse_charge: add check if there is default credit account defined on Self Invoice Payment Journal

[ADD] l10n_it_reverse_charge: set rc on invoice.line according to RC Type defined on fiscal position

[FIX] l10n_it_reverse_charge: rename tax_src_id and tax_dest_id fields to be more consinstent and easier to understand their purpose

[IMP] l10n_it_reverse_charge: adapt to latest OCA guidelines

[FIX] l10n_it_reverse_charge: fix 'WARNING test_reverse_charge openerp.modules.loading: The model account.rc.type has no access rules'

[ADD] l10n_it_reverse_charge
Handle invoice supplier cancellation and reopening for method 'selfinvoice':
* cancellation: both supplier invoice and selfinvoice are cancelled
* reopening: data on existing selfinvoice are copied to supplier invoice

[FIX] l10n_it_reverse_charge: fix WARNING account.invoice.line.create() with unknown fields: uom_id

[IMP] l10n_it_reverse_charge: improve README

[IMP] l10n_it_reverse_charge: add more comments for making code easier to understand

[IMP] l10n_it_reverse_charge: add help to tax_ids field

[FIX] l10n_it_reverse_charge:
* do not copy rc_self_invoice_id
* check if inv has rc_self_invoice_id before to proceed with its cancellation

[FIX] l10n_it_reverse_charge: avoid product from self invoice lines to better handle related stats

[ADD] 8.0-l10n_it_reverse_charge: copy self_invoice_text to self invoice name
[W7910(wrong-tabs-instead-of-spaces), ]  Use wrong tabs indentation instead of four spaces

FIX screenshots

FIX allow to use and compute RC field in invoice line form pop up

l10n_it_reverse_charge ADD "With additional supplier self invoice"
to enable the creation of an additional supplier self
invoice. This is tipically used for extraUE suppliers,
in order to show, in supplier register, an invoice to the
specified partner (tipically, my company), instead of the
extraUE partner

Also FIX
ValueError: "local variable 'tax_code_id' referenced before assignment" while evaluating
u'invoice_validate()'
when tax mapping not found
FIX invoice_line_tax_ids field
…nvoice_draft due to odoo/odoo@bc8d5db (OCA#433)

In this way both invoices are again set as draft.
Currently translated at 100.0% (55 of 55 strings)

Translation: l10n-italy-10.0/l10n-italy-10.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-10-0/l10n-italy-10-0-l10n_it_reverse_charge/it/
…ated from PO

[FIX] l10n_it_reverse_charge: Assign RC flag only to supplier invoices

[FIX] l10n_it_reverse_charge: Assign RC flag when vendor bill is created from PO
Fixes the following usecase:

0. Install Purchase
1. Set Reverse Charge type for a new fiscal position _fp_rc_
2. Assign _fp_rc_ to a new partner _partner_rc_
3. Create a new PO with one line for _partner_rc_, confirm, receive the products
4. From the button in the created PO, create a new vendor bill

Before this commit:
RC flag is not set in the line of the created invoice

After this commit:
RC flag is set in the line of the created invoice

[FIX] l10n_it_reverse_charge: Assign RC flag when vendor bill is populated with partner_id and then purchase_id
Otherwise in case payment term such as 15/30 days the autoinvoice won't be payed at all.
… between amount_tax and amount shown on payments_widget
Also fix extra UE case

FIX l10n_it_reverse_charge: setting discount in supplier invoice would produce a wrong self invoice

REF reconcile_rc_invoice to increase performance.
Writing company_id would produce recomputation of every account.move.line linked to accounts involved in journal entry to be created.
In case of thousands or milions of move lines, this would last hours
Currently translated at 100.0% (57 of 57 strings)

Translation: l10n-italy-12.0/l10n-italy-12.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_reverse_charge/it/
Currently translated at 100.0% (58 of 58 strings)

Translation: l10n-italy-12.0/l10n-italy-12.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-12-0/l10n-italy-12-0-l10n_it_reverse_charge/it/
 - missing RC flag on new lines where taxes are not changed
 - check is_invoice_line for not yet created lines
@SirAionTech
Copy link
Contributor Author

(da #3514 (review))

@SirAionTech ho creato questo commit eLBati@5123e39 con le modifiche che abbiamo visto (non ti ho fatto PR perchè questa è di @SirTakobi , ne vuoi creare un'altra?)

Ho inoltre rilevato questo problema:

RC

Direi che manca il conto in qualcuno dei registri, puoi guardare come sono state modificate le definizioni dei registri nei test.
Ad esempio: nel registro delle autofatture serve impostare il conto.
Non ho modificato le istruzioni nel README perché già sono sbagliate quelle attuali e sono da rifare per #2670

@eLBati
Copy link
Member

eLBati commented Sep 8, 2023

/ocabot migration l10n_it_reverse_charge

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Sep 8, 2023
@OCA-git-bot
Copy link
Contributor

The migration issue (#2967) has not been updated to reference the current pull request because a previous pull request (#3514) is not closed.
Perhaps you should check that there is no duplicate work.
CC @SirTakobi

@eLBati
Copy link
Member

eLBati commented Sep 8, 2023

/ocabot migration l10n_it_reverse_charge

@OCA-git-bot OCA-git-bot mentioned this pull request Sep 8, 2023
79 tasks
@eLBati
Copy link
Member

eLBati commented Sep 8, 2023

@SirAionTech nei test mi pare di vedere che viene usato 295000 sia per il registro di autofatturazione che di autofatturazione passiva, ma da interfaccia mi pare che questo non sia possibile, per via del domain sul conto del registro.

Inoltre nelle versioni precedenti di Odoo questi conti non mi pare fossero obbligatori, anche perchè il conto "Self Invoice Transitory Account" (il 295000 dei test) viene già impostato sul "account.rc.type"

@SirAionTech
Copy link
Contributor Author

@SirAionTech nei test mi pare di vedere che viene usato 295000 sia per il registro di autofatturazione che di autofatturazione passiva, ma da interfaccia mi pare che questo non sia possibile, per via del domain sul conto del registro.

Ho appena provato in runboat mettendo il conto 295000 in un registro:
image
e poi ho usato quel registro e il conto 295000 nel tipo RC:
image
ma forse intendevi qualcos'altro? Mi faresti vedere?

Inoltre nelle versioni precedenti di Odoo questi conti non mi pare fossero obbligatori, anche perchè il conto "Self Invoice Transitory Account" (il 295000 dei test) viene già impostato sul "account.rc.type"

Nella 16.0 il campo default_account_id è obbligatorio in base al tipo di registro da odoo/odoo@7628888

@SirAionTech SirAionTech marked this pull request as ready for review September 8, 2023 08:37
@primes2h primes2h changed the title [MIG] l10n_it_reverse_charge [16.0] [MIG] l10n_it_reverse_charge Sep 8, 2023
@MarcoCalcagni
Copy link
Contributor

Ho fatto vari test funzionali con il modulo cosi come è adesso. test OK
l'unica cosa da correggere è che se vado in modifica del registro selfinvoice il default account che è obbligatorio non è selezionabile e quindi se l'utente lo cancella non lo può più inserire.
per risolvere questo ho impostato il conto 295000 con la tipologia ricavi piuttosto che passività correnti.
con questo la funzionalità è invariata. e il setup del registro è ok.

il fatto di cambiare il conto da tipo patrimoniale a tipo economico secondo me non ha nessuna influenza perchè il conto 295000 chiude sempre a 0 .

@SirAionTech @eLBati @sergiocorato @TheMule71

Copy link
Contributor

@MarcoCalcagni MarcoCalcagni left a comment

Choose a reason for hiding this comment

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

LGTM

@eLBati
Copy link
Member

eLBati commented Sep 9, 2023

ma forse intendevi qualcos'altro? Mi faresti vedere?

In effetti intendevo un'altra cosa, ma ho provato a impostare il conto solo sul registro di autofatturazione passiva (concordo che il transitorio può essere di qualcunque tipo, essendo transitorio) e sono riuscito a validare e generare le registrazioni corrette.

Copy link
Member

@eLBati eLBati left a comment

Choose a reason for hiding this comment

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

Grazie

@eLBati
Copy link
Member

eLBati commented Sep 9, 2023

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-3566-by-eLBati-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit c7724e3 into OCA:16.0 Sep 9, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f9e1a5e. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.