-
-
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][IMP] l10n_it_fatturapa_in: intermediary contact creation depending by vat #4621
base: 14.0
Are you sure you want to change the base?
Conversation
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.
Errata approvazione
ed30f19
to
c28b517
Compare
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.
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 |
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.
Credo che questa modifica la volessi mettere nell'altro commit
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.
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) |
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.
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
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.
Sistemato. Ti ringrazio
37f7831
to
f6b31d2
Compare
</group> | ||
<footer> | ||
<button | ||
string="Sì" |
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.
string="Sì" | |
string="Confirm" |
class="btn-primary" | ||
/> | ||
<button | ||
string="No" |
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.
string="No" | |
string="Cancel" |
if vat_check: | ||
invoice.write({"intermediary": Intermediary_id}) | ||
else: | ||
name = ( |
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.
Quando arriva qui il partner è stato già creato, o sbaglio?
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.
Se intendi il cliente della fattura si esiste già in quanto dalla fattura elettronica il cliente si associa mediante la partita IVA.
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.
@Chionne27 stiamo parlando dell'intermediario, che è comunque un partner (aka contatto)
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.
@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.
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.
Evitare di crearlo? Penso sarebbe meglio, non trovi?
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.
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.
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.
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?
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.
Qualsiasi volta il sistema cerca di creare un partner chiedere conferma all'utente
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.
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
intermediary_id = fields.Integer(string="Intermediario", readonly=True) | ||
invoice_id = fields.Many2one("account.move", string="Fattura", readonly=True) |
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.
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"> |
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.
Anche questa.
"default_message": f'Il contatto intermediario "{name}" ' | ||
"non esiste nel sistema. Confermi di volerlo creare?", |
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.
Come sopra.
f6b31d2
to
1e7be0b
Compare
1e7be0b
to
4c3b6da
Compare
No description provided.