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_fatturapa_in: Fixed singleton error on field computation #2355

Merged

Conversation

TheMule71
Copy link
Contributor

Taking over #2350

Fixes: #2349

diff from #2350 (due to pre-commit formatting)

index 998191db7..7f7dafc99 100644
--- a/l10n_it_fatturapa_in/models/account.py
+++ b/l10n_it_fatturapa_in/models/account.py
@@ -247,10 +247,12 @@ class AccountInvoice(models.Model):
             bill.e_invoice_validation_message = ",\n".join(error_messages) + "."
             other_account_moves -= bill
 
-        other_account_moves.write({
-            'e_invoice_validation_error': False,
-            'e_invoice_validation_message': False,
-        })
+        other_account_moves.write(
+            {
+                "e_invoice_validation_error": False,
+                "e_invoice_validation_message": False,
+            }
+        )
 
     def name_get(self):
         result = super(AccountInvoice, self).name_get()

--
Confermo di aver firmato il CLA https://odoo-community.org/page/cla e di aver letto le linee guida su https://odoo-community.org/page/contributing

@@ -174,9 +174,7 @@ def e_inv_dati_ritenuta(self):
"invoice_date",
)
def _compute_e_invoice_validation_error(self):
self.ensure_one()
self.e_invoice_validation_error = False
self.e_invoice_validation_message = False
Copy link
Member

Choose a reason for hiding this comment

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

Da odoo/odoo@9920f20 è possibile assegnare un valore ad un campo per più record, quindi per risolvere il problema credo sia sufficente rimuovere self.ensure_one, puoi provare?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Funziona. Ho anche aggiunto un piccolo test, provato prima e dopo la patch.

Copy link
Member

Choose a reason for hiding this comment

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

Grazie, puoi dare un nome più significativo al test e/o aggiungere una docstring?
test_2349_fix non fa capire cosa dovrebbe testare.

@TheMule71 TheMule71 force-pushed the 14.0-fix-l10n_it_fatturapa_in-singleton-error branch from 686c5f1 to 760f584 Compare July 16, 2021 08:41
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 17, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 18, 2021
@TheMule71 TheMule71 requested a review from SimoRubi July 19, 2021 08:36
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 20, 2021
@TheMule71 TheMule71 force-pushed the 14.0-fix-l10n_it_fatturapa_in-singleton-error branch from 760f584 to 0eefd4e Compare July 23, 2021 08:38
@tafaRU
Copy link
Member

tafaRU commented Jul 23, 2021

@SimoRubi puoi controllare se ora è ok?

Copy link
Member

@SimoRubi SimoRubi left a comment

Choose a reason for hiding this comment

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

Revisione del codice, per me è ok

@tafaRU
Copy link
Member

tafaRU commented Jul 23, 2021

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

This PR looks fantastic, let's merge it!
Prepared branch 14.0-ocabot-merge-pr-2355-by-tafaRU-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit df4acb6 into OCA:14.0 Jul 23, 2021
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 47dcf67. Thanks a lot for contributing to OCA. ❤️

TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 30, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 30, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 30, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jul 30, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Aug 6, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Aug 6, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Aug 20, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Aug 20, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Sep 3, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Sep 3, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Sep 17, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Sep 17, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 1, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 1, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 8, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 8, 2021
@TheMule71 TheMule71 deleted the 14.0-fix-l10n_it_fatturapa_in-singleton-error branch October 15, 2021 16:21
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 15, 2021
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Oct 15, 2021
TheMule71 added a commit to TheMule71/l10n-italy that referenced this pull request Jan 21, 2022
TheMule71 added a commit to TheMule71/l10n-italy that referenced this pull request Jan 21, 2022
TheMule71 added a commit to TheMule71/l10n-italy that referenced this pull request Jan 21, 2022
TheMule71 added a commit to TheMule71/l10n-italy that referenced this pull request Jan 21, 2022
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jun 29, 2022
TheMule71 added a commit to odoo-italia/l10n-italy that referenced this pull request Jun 29, 2022
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.

4 participants