Tryton - Issues

 

Issue7890

Title Additional informations on Payment Group
Priority feature Status testing
Superseder Nosy List ced, semarie
Type feature request Components account_payment
Assigned To semarie Keywords patch
Reviews

Created on 2018-11-28.10:59:37 by semarie, last changed by semarie.

Files
File name Uploaded Type Edit Remove
account_payment-2.patch semarie, 2018-12-07.14:14:23 text/plain
Messages
msg45191 (view) Author: [hidden] (semarie) Date: 2018-12-07.14:14:23
> Usually we have getter method with the same name as the function field, so get_payments_info would be named get_amount.

I used this name because the same function was used for getter of count, amount, amount_succeeded, complete. I renamed it.

> I think the getter should use SQL query with grouping because it is not efficient to read all the lines out of the database just aggregate them in Python.

I have redone it using SQL.

> I think it will be more extension friendly to get the states list from a common private function.

Yes, I agree, but should I do it properly ? Is it just adding a classmethod in Payment ? Do you have an example of such case in a module ?

> The new fields should be added at least to the list view to allow searching on them.

ah yes. it was an error on my side: I didn't included the files in the commit.
msg45122 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2018-12-04.00:57:34
Style remarks: we put help attribute as last argument, we indent closing also the closing brackets.
Usually we have getter method with the same name as the function field, so get_payments_info would be named get_amount.
I think the getter should use SQL query with grouping because it is not efficient to read all the lines out of the database just aggregate them in Python.
I think it will be more extension friendly to get the states list from a common private function.
The new fields should be added at least to the list view to allow searching on them.
msg45099 (view) Author: [hidden] (semarie) Date: 2018-12-02.15:55:45
All new elements are Functions, and computed in one pass on group.payments.

Searching on Complete is done by getting the list of all Payment in incomplete state (not in ['succedded', 'failed']), so the list should remain reasonably short even on big databases. I expect most of Payment to be 'succedded' or 'failed' at some point.
msg45061 (view) Author: [hidden] (semarie) Date: 2018-11-28.10:59:37
Proposal on https://discuss.tryton.org/t/additional-informations-on-payment-group/898
History
Date User Action Args
2018-12-07 14:15:10semariesetfiles: - account_payment-1.patch
2018-12-07 14:14:24semariesetfiles: + account_payment-2.patch
messages: + msg45191
2018-12-04 00:57:35cedsetstatus: chatting -> testing
nosy: + ced
messages: + msg45122
2018-12-02 15:55:46semariesetfiles: + account_payment-1.patch
status: unread -> chatting
messages: + msg45099
keyword: + patch
2018-11-28 10:59:37semariecreate

Showing 10 items. Show all history (warning: this could be VERY long)