Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] Migration of the module account_invoice_tax_required based on t…
…he PR#404 from Angel Moya
- Loading branch information
Sylvain Van Hoof
committed
Mar 21, 2017
1 parent
d9667f9
commit ec98029
Showing
7 changed files
with
119 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Author Vincent Renaville. Copyright 2015 Camptocamp SA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
# Copyright 2015 - Camptocamp SA - Author Vincent Renaville | ||
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import models |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,16 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Author Vincent Renaville. Copyright 2015 Camptocamp SA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
# Copyright 2015 - Camptocamp SA - Author Vincent Renaville | ||
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
{ | ||
'name': "Tax required in invoice", | ||
'version': "8.0.1.0.0", | ||
"author": "Camptocamp,Odoo Community Association (OCA)", | ||
'version': "10.0.1.0.0", | ||
"author": "Camptocamp,Tecnativa,Odoo Community Association (OCA), Okia", | ||
'website': "http://www.camptocamp.com", | ||
'category': "Localisation / Accounting", | ||
'license': "AGPL-3", | ||
'depends': ["account"], | ||
'data': [ | ||
], | ||
'installable': False, | ||
'installable': True, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
############################################################################## | ||
# | ||
# Author Vincent Renaville. Copyright 2015 Camptocamp SA | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU Affero General Public License as | ||
# published by the Free Software Foundation, either version 3 of the | ||
# License, or (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU Affero General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU Affero General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
# | ||
############################################################################## | ||
# Copyright 2015 - Camptocamp SA - Author Vincent Renaville | ||
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import account_invoice |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2015 - Camptocamp SA - Author Vincent Renaville | ||
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from . import test_account_invoice_tax_required |
57 changes: 57 additions & 0 deletions
57
account_invoice_tax_required/tests/test_account_invoice_tax_required.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright 2016 - Tecnativa - Angel Moya <odoo@tecnativa.com> | ||
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). | ||
|
||
from openerp.tests.common import TransactionCase | ||
from openerp import exceptions | ||
|
||
|
||
class TestAccountInvoiceTaxRequired(TransactionCase): | ||
|
||
def setUp(self): | ||
super(TestAccountInvoiceTaxRequired, self).setUp() | ||
|
||
self.account_invoice = self.env['account.invoice'] | ||
self.account_journal = self.env['account.journal'] | ||
self.journal = self.account_journal.create({ | ||
'code': 'test', | ||
'name': 'test', | ||
'type': 'sale' | ||
}) | ||
self.partner = self.env.ref('base.default_user_res_partner') | ||
account_user_type = self.env.ref( | ||
'account.data_account_type_receivable') | ||
|
||
self.account_account = self.env['account.account'] | ||
self.account_rec1_id = self.account_account.create(dict( | ||
code="cust_acc", | ||
name="customer account", | ||
user_type_id=account_user_type.id, | ||
reconcile=True, | ||
)) | ||
|
||
invoice_line_data = [(0, 0, { | ||
'quantity': 10.0, | ||
'account_id': self.account_account.search( | ||
[('user_type_id', | ||
'=', | ||
self.env.ref('account.data_account_type_revenue').id) | ||
], limit=1).id, | ||
'name': 'product test 5', | ||
'price_unit': 100.00, | ||
})] | ||
|
||
self.invoice = self.account_invoice.create(dict( | ||
name="Test Customer Invoice", | ||
reference_type="none", | ||
journal_id=self.journal.id, | ||
partner_id=self.partner.id, | ||
account_id=self.account_rec1_id.id, | ||
invoice_line_ids=invoice_line_data | ||
)) | ||
|
||
def test_exception(self): | ||
"""Validate invoice without tax must raise exception | ||
""" | ||
with self.assertRaises(exceptions.Warning): | ||
self.invoice.action_invoice_open() |