-
-
Notifications
You must be signed in to change notification settings - Fork 510
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
8.0 improve selection of invoices to pay, solves #93 #110
Conversation
5a6dcdc
to
cb02532
Compare
@@ -45,9 +46,33 @@ def default_get(self, field_list): | |||
def extend_payment_order_domain(self, payment_order, domain): | |||
if payment_order.payment_order_type == 'payment': | |||
domain += [('account_id.type', 'in', ('payable', 'receivable')), | |||
('amount_to_pay', '>', 0)] | |||
('credit', '>', 0)] |
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.
This is the main reason why we can't add refunds. We can redo this making:
...
'|',
'&',
('credit', '>', '0'),
('type', '=', 'in_invoice'),
'&',
('credit', '<', '0'),
('type', '=', 'in_refund')]
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.
Can you elaborate the scenario that causes problems for you? In my understanding credit or debit can never be negative in Odoo.
So we have the following:
- supplier invoice: credit > 0 on payable account
- supplier refund: not something to be paid on a credit transfer order
- customer invoice: not something to be paid on a credit transfer order
- customer refund: credit > 0 on receivable account
@sbidoul I tested your PR and it works well. But I have a question: I see you added a button "Partial reconciles counter" on payment order to see the number of lines that you need to reconcile manually. Don't you think that we should be able to do it automatically ? I mean, if I have the module account_banking_payment_transfer:
I think it is possible to develop that. And I think it's what accountants would expect. I can help you implement that if you think it's possible. |
Hi Alexis, Yes the scenario you describe in 5) should be automatic. Actually, I thought it was the case already. So if it's not we should develop it (in another PR I suppose). But the scenario that led us to create that button is the following (see also #101):
|
@alexis-via changes in b5e571f allow automatic reconciliation with the transfer move even if move line linked on the payment line is already partially reconciled |
Hi, |
@matthieuchoplin thanks a lot for proposing to add test. This is most welcome. Since the test you propose is specific to this PR, I suggest you do it as a PR to branch acsone:8.0-bank-payment-fix93-sbi. I'll review it and merge it into this PR. |
7e1fc25
to
b3c7061
Compare
I committed a more sophisticated filter on receivables to filter out partially reconciled customer credit notes. And rebased to get the latest pep8 fixes. |
…e use case given in OCA#93
This fixes OCA#93. - filter invoices that are already in draft and open payment orders. - use residual amount to care for partial reconciliations and align with official 8.0
…nciled then write new values on this partial reconcile
…payment without refund
830b27d
to
0e02b7e
Compare
The tests from @matthieuchoplin are merged and I rebased. |
@pedrobaeza @alexis-via your comments have been cared for. This is working fine in production at several customers. Looking forward to your reviews. |
I would be happy to have this one merged and carry on the improvements in other PRs. |
Well, for now it can be merged by my part, because I need to go deeper to solve my problem, but there's not related to this PR. 👍 Let's see if @alexis-via also agrees about merging. |
Hi, |
yes, let's go 👍 |
8.0 improve selection of invoices to pay, solves #93
This PR has already been extensively discussed in acsone#5.
It provides: