-
-
Notifications
You must be signed in to change notification settings - Fork 306
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
[IMP] l10n_it_account_stamp usability #4414
base: 14.0
Are you sure you want to change the base?
[IMP] l10n_it_account_stamp usability #4414
Conversation
f29210b
to
68743e1
Compare
68743e1
to
bb017a1
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.
Grazie della PR!
Ho guardato il codice e credo che l'aggiunta di check_move_validity=False
causi questo errore
Screencast.from.2024-11-21.09-55-14.webm
puoi verificare?
@@ -135,6 +135,7 @@ Contributors | |||
* Marco Colombo <https://github.com/TheMule71> | |||
* Gianmarco Conte <[email protected]> | |||
* Giovanni Serra <[email protected]> | |||
* `Aion Tech <https://aiontech.company/>`__: Simone Rubino <[email protected]> |
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.
Non va modificato il README direttamente ma il file readme/CONTRIBUTORS.rst
.
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.
Fatto
bb017a1
to
e2ea9e0
Compare
If stamp line can be added (invoice in draft): show button to add stamp line. If stamp line can't be added (invoice not in draft): show message explaining why it can't be added. If stamp line has already been added: show message saying it has already been added (useful if invoice has many lines). Button and messages update live while updating the invoice. Better messages to user for charging stamp to customer Co-authored-by: Simone Rubino <[email protected]>
e2ea9e0
to
d1b8ba1
Compare
Senza quell'aggiunta la stessa eccezione compare prima, cliccando su "Reset to Draft". La modifica ne posticipa solo la comparsa alla riconferma della fattura. In ogni caso noto una problematica di fondo decisamente più rilevante introdotta da queste modifiche (già presenti nella 16.0). Premessa. Premesso ciò, proseguo nella revisione del codice. |
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.
Rif. #4414 (comment)
@@ -76,6 +85,7 @@ def add_tax_stamp_line(self): | |||
invoice_line_vals = { | |||
"move_id": inv.id, | |||
"product_id": stamp_product_id.id, | |||
"is_stamp_line": 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.
Introdurre il campo qui stravolge il senso originale del campo stesso, cioè quello di identificare univocamente le sole righe contabili income ed expense, per poterle eliminare dopo la reimpostazione della fattura a bozza.
L'effetto collaterale della modifica è che, quando la fattura viene reimpostata bozza, viene eliminata anche la riga fattura di imputazione del bollo al cliente, che non è il comportamento atteso.
) | ||
def _compute_tax_stamp_line_present(self): | ||
for invoice in self: | ||
invoice.tax_stamp_line_present = invoice.is_tax_stamp_line_present() |
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.
is_tax_stamp_line_present()
non identifica univocamente la riga fattura di imputazione del bollo al cliente perché va a prendere il valore da is_stamp_line
.
Nel caso di bollo applicato ma non imputato al cliente tax_stamp_line_present
è sempre True
e fa comparire "Stamp charged to customer" alla conferma della fattura.
Questo è il comportamento attuale della 16.0 dopo il merge della relativa PR e andrà corretto.
invoice.tax_stamp_line_present = invoice.is_tax_stamp_line_present() | |
invoice.tax_stamp_line_present = invoice.is_tax_stamp_product_present() |
move_line_tax_stamp_ids.unlink() | ||
move_line_tax_stamp_ids.with_context(check_move_validity=False).unlink() |
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.
Manterrei la riga di codice attuale senza modifiche.
compute="_compute_tax_stamp", | ||
store=True, | ||
) | ||
tax_stamp_line_present = fields.Boolean( |
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.
#4414 (comment) e #4414 (comment)
tax_stamp_line_present = fields.Boolean( | |
tax_stamp_invoice_line_present = fields.Boolean( |
) | ||
tax_stamp_line_present = fields.Boolean( | ||
string="Stamp line is present in invoice", | ||
compute="_compute_tax_stamp_line_present", |
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.
Vedi sopra
compute="_compute_tax_stamp_line_present", | |
compute="_compute_tax_stamp_invoice_line_present", |
"invoice_line_ids.product_id", | ||
"invoice_line_ids.product_id.is_stamp", | ||
) | ||
def _compute_tax_stamp_line_present(self): |
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.
Vedi sopra.
def _compute_tax_stamp_line_present(self): | |
def _compute_tax_stamp_invoice_line_present(self): |
def _compute_tax_stamp_line_present(self): | ||
for invoice in self: | ||
invoice.tax_stamp_line_present = invoice.is_tax_stamp_line_present() |
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.
Vedi sopra.
invoice.tax_stamp_line_present
→ invoice.tax_stamp_invoice_line_present
@@ -23,20 +27,38 @@ | |||
name="manually_apply_tax_stamp" | |||
attrs="{'invisible': [('auto_compute_stamp', '=', True)]}" | |||
/> | |||
<field name="tax_stamp_line_present" invisible="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.
Vedi sopra.
<field name="tax_stamp_line_present" invisible="1" /> | |
<field name="tax_stamp_invoice_line_present" invisible="1" /> |
alt="Tax stamp" | ||
/> | ||
<span | ||
attrs="{'invisible': [('tax_stamp_line_present', '=', 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.
Vedi sopra.
attrs="{'invisible': [('tax_stamp_line_present', '=', True)]}" | |
attrs="{'invisible': [('tax_stamp_invoice_line_present', '=', True)]}" |
</span> | ||
</span> | ||
<span | ||
attrs="{'invisible': [('tax_stamp_line_present', '=', False)]}" |
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.
Vedi sopra.
attrs="{'invisible': [('tax_stamp_line_present', '=', False)]}" | |
attrs="{'invisible': [('tax_stamp_invoice_line_present', '=', False)]}" |
def test_tax_stamp_line_button(self): | ||
"""Stamp fields show when stamp is added with the button to the invoice.""" | ||
# Arrange: Create an invoice eligible for tax stamp but without it | ||
stamp_tax = self.tax_id | ||
invoice = self.init_invoice( | ||
"out_invoice", | ||
taxes=stamp_tax, | ||
amounts=[ | ||
100, | ||
], | ||
) | ||
# pre-condition | ||
self.assertTrue(invoice.tax_stamp) | ||
self.assertFalse(invoice.tax_stamp_line_present) | ||
|
||
# Act | ||
invoice.add_tax_stamp_line() | ||
|
||
# Assert | ||
self.assertTrue(invoice.tax_stamp_line_present) | ||
|
||
# Resetting to draft removes the stamp | ||
invoice.button_draft() | ||
self.assertFalse(invoice.tax_stamp_line_present) |
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.
No description provided.