{"action":"created","issue":{"url":"https://api.github.com/repos/OCA/bank-payment/issues/214","repository_url":"https://api.github.com/repos/OCA/bank-payment","labels_url":"https://api.github.com/repos/OCA/bank-payment/issues/214/labels{/name}","comments_url":"https://api.github.com/repos/OCA/bank-payment/issues/214/comments","events_url":"https://api.github.com/repos/OCA/bank-payment/issues/214/events","html_url":"https://github.com/OCA/bank-payment/pull/214","id":107484816,"number":214,"title":"[8.0][revolution] Add support for grouping the payments, for deducing a refund from an invoice and remove storno","user":{"login":"alexis-via","id":1157917,"avatar_url":"https://avatars.githubusercontent.com/u/1157917?v=3","gravatar_id":"","url":"https://api.github.com/users/alexis-via","html_url":"https://github.com/alexis-via","followers_url":"https://api.github.com/users/alexis-via/followers","following_url":"https://api.github.com/users/alexis-via/following{/other_user}","gists_url":"https://api.github.com/users/alexis-via/gists{/gist_id}","starred_url":"https://api.github.com/users/alexis-via/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexis-via/subscriptions","organizations_url":"https://api.github.com/users/alexis-via/orgs","repos_url":"https://api.github.com/users/alexis-via/repos","events_url":"https://api.github.com/users/alexis-via/events{/privacy}","received_events_url":"https://api.github.com/users/alexis-via/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/OCA/bank-payment/labels/needs%20review","name":"needs review","color":"fbca04"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/OCA/bank-payment/milestones/2","html_url":"https://github.com/OCA/bank-payment/milestones/8.0","labels_url":"https://api.github.com/repos/OCA/bank-payment/milestones/2/labels","id":1065868,"number":2,"title":"8.0","description":"","creator":{"login":"max3903","id":939952,"avatar_url":"https://avatars.githubusercontent.com/u/939952?v=3","gravatar_id":"","url":"https://api.github.com/users/max3903","html_url":"https://github.com/max3903","followers_url":"https://api.github.com/users/max3903/followers","following_url":"https://api.github.com/users/max3903/following{/other_user}","gists_url":"https://api.github.com/users/max3903/gists{/gist_id}","starred_url":"https://api.github.com/users/max3903/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/max3903/subscriptions","organizations_url":"https://api.github.com/users/max3903/orgs","repos_url":"https://api.github.com/users/max3903/repos","events_url":"https://api.github.com/users/max3903/events{/privacy}","received_events_url":"https://api.github.com/users/max3903/received_events","type":"User","site_admin":false},"open_issues":13,"closed_issues":28,"state":"open","created_at":"2015-04-13T20:37:36Z","updated_at":"2016-02-10T19:58:51Z","due_on":null,"closed_at":null},"comments":31,"created_at":"2015-09-21T10:35:02Z","updated_at":"2016-02-15T11:39:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/OCA/bank-payment/pulls/214","html_url":"https://github.com/OCA/bank-payment/pull/214","diff_url":"https://github.com/OCA/bank-payment/pull/214.diff","patch_url":"https://github.com/OCA/bank-payment/pull/214.patch"},"body":"Here are some explanation about this important PR. This PR adds support for grouping the payments, which is a feature that I always needed and wanted to add in OpenERP, and this PR makes it possible at last !\r\n\r\nExample1: I want to pay 2 invoices of the same supplier via SEPA credit transfer on 2015-09-30. With the current code, it will generate one SEPA Credit Transfer file with 2 payments inside. So, for the bank, it will be considered as 2 different payments ; if the bank charges per payment (most banks do that, at least in France), the cost is x2 !\r\n\r\nExample2 (which is the scenario that motivate this PR): I have an agreement with my customers to invoice for each delivery and do one \"direct debit\" per month for all the invoices of the month. So I need to generate a direct debit file that has 1 payment corresponding to N invoices.\r\n\r\nI have thought about many different ways of implementing this:\r\n\r\na) do the \"grouping\" inside the code that generate the bank file.\r\nAdvantage: no changes in \"account_banking_payment_transfer\", no change in the datamodel.\r\nDisadvantage: when the user looks at the payment.line on the payment.order, it doesn't reflect the content of the bank file. The user could read the bank file itself to check the grouping, but the bank files are not easy to read !\r\n\r\nb) have grouped \"payment.line\" (1 payment.line for N invoices)\r\nAdvantage : no changes in the code that generate the bank files\r\nDisadvantage : I can't do a link from 1 payment.line to N account.move.line because the M2O field\"move_line_id\" goes from payment.line to account.move.line (I would need it the other way around !). That would also break account_banking_payment_transfer.\r\n\r\nc) have 2 O2M fields on payment.order:\r\n- 1 O2M field pointing to payment.line (current object)\r\n- 1 O2M field pointing to bank.payment.line (new object). One bank.payment.line would group several payment.lines (and we would have a O2M field from bank.payment.line to payment.line, to keep track of the grouping)\r\nThe bank file would be generated from the object bank.payment.line.\r\nAvantage : it's powerful, we can control the grouping and the user can check the content of the bank file by looking at the bank payment lines. No changes required in the module account_banking_payment_transfer.\r\nDisadvantages : it's an extension of the current datamodel, with the introduction of a new object.\r\n\r\nSo this PR implements option \"c\" !\r\n\r\nThe very good point of this PR is that there are almost no changes in the SEPA modules that generate the bank file ; the only change is that instead of looping on the payment lines, we loop on the bank payment lines.\r\n\r\nThis PR changes the dependency of the module account_banking_mandate to add a dependency on account_banking_payment_export. I don't know if it's a problem or not (I consider that \"account_banking_payment_export\" is the \"base\" module of this OCA project)."},"comment":{"url":"https://api.github.com/repos/OCA/bank-payment/issues/comments/184176845","html_url":"https://github.com/OCA/bank-payment/pull/214#issuecomment-184176845","issue_url":"https://api.github.com/repos/OCA/bank-payment/issues/214","id":184176845,"user":{"login":"StefanRijnhart","id":1033124,"avatar_url":"https://avatars.githubusercontent.com/u/1033124?v=3","gravatar_id":"","url":"https://api.github.com/users/StefanRijnhart","html_url":"https://github.com/StefanRijnhart","followers_url":"https://api.github.com/users/StefanRijnhart/followers","following_url":"https://api.github.com/users/StefanRijnhart/following{/other_user}","gists_url":"https://api.github.com/users/StefanRijnhart/gists{/gist_id}","starred_url":"https://api.github.com/users/StefanRijnhart/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StefanRijnhart/subscriptions","organizations_url":"https://api.github.com/users/StefanRijnhart/orgs","repos_url":"https://api.github.com/users/StefanRijnhart/repos","events_url":"https://api.github.com/users/StefanRijnhart/events{/privacy}","received_events_url":"https://api.github.com/users/StefanRijnhart/received_events","type":"User","site_admin":false},"created_at":"2016-02-15T11:39:13Z","updated_at":"2016-02-15T11:39:13Z","body":"Oh, I was thinking that it would help the review to get the removal out of the way, because the diff is now too long for Github to display. If we quickly remove it separately, I think the diff on Github will adapt automatically."}}