Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[10.0][mig] account_invoice_merge #238

Merged
merged 4 commits into from
May 31, 2017

Conversation

LoisRForgeFlow
Copy link
Contributor

@LoisRForgeFlow LoisRForgeFlow commented Mar 16, 2017

Task done in this migration:

  • Replace openerp tags and import by odoo.
  • Update README.
  • Adapt header of the files to new template.
  • Correct typo error in wizard view.
  • Remove the use of workflow in the invoice.
  • Squash commit history.

@LoisRForgeFlow LoisRForgeFlow force-pushed the 10.0-mig-account_invoice_merge branch 2 times, most recently from 81c19d4 to dc4b273 Compare March 16, 2017 15:24
@pedrobaeza pedrobaeza mentioned this pull request Mar 17, 2017
34 tasks
'partner_bank_id': invoice.partner_bank_id.id,
}

@api.multi
def do_merge(self, keep_references=True, date_invoice=False):
def do_merge(self, keep_references=True, date_invoice=False,
remove_empty_invoice_lines=True):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where this new option is used

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feature was added by @alexis-via

A fact is that it's by default 'True' so the corresponding part of code is always executed. But my guess is that it is added as an option for more customization possibilities in other modules.

Copy link
Contributor

@adrienpeiffer adrienpeiffer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just one question. Otherwise 👍 (Code review and functional testing)

Copy link
Member

@chienandalu chienandalu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested functionality 👍

@pedrobaeza
Copy link
Member

I think tests for this module are very needed.

@JordiBForgeFlow
Copy link
Sponsor Member

@mreficent can you add unit tests to this one?

@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 10.0-mig-account_invoice_merge branch 2 times, most recently from fc7530f to 7b83526 Compare April 26, 2017 16:06
@LoisRForgeFlow
Copy link
Contributor Author

Thank you @mreficent! This is ready to merge, right?

cc @pedrobaeza @jbeficent

@pedrobaeza
Copy link
Member

Can you make a bit more asserts on the tests (like checking the number of lines in the resulting invoice, check that 2 invoices with different partner are not merged...)? If it's too much, I understand, and as a first test version can serve.

@sergio-teruel
Copy link
Contributor

sergio-teruel commented Apr 26, 2017

@lreficent This is not ready for merge...
Can you rebase to review please??

@LoisRForgeFlow
Copy link
Contributor Author

@pedrobaeza We'll try to improve a bit. 👍

@sergio-teruel well, all test are green, there are no conflicts, runbot is working... I don't see the problem to review it. Anyway, it was for sure rebased yesterday since @mreficent squashed the commits (for what you need to do a rebase).

@sergio-teruel
Copy link
Contributor

@lreficent This module not works well. When I merge a two invoices from one sale the sale line qty_invoiced field is set to zero, so i can invoice this sale order.
I try do a reviw but the code is not in your diffs

@sergio-teruel
Copy link
Contributor

@chienandalu Can test??

@carlosdauden
Copy link
Contributor

@lreficent ¿Can you include this modification?:
#262
Thanks

@MiquelRForgeFlow
Copy link
Contributor

  • Added the suggested tests by @pedrobaeza and some more.
  • Solves sales object issue.
  • Added OCA icon and summary info.

@sergio-teruel
Copy link
Contributor

@mreficent You can not marge invoice lines thatn come in from different order_lines, if you do that the qty_invoiced field is wrong.
I attach images for better explanation:
I think that if invoice has a sale order you do not merge lines
seleccion_088
seleccion_090
seleccion_089

@MiquelRForgeFlow
Copy link
Contributor

@sergio-teruel Ok, we will work in this issue.

@sergio-teruel
Copy link
Contributor

@mreficent perfect... thanks!! 😄

'product_id', 'account_id', 'account_analytic_id',
'uom_id'
]
for field in ['analytics_id']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'analytics_id' field was added by account_analytic_plans base module. But this base module was removed in v9. So this field is not anymore in versions 9.0 and 10.0

Copy link
Contributor

@MiquelRForgeFlow MiquelRForgeFlow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please, review and then I will squash.
@lreficent @sergio-teruel @pedrobaeza

@LoisRForgeFlow
Copy link
Contributor Author

LGTM 👍

@sergio-teruel
Copy link
Contributor

@lreficent Can we add the context key "is_merge" whan cancel the old invoices??

alexis-via and others added 2 commits May 24, 2017 12:01
Move variable to argument of method
Update version number to 9.0
Update to recent OCA standards
@rafaelbn
Copy link
Member

Hi @mreficent last commit 9cc6a1c introduce a travis error. Do you know why?

@MiquelRForgeFlow
Copy link
Contributor

It's not from last commit. It's from #254 and their tests.

@rafaelbn
Copy link
Member

@luismontalba could you please review #238 (comment) thanks!

@pedrobaeza
Copy link
Member

@mreficent I think the tests are failing because of your additions in this PR. Just run Travis again on 10.0 branch, and if it's green, then your module is breaking correct inheritance and it's reflected in any of the modules tests.

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionally tested in runbot 👍
But travis should be fixed

@MiquelRForgeFlow
Copy link
Contributor

MiquelRForgeFlow commented May 25, 2017

@pedrobaeza The account_invoice_refund_link tests are not failing by this branch. The Travis on 10.0 branch is failing already. https://travis-ci.org/OCA/account-invoicing/builds/234196352

@gurneyalex
Copy link
Member

@mreficent @rafaelbn #269 fixes Travis for the 10.0 branch. Please review 😸

@gurneyalex
Copy link
Member

triggering a rebuild

@gurneyalex gurneyalex closed this May 31, 2017
@gurneyalex gurneyalex reopened this May 31, 2017
]
for field in ['analytics_id']:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you replace 'analytics_id' instead of adding the new field in this list ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The 'analytics_id' field was added by account_analytic_plans base module. But this base module was removed in v9.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the explanation @mreficent

@adrienpeiffer
Copy link
Contributor

@mreficent is it make sense to squash your last commits ?

@MiquelRForgeFlow MiquelRForgeFlow force-pushed the 10.0-mig-account_invoice_merge branch 2 times, most recently from d167354 to 3265d99 Compare May 31, 2017 14:10
@adrienpeiffer adrienpeiffer merged commit ce9b888 into OCA:10.0 May 31, 2017
@LoisRForgeFlow LoisRForgeFlow deleted the 10.0-mig-account_invoice_merge branch June 13, 2017 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.