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
12.0 account invoice negative total #1178
12.0 account invoice negative total #1178
Conversation
6fc6047
to
d0e2a58
Compare
@@ -0,0 +1,68 @@ | |||
======================== | |||
Beescoop Account Module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name of the module is not correct. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
cc90f1f
to
dea7312
Compare
0ff6631
to
d8c9c72
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
d8c9c72
to
c36a94e
Compare
if to_open_invoices.filtered(lambda inv: not inv.partner_id): | ||
raise UserError( | ||
_( | ||
"The field Vendor is required, please complete it to " | ||
"validate the Vendor Bill. " | ||
) | ||
) | ||
if to_open_invoices.filtered(lambda inv: inv.state != "draft"): | ||
raise UserError( | ||
_("Invoice must be in draft state in order to validate it.") | ||
) | ||
if to_open_invoices.filtered(lambda inv: not inv.account_id): | ||
raise UserError( | ||
_( | ||
"No account was found to create the invoice, be sure you " | ||
"have installed a chart of account. " | ||
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this code copied from upstream Odoo? If yes, please add a comment saying as much. It will be pertinent during porting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is already explained in the docstring of the method
class TestInvoiceNegativeAmount(TransactionCase): | ||
def setUp(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use SavepointCase with setUpClass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why savepoint ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried using setupclass, it breaks the tests. I don't want to spend time fixing tests just to use setupclass.
account_invoice_negative_total/tests/test_account_invoice_open.py
Outdated
Show resolved
Hide resolved
bbc5f6f
to
76f12c2
Compare
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
New module allowing the validation an invoice with a negative total amount.