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][FIX] l10n_it_ricevute_bancarie: fix state update on riba lines #4568

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_in/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Contributors
* Giovanni Serra <[email protected]>
* Gianmarco Conte <[email protected]>
* Marco Colombo <https://github.com/TheMule71>

* Salvo Rapisarda <https://github.com/salvorapi>
* `Aion Tech <https://aiontech.company/>`_:

* Simone Rubino <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion l10n_it_fatturapa_in/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Giovanni Serra <[email protected]>
* Gianmarco Conte <[email protected]>
* Marco Colombo <https://github.com/TheMule71>

* Salvo Rapisarda <https://github.com/salvorapi>
* `Aion Tech <https://aiontech.company/>`_:

* Simone Rubino <[email protected]>
1 change: 1 addition & 0 deletions l10n_it_fatturapa_in/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,7 @@ <h2><a class="toc-backref" href="#toc-entry-8">Contributors</a></h2>
<li>Giovanni Serra &lt;<a class="reference external" href="mailto:giovanni&#64;gslab.it">giovanni&#64;gslab.it</a>&gt;</li>
<li>Gianmarco Conte &lt;<a class="reference external" href="mailto:gconte&#64;dinamicheaziendali.it">gconte&#64;dinamicheaziendali.it</a>&gt;</li>
<li>Marco Colombo &lt;<a class="reference external" href="https://github.com/TheMule71">https://github.com/TheMule71</a>&gt;</li>
<li>Salvo Rapisarda &lt;<a class="reference external" href="https://github.com/salvorapi">https://github.com/salvorapi</a>&gt;</li>
<li><a class="reference external" href="https://aiontech.company/">Aion Tech</a>:<ul>
<li>Simone Rubino &lt;<a class="reference external" href="mailto:simone.rubino&#64;aion-tech.it">simone.rubino&#64;aion-tech.it</a>&gt;</li>
</ul>
Expand Down
22 changes: 22 additions & 0 deletions l10n_it_ricevute_bancarie/tests/test_riba.py
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,28 @@ def test_unsolved_riba(self):
wiz_accreditation.create_move()
self.assertEqual(riba_list.state, "accredited")

# credit wizard with skip
credit_wizard = (
self.env["riba.accreditation"]
.with_context(
{
"active_model": "riba.distinta",
"active_ids": [riba_list_id],
"active_id": riba_list_id,
}
)
.create(
{
"bank_amount": 95,
"expense_amount": 5,
}
)
)
credit_wizard.skip()
self.assertEqual(riba_list.state, "accredited")

self.assertEqual(riba_list.line_ids[0].state, "accredited")

# past due wizard
wiz_unsolved = (
self.env["riba.unsolved"]
Expand Down
4 changes: 3 additions & 1 deletion l10n_it_ricevute_bancarie/wizard/wizard_accreditation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ def skip(self):
active_id = self.env.context.get("active_id") or False
if not active_id:
raise UserError(_("No active ID found."))
self.env["riba.distinta"].browse(active_id).state = "accredited"
riba_distinta = self.env["riba.distinta"].browse(active_id)
riba_distinta.state = "accredited"
riba_distinta.line_ids.state = "accredited"
Copy link
Contributor

Choose a reason for hiding this comment

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

non ci andrebbe un qualcosa tipo: riba_distinta.mapped("line_ids").update({"state": "accredited"})

Copy link
Contributor

Choose a reason for hiding this comment

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

L'assegnazione funziona anche su un recordset, senza dare SingletonError. Ad esempio da Odoo Shell:

env["res.partner"].search([], limit=3).name = "pippo"

return {"type": "ir.actions.act_window_close"}

def create_move(self):
Expand Down
Loading