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] l10n_it_fatturapa_in: intermediary contact creation depending by vat #4621

Open
wants to merge 2 commits into
base: 14.0
Choose a base branch
from

Conversation

Chionne27
Copy link

No description provided.

Copy link
Contributor

@francesco-ooops francesco-ooops left a comment

Choose a reason for hiding this comment

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

Errata approvazione

@francesco-ooops francesco-ooops self-requested a review February 17, 2025 15:34
@francesco-ooops francesco-ooops linked an issue Feb 17, 2025 that may be closed by this pull request
2 tasks
@Chionne27 Chionne27 force-pushed the 14.0-IMP-l10n_it_fatturapa_in branch 4 times, most recently from ed30f19 to c28b517 Compare February 19, 2025 08:15
Copy link
Contributor

@francesco-ooops francesco-ooops left a comment

Choose a reason for hiding this comment

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

Functional ok

@@ -6,7 +6,7 @@ access_einvoice_line_other_data,access_einvoice_line_other_data,model_einvoice_l
access_wizard_import_fatturapa,access_wizard_import_fatturapa,model_wizard_import_fatturapa,account.group_account_invoice,1,1,1,1
access_wizard_link_to_invoice,access_wizard_link_to_invoice,model_wizard_link_to_invoice,account.group_account_invoice,1,1,1,1
access_wizard_link_to_invoice_line,access_wizard_link_to_invoice_line,model_wizard_link_to_invoice_line,account.group_account_invoice,1,1,1,1
access_wizard_check_intermediary_all,access_wizard_check_intermediary_all,model_wizard_check_intermediary,,1,1,1,1
access_wizard_check_intermediary_all,access_wizard_check_intermediary_all,model_wizard_check_intermediary,account.group_account_invoice,1,1,1,1
Copy link
Contributor

Choose a reason for hiding this comment

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

Credo che questa modifica la volessi mettere nell'altro commit

Copy link
Author

Choose a reason for hiding this comment

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

Ho modificato i commit. Ti ringrazio per avermelo fatto natare

_name = "wizard.check.intermediary"
_description = "Controllo sull'intermediario"

message = fields.Text(string="message", readonly=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Di norma le stringe vanno con tutte le iniziali maiuscole ed in inglese, verranno poi tradotte, vedi https://github.com/OCA/currency/blob/5621d4578f79a1be38bacd597470255943f4298c/account_cryptocurrency/models/res_currency_move.py#L62

Copy link
Author

Choose a reason for hiding this comment

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

Sistemato. Ti ringrazio

@Chionne27 Chionne27 force-pushed the 14.0-IMP-l10n_it_fatturapa_in branch 3 times, most recently from 37f7831 to f6b31d2 Compare February 20, 2025 08:31
</group>
<footer>
<button
string="Sì"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string=""
string="Confirm"

class="btn-primary"
/>
<button
string="No"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
string="No"
string="Cancel"

if vat_check:
invoice.write({"intermediary": Intermediary_id})
else:
name = (
Copy link
Contributor

Choose a reason for hiding this comment

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

Quando arriva qui il partner è stato già creato, o sbaglio?

Copy link
Author

@Chionne27 Chionne27 Feb 24, 2025

Choose a reason for hiding this comment

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

Se intendi il cliente della fattura si esiste già in quanto dalla fattura elettronica il cliente si associa mediante la partita IVA.

Copy link
Contributor

@francesco-ooops francesco-ooops Feb 24, 2025

Choose a reason for hiding this comment

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

@Chionne27 stiamo parlando dell'intermediario, che è comunque un partner (aka contatto)

Copy link
Author

@Chionne27 Chionne27 Feb 25, 2025

Choose a reason for hiding this comment

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

@GSLabIt Hai ragione. l'implementazione creava il partner prima dell'apertura del wizard. Pertanto ho effettuato una leggera modifica per cui se l'utente non lo vuole creare, il partner creato prima viene eliminato. Mi sembra un metodo abbastanza furbo poi se si può migliorare sono a disposizione per un confronto.

Copy link
Contributor

Choose a reason for hiding this comment

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

Evitare di crearlo? Penso sarebbe meglio, non trovi?

Copy link
Author

Choose a reason for hiding this comment

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

return {
"type": "ir.actions.act_window",
"name": "Confirm action",
"res_model": "wizard.check.intermediary",
"view_mode": "form",
"target": "new",
"context": {
"default_message": f'The contact intermediary "{name}" '
"does not exists in the system. Do you want to create it?",
"intermediary_id": Intermediary.DatiAnagrafici,
"invoice_id": invoice.id,
},
}

È vero. Infatti volevo chiamare la funzione getPartnerBase nella funzione di conferma del wizard. Il punto è che con il context non viene passato correttamente Intermediary.DatiAnagrafici come ho fatto nell'esempio sopra perché invece di un oggetto passa una stringa e i metodo getPartnerBase fallisce. Quindi per il momento ho fatto questa implementazione. Se hai un idea per fare come detto poi la implemento.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sta cosa è un pò tricky, perché può capitare che il partner sia stato già creato precedentemente e non è corretto eliminarlo.

Qual'è il problema esatto che si vuole risolvere?

Copy link
Contributor

Choose a reason for hiding this comment

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

Qualsiasi volta il sistema cerca di creare un partner chiedere conferma all'utente

Copy link
Contributor

Choose a reason for hiding this comment

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

Per come è fatto ora non mi pare fattibile, bisognerebbe andare a chiedere all'utente prima della creazione del partner e se è presente l'intermediario. A questo punto probabilmente è meglio aggiungere un flag nella wizard principale; alternativa è rivedere il flusso attuale

Comment on lines 9 to 10
intermediary_id = fields.Integer(string="Intermediario", readonly=True)
invoice_id = fields.Many2one("account.move", string="Fattura", readonly=True)
Copy link
Contributor

Choose a reason for hiding this comment

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

Queste andrebbero in inglese.

<field name="name">check.intermediary.vat.form</field>
<field name="model">wizard.check.intermediary</field>
<field name="arch" type="xml">
<form string="Verifica intermediario">
Copy link
Contributor

Choose a reason for hiding this comment

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

Anche questa.

Comment on lines 1948 to 1949
"default_message": f'Il contatto intermediario "{name}" '
"non esiste nel sistema. Confermi di volerlo creare?",
Copy link
Contributor

Choose a reason for hiding this comment

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

Come sopra.

@Chionne27 Chionne27 force-pushed the 14.0-IMP-l10n_it_fatturapa_in branch from f6b31d2 to 1e7be0b Compare February 24, 2025 15:31
@Chionne27 Chionne27 force-pushed the 14.0-IMP-l10n_it_fatturapa_in branch from 1e7be0b to 4c3b6da Compare February 25, 2025 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

l10n_it_fatturapa_in - scelta creazione contatto intermediario
5 participants