onesteinbv / addons-onestein

Odoo modules developed by Onestein
https://www.onestein.nl/
GNU Affero General Public License v3.0
59 stars 102 forks source link

[ADD] don't try to execute spreads on cancelled invoices or closed periods #73

Closed hbrunn closed 5 years ago

hbrunn commented 5 years ago

for the first I considered to clean up spreads when cancelling an invoice, but this will make the user unhappy if the invoice is to be uncancelled again. The second is the result of the cronjob not running for a while.

astirpe commented 5 years ago

@hbrunn Thanks!

for the first I considered to clean up spreads when cancelling an invoice, but this will make the user unhappy if the invoice is to be uncancelled again

IMO when cancelling an invoice the related spreads should be cleaned up. Otherwise the user could be confused when looking at the spreads lines (mixed active and inactive spreads lines), eg.: when opening the list from the "Invoice line Spreads" menu. See commit https://github.com/onesteinbv/addons-onestein/commit/9234fdf2804886cd688cfcb9ba50c4c8f8c5b47d made by Therp.

hbrunn commented 5 years ago

so I just add the invoice_cancel override in a new commit here, right?

astirpe commented 5 years ago

Yes. That's the idea, like we did in https://github.com/OCA/account-financial-tools/pull/715.

See lines account_invoice.py#L36-L45.

hbrunn commented 5 years ago

ah, I see my colleague already PRed this a while ago: https://github.com/onesteinbv/addons-onestein/commit/9887086eaf61e0c5f1c3aac6bf489c725c3e727a#diff-e0b0a3740b09f724fd89e76c7aafddb6

astirpe commented 5 years ago

Thanks!