-
-
Notifications
You must be signed in to change notification settings - Fork 47
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
[16.0][MIG] l10n_be_iso20022_pain #204
base: 16.0
Are you sure you want to change the base?
Conversation
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: l10n-belgium-13.0/l10n-belgium-13.0-l10n_be_iso20022_pain Translate-URL: https://translation.odoo-community.org/projects/l10n-belgium-13-0/l10n-belgium-13-0-l10n_be_iso20022_pain/
@@ -25,7 +25,8 @@ class AccountMove(models.Model): | |||
_inherit = "account.move" | |||
|
|||
reference_type = fields.Selection( | |||
selection_add=[("bba", "BBA Structured Communication")] | |||
selection_add=[("bba", "BBA Structured Communication")], |
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.
@sbejaoui Is this still needed following this:
And this:
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.
Yes, in the previous versions, _get_invoice_reference_be_partner
was located in l10n_be_invoice_bba
, but now it has been merged into l10n_be
. This method provides a default BBA-formatted reference.
l10n_be_iso20022_pain
add a new reference type bba
to ensure that the reference (whether generated or edited by the user) complies with the valid BBA format.
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.
I don't think we should add a reference_type. If reference_type
is structured
and journal_id.invoice_reference_model
is be
it means we have a bba structured communication.
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.
_inherit = "account.move" | ||
|
||
reference_type = fields.Selection( | ||
selection_add=[("bba", "BBA Structured Communication")], |
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.
"bba" in payment order should be "BBA" (uppercase)
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.
@ThomasBinsfeld can you elaborate why you downvoted the comment above?
@luc-demeyer if you have a link to the spec of what must go in a SEPA Credit Transfer file for BBA structured communications, that would be helpful?
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.
I didn't see the need to change that and imply some refactoring. But this part has been removed since.
LGTM |
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
a370091
to
535bd80
Compare
535bd80
to
f65c848
Compare
@sbejaoui @ThomasBinsfeld Is it not necessary to check and/or enforce |
The migration script looks to me. But the constraint on |
@api.constrains("communication", "communication_type") | ||
def _check_communication(self): | ||
for rec in self: | ||
if rec.communication_type == "structured" and not check_bbacomm( | ||
rec.communication | ||
): | ||
raise ValidationError(_("Invalid BBA Structured Communication !")) |
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.
@api.constrains("communication", "communication_type") | |
def _check_communication(self): | |
for rec in self: | |
if rec.communication_type == "structured" and not check_bbacomm( | |
rec.communication | |
): | |
raise ValidationError(_("Invalid BBA Structured Communication !")) | |
@api.constrains("order_id", "communication", "communication_type") | |
def _check_communication(self): | |
for rec in self: | |
if ( | |
rec.order_id.journal_id.invoice_reference_model == "be" | |
and rec.communication_type == "structured" | |
and not check_bbacomm(rec.communication | |
): | |
raise ValidationError(_("Invalid BBA Structured Communication !")) |
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.
@ThomasBinsfeld , I made the field invoice_reference_model visible for the bank journal so we can perform this check. See the last commit.
853f332
to
f6a8c8f
Compare
This PR has the |
…yment line check BBA structured communication on payment line only if the journal invoice reference model is "be" Co-authored-by: Thomas Binsfeld (ACSONE) <[email protected]>
f6a8c8f
to
ec5fae3
Compare
> | ||
<attribute | ||
name="attrs" | ||
>{'invisible': [('type', 'not in', ('sale', 'bank'))]}</attribute> |
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.
I'm not sure it makes sense to make invoice_reference_model and invoice_reference_type visible for other journals than customer invoice journals. Because when we pay invoice bills with a journal, we don't control the type of reference we need to use for the suppliers. So I think invoice_reference_model and invoice_reference_type should only be used when generating payment reference on documents that we generate, not documents that we receive from suppliers.
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.
In this case, we remove the check on the payment reference in payment orders. We assume that the reference was checked for our invoices, and we don't concern ourselves with whether it's correct for vendor bills.
and rec.journal_id.invoice_reference_type == "invoice" | ||
and rec.reference_type == "structured" | ||
): | ||
return check_bbacomm(rec.ref) |
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.
Should we not use rec.payment_reference
here?
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.
At least for vendor bills, where ref
is the supplier invoice number?
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.
Should we not use
rec.payment_reference
here?
yes
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.
At least for vendor bills, where
ref
is the supplier invoice number?
only for out_invoice, and don't check for VB
needs: OCA/bank-payment#1314