Merge lp://staging/~yannick-buron/sale-wkfl/sale-wkfl into lp://staging/~sale-core-editors/sale-wkfl/7.0

Proposed by YannickB (YOLO consulting)
Status: Work in progress
Proposed branch: lp://staging/~yannick-buron/sale-wkfl/sale-wkfl
Merge into: lp://staging/~sale-core-editors/sale-wkfl/7.0
Diff against target: 339 lines (+314/-0)
5 files modified
sale_advance_invoice/__init__.py (+23/-0)
sale_advance_invoice/__openerp__.py (+55/-0)
sale_advance_invoice/invoice.py (+63/-0)
sale_advance_invoice/sale.py (+156/-0)
sale_advance_invoice/sale_view.xml (+17/-0)
To merge this branch: bzr merge lp://staging/~yannick-buron/sale-wkfl/sale-wkfl
Reviewer Review Type Date Requested Status
Pedro Manuel Baeza Needs Resubmitting
Leonardo Pistone Abstain
Review via email: mp+207468@code.staging.launchpad.net

Commit message

Add sale_advance_invoice

Description of the change

Add the module sale_advance_invoice which allow to use some different behavior for the way advance invoice are managed in OpenERP.

Essentially, some of my customers were shocked by the negative amount in final invoice when OpenERP create the final invoice.

I created two new behavior :
-Progressive, the final invoice will only have the remaining amount, we don't touch the advance invoices.
-Complete final invoice, when we launch the final invoice we refund the advance invoice and reassign payment to the final invoice.

The complete final invoice feature was developed for the customer "Destock Meubles", a furniture distributor, one year ago. Due to the long time needed to deliver the furniture and the french law, they absolutely needed advance invoices and at the end complete invoice so I had to develop the feature. For the record, everything was automated and integrated with magentoerpconnect, which mean that the advance invoice and final invoice were created at the import order.

The code was still quite ugly at this time so I didn't merge it in community addons. But currently, another customer asked me to remove the deduction amount and so I saw the opportunity to introduce a simpler mode, progressive, clean the module and finally merge it with OCA.

I hope this will be useful to some people. I really think that negative amount is bad on the final invoice, and even illegal regarding some legislation like the french one.

To post a comment you must log in.
Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

Hi, Yannick, I think that your functionality overlaps the one of the sale_order_partial_invoice module that is on account-invoicing repository. It is there because it can be considered as an "invoicing" action. I think that it's more suitable to improve this module, if there is room for it, instead of providing another one with a similar approach.

If I am wrong, please tell me. Until then, I'm going to set this as Disapprove.

Regards.

review: Disapprove
Revision history for this message
YannickB (YOLO consulting) (yannick-buron) wrote :

Hi Pedro,

Thanks you for remembering me this module, I forget it.

I tested sale_order_partial_invoice one month ago, and saw that it didn't implemented the behavior I needed.

sale_order_partial_invoice add the possibility to invoice based on the order line, while sale_advance_invoice improve the native wizard of OpenERP based on a percentage of the whole order.

It shall be tested, but I believe both are compatible. Now that you remember me this module, I also agree that they shall be merged into one module (Little disclaimer, maybe it'll take me some time if I have to do it myself, I need to move on other project beginning from tomorrow).

Regards,
Yannick.

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

If you point me in which functions/functionality must be extracted from your module and merge in the other, I can help you in the implementation.

Regards.

Revision history for this message
YannickB (YOLO consulting) (yannick-buron) wrote :

Thank you Pedro, that's very kind of you.

I think both module have very simple code. I just checked, it seems that they have no function in common so in theory you shall be able to just take all my code and put it in sale_order_partial_invoice.

My module works as follow, it alter the _prepare_invoice functions in advance invoice and final invoice so that, after super() the initial function, it check if we are in progressive or final complete mode and if yes it recompute the invoice lines.

Also, if final complete mode, when we create the final invoice, all linked invoice will be refund and payment attached to sale order. Then, when we validate an invoice, it check if there is payment in the sale.order and if yes it reconcile it to the new invoice.

Also don't hesitate if you see design improvement.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Thanks for your work, Yannick, and Pedro for reviewing.

please let us know if you think a merge of the modules would be feasible (in that case this MP should not 'Needs revirew' anymore, or instead you think this module can indeed go further.

Leo

review: Abstain
Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

Hi,
Based on the previous comments, I set the status of this proposal to "Work in progress" so it will go out of the reviewers' radar. Feel free to change the status to "Needs Review" if you think that this module should be merged as-is or when it is ready to land.
Thanks

Revision history for this message
Pedro Manuel Baeza (pedro.baeza) wrote :

This project is now hosted on https://github.com/OCA/sale-workflow. Please move your proposal there. This guide may help you https://github.com/OCA/maintainers-tools/wiki/How-to-move-a-Merge-Proposal-to-GitHub

review: Needs Resubmitting

Unmerged revisions

32. By yannick@yannick_buron.synerpgy.fr

Add sale_advance_invoice

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches