Code Monkey home page Code Monkey logo

Comments (21)

alexis-via avatar alexis-via commented on May 18, 2024

@sbidoul I agree with your proposal, because I always use the module "account_banking_payment_transfer" that generate account moves when the payment.order is validated, so that the residual amount is updated as soon as the payment order is validated.

from bank-payment.

pedrobaeza avatar pedrobaeza commented on May 18, 2024

Well, I see that a potential user problem, because they can add the invoice to two or more payment orders that are not validated, and then validate both, creating a negative balance and the user will be unnoticed.

It's better to fix the amout to amount_residual field in amount_to_pay than to completely remove it.

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

@pedrobaeza using amount_residual in amount_to_pay won't work because if the paid amount is both reconciled and in a payment order it will be deduced twice from the amount to pay: first in amount residual and second from the payment line.

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

@pedrobaeza your use case could be taken care of by not showing at all any invoice that is in a payment order that is not sent.

from bank-payment.

pedrobaeza avatar pedrobaeza commented on May 18, 2024

OK, so what do you propose then?

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

@pedrobaeza my proposal is just above your last comment. What do you think?

from bank-payment.

alexis-via avatar alexis-via commented on May 18, 2024

@siboul I like your idea of "not showing at all any invoice that is in a payment order that is not sent." It is simple and reliable.

from bank-payment.

StefanRijnhart avatar StefanRijnhart commented on May 18, 2024

@sbidoul excellent analysis, I agree in principle with your solution + hide invoices from pending payment orders. The situation for setups that don't use clearing accounts could be a bit messy, but I understand from you that Odoo 8.0 natively dropped the check for pending payment orders so I would be happy to follow.

from bank-payment.

pedrobaeza avatar pedrobaeza commented on May 18, 2024

OK for me too.

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

@alexis-via @pedrobaeza @StefanRijnhart thanks for the feedback.
PR acsone#5 is ready for your review.

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

I have an other use case that has an issue regarding the partial payment:

  • I create and validate an invoice with 1000 EUR
  • I create a payment order for this invoice but change the amount_currency to 100 EUR
  • I confirm it
  • I click OK and the state of the payment order is "Sent" and a payment_ids[0] has been created on the invoice with 100 EUR and the residual amount is 900 EUR

So far so good, but when I create an other payment, it is not taken into the payment_ids of the invoice.

  • I create a 2nd partial payment, I check that the amount_currency is 900 EUR (the remaining), I change the amount to pay to 200 EUR
  • I confirm the payement order and click OK
  • The payment order is "Sent"

And when I check the invoice, this is where I think something is wrong:

  • len(payment_ids) is 1 instead of 2 (because 2 payments have been made)
  • sum of debit should be 300 (100 from the 1st payment and 200 from the 2nd payment) but it is still 100 from the 1st payment
  • the residual should be 700 but it is still 900
    => I have a yml test for this one, is it relevant to add it in this PR (through the acsone:8.0-bank-payment-fix93-sbi PR) or create an other one?

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

Sorry, my bad: the last use case is actually working in this PR (#110) but not in the current 8.0 OCA branch, so I add this test as well (acsone#6) ๐Ÿ‘

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

I have an interesting behaviour when I test the button "Partial Reconcile Counter" on the payment order.

I can see in the code that we have a domain on the action_window that we return (with the method partial) but strangely it seems to not take it into account when we edit the lines (just click on the line if you were to edit it).

I made this video to illustrate: http://youtu.be/S0FHnnNkMJM

In the use case of the video:

  • I click the button and I know that I have made 2 partial payments for an invoice so I expect to see 3 account_move_line: 2 in debit and one in credit. This is fine at first.
  • but then I click on the line and the counterpart of each line is displayed (debit for credit and vice versa)

Is it what is expected?

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

That's weird indeed. That's similar to the behaviour of the Journal Items view, but there it occurs only when you change a line. Here it does not look like you change anything, and you just click on different lines, right?

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

yes. I just click on the line.

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

Before we investigate, could you try if you have the same behaviour when going to a Customer or Supplier form and clicking on the Journal Item button on that form?

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

No, I do not have the same behaviour when I go to a supplier form view and click on the button "Journal Items".
I think the issue is with the widget on_write="on_create_write" in the view account.view_move_line_tree because if I remove it I do not have this behaviour.

Yeah, we need to override that method as well I believe:

def on_create_write(self, cr, uid, id, context=None):
    if not id:
        return []
    ml = self.browse(cr, uid, id, context=context)
    return map(lambda x: x.id, ml.move_id.line_id)

What do you think?

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

I must admit I don't think much about that particular issue. I'll ask my colleague @adrienpeiffer.

from bank-payment.

adrienpeiffer avatar adrienpeiffer commented on May 18, 2024

Hi,

I can reproduce this behavior on the Journal Items view.
I added a filter on a partner and one on an account.
When the focus is on a line and I click on another line, all lines of the journal entries of the first line is loaded into the view without considering the filter due to the on_write option on the tree view (And to the on_create_write method).
Personally, I don't really understand the functional aspect of this option and I think it can cause performance problems if we have large journal entries.

Anyone can clarify this? Otherwise, I propose to do a PR to remove this part of code. This is the only place in the core where it is used.

What do you think ?

from bank-payment.

matthieuchoplin avatar matthieuchoplin commented on May 18, 2024

This issue has actually already been reported to Odoo on the 18th Oct 2014: odoo/odoo#3161
I would suggest to leave the code like that and wait for the fix or to not change the core view but create a new one that will not include the on_write="on_create_write" to return the "Partial Reconciles".
Is this the only last blocker for merging the PR #110?

from bank-payment.

sbidoul avatar sbidoul commented on May 18, 2024

@matthieuchoplin from my point of view #110 is ready to merge. Your approval there will help. I'd like to have @pedrobaeza's approval because he had concerns about the selection of customer credit notes.

from bank-payment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.