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

[MIG] l10n_it_reverse_charge #3514

Closed
wants to merge 59 commits into from

Conversation

SirTakobi
Copy link
Contributor

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/
sysadminmatmoz and others added 7 commits August 2, 2023 18:29
Currently translated at 79.6% (47 of 59 strings)

Translation: l10n-italy-14.0/l10n-italy-14.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_reverse_charge/sl/
Currently translated at 100.0% (59 of 59 strings)

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

Translation: l10n-italy-14.0/l10n-italy-14.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_reverse_charge/it/
…ng "with_supplier_self_invoice" for e-invoices
Currently translated at 100.0% (62 of 62 strings)

Translation: l10n-italy-14.0/l10n-italy-14.0-l10n_it_reverse_charge
Translate-URL: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_reverse_charge/it/
Copy link
Contributor Author

@SirTakobi SirTakobi left a comment

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@tafaRU non ho preso are-agilebg#1 perché non ho trovato come riprodurre l'errore che dovrebbe risolvere, potresti aggiungere un test o scrivere quali sono i passi per riprodurlo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@aleuffre non ho preso are-agilebg#2 perché ho usato una soluzione meno implicita.

Il fatto che il pagamento non venga riconciliato con la fattura fornitore potrebbe essere un problema anche a livello funzionale (infatti l'ho aggiunto nella Roadmap) quindi ho fatto in modo che fosse evidente che cosa non sta funzionando.

Se i funzionali ci confermano che è un problema anche a livello di Odoo allora ci sarà da aprire una issue anche lì, e rimuovere la soluzione quando il problema sarà risolto in Odoo.

In breve: un movimento contabile (account.move.line) risulta riconciliato (ha reconciled = True) quando ha importo 0, anche senza avere riconciliazioni parziali/totali collegate.
In questa PR, questo impedisce di riconciliare il pagamento del test test_intra_EU_exempt con la fattura fornitore.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Borruso non riesco a riprodurre l'errore che hai segnalato in #3300 (comment), ho messo descrizioni molto lunghe un po' ovunque ma la vista si comporta bene:
image

potresti chiarire come ottieni l'errore?

@SirTakobi SirTakobi marked this pull request as ready for review August 3, 2023 10:23
@SirTakobi SirTakobi force-pushed the 16.0-mig-l10n_it_reverse_charge branch from 3680e83 to dbcffbc Compare August 3, 2023 10:29
@SirTakobi SirTakobi force-pushed the 16.0-mig-l10n_it_reverse_charge branch from dbcffbc to 0cfb298 Compare August 3, 2023 13:30
@@ -127,8 +133,10 @@ def _rc_get_move_line_to_reconcile(self):
else:
raise UserError(_("Only inbound and outbound moves are supported"))

lines = self.line_ids
already_reconciled_lines = lines.filtered("reconciled")
Copy link
Member

Choose a reason for hiding this comment

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

Come mai serve questo?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Grazie della review!
In effetti non sembra servire per la migrazione quindi l'ho rimosso, puoi controllare se ora va meglio?

@SirTakobi SirTakobi marked this pull request as draft August 24, 2023 14:44
No need to add fields in tree of `line_ids` to have them in `invoice_line_ids` since odoo/odoo@d8d47f9
invoice_payments_widget is a dictionary from odoo/odoo@d8d47f9
account.payment.term.line.sequence removed from odoo/odoo@3dad4b3
account.account.user_type_id removed from odoo/odoo@26b2472
Always assign computed field account.move.line.rc
account.move.line.exclude_from_invoice_tab does not exist
Validate created journals
Allow to reset to draft and reconfirm invoices with rc_self_purchase_invoice_id
Do not reconcile already reconciled journal entries
@SirTakobi SirTakobi force-pushed the 16.0-mig-l10n_it_reverse_charge branch from 0cfb298 to 7860711 Compare August 24, 2023 14:45
@SirTakobi SirTakobi marked this pull request as ready for review August 24, 2023 14:52
@SirTakobi SirTakobi requested a review from eLBati August 24, 2023 14:53
@eLBati
Copy link
Member

eLBati commented Sep 7, 2023

/ocabot migration l10n_it_reverse_charge

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Sep 7, 2023
@OCA-git-bot OCA-git-bot mentioned this pull request Sep 7, 2023
79 tasks
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.

@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

@eLBati
Copy link
Member

eLBati commented Sep 8, 2023

chiudo in favore di #3566

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.