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

12.0 account invoice negative total #1178

Conversation

victor-champonnois
Copy link
Member

New module allowing the validation an invoice with a negative total amount.

@victor-champonnois victor-champonnois marked this pull request as draft June 15, 2022 08:25
@victor-champonnois victor-champonnois force-pushed the 12.0-account_invoice_negative_total branch from 6fc6047 to d0e2a58 Compare June 15, 2022 09:18
@victor-champonnois victor-champonnois marked this pull request as ready for review June 16, 2022 09:32
@@ -0,0 +1,68 @@
========================
Beescoop Account Module
Copy link

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. :)

Copy link
Member Author

Choose a reason for hiding this comment

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

fixed

@victor-champonnois victor-champonnois force-pushed the 12.0-account_invoice_negative_total branch 2 times, most recently from cc90f1f to dea7312 Compare February 24, 2023 10:46
@remytms remytms force-pushed the 12.0-account_invoice_negative_total branch from 0ff6631 to d8c9c72 Compare March 8, 2023 15:59
Copy link

@remytms remytms left a comment

Choose a reason for hiding this comment

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

LGTM

@remytms remytms force-pushed the 12.0-account_invoice_negative_total branch from d8c9c72 to c36a94e Compare March 8, 2023 16:28
account_invoice_negative_total/models/account_invoice.py Outdated Show resolved Hide resolved
Comment on lines +30 to +46
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. "
)
)
Copy link
Member

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.

Copy link
Member Author

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

account_invoice_negative_total/models/res_config.py Outdated Show resolved Hide resolved
Comment on lines +9 to +10
class TestInvoiceNegativeAmount(TransactionCase):
def setUp(self):
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

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

Why savepoint ?

Copy link
Member Author

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.

@victor-champonnois victor-champonnois force-pushed the 12.0-account_invoice_negative_total branch from bbc5f6f to 76f12c2 Compare July 18, 2023 13:34
Copy link

github-actions bot commented Mar 3, 2024

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.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Mar 3, 2024
@github-actions github-actions bot closed this Apr 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants