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

[ADD][14.0]account_payment_order_validation_move_line #1192

Conversation

syera94
Copy link

@syera94 syera94 commented Nov 30, 2023

@florian-dacosta
@alexis-via
for check.
Same than account_payment_order_currency, it should be great if we can talk about it tmw.

Copy link

@florian-dacosta florian-dacosta left a comment

Choose a reason for hiding this comment

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

I'd change the module name.

Maybe something like account_payment_order_select_for_payment to be consistent as it is kind of a glue module between account_invoice_select_for_payment and account_payment_order

Also, there is a missing part in the module. Once the payment order is validated (I guess at the step the reconciliation is done), the paid invoices should be unflaggued (the selected_for_payment should be set to False on the invoices, once the payment is done.

res = super(AccountPaymentLineCreate, self)._prepare_move_line_domain()

if self.select_for_payment_move_line:
res += [("move_id.selected_for_payment", "=", True)]

Choose a reason for hiding this comment

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

I wonder if the condition should be more complicated, because, this selected_for_payment is only meant to be set on invoices, not in regular accounting entry. But this payment order can accept accounting entry that are not invoices, depending on the filter invoice.

So I guess the domain as it is now is ok in case invoice field is True, but if not, we'd have to have a domain like
['|', '&', ('move_type', 'in', ("in_invoice", "out_invoice", "in_refund", "out_refund")), ("move_id.selected_for_payment", "=", True), ('move_type', '=', 'entry')]
So I would check
if self.invoice and self.select_for_payment_move_line
then add the domain [("move_id.selected_for_payment", "=", True)]
elif self.select_for_payment_move_line
then add the more complex domain to accept regular accounting entries

@syera94 syera94 force-pushed the 14.0-mig-account_payment_order_validation_move_line branch from ba65157 to bf4dff7 Compare December 4, 2023 08:42
@syera94 syera94 force-pushed the 14.0-mig-account_payment_order_validation_move_line branch from 59866c9 to 3ea17a7 Compare December 5, 2023 17:28
Copy link

github-actions bot commented Apr 7, 2024

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Apr 7, 2024
@github-actions github-actions bot closed this May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants