MIG account_fiscal_position_vat_check from v10 to v12

This commit is contained in:
Alexis de Lattre
2019-01-31 23:21:17 +01:00
committed by Pedro M. Baeza
parent 573f4b987d
commit 35944df467
10 changed files with 29 additions and 17 deletions

View File

@@ -1,3 +1 @@
# -*- coding: utf-8 -*-
from . import models

View File

@@ -1,15 +1,15 @@
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# Copyright 2013-2019 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
'name': 'Account Fiscal Position VAT Check',
'version': '10.0.1.0.0',
'category': 'Accounting & Finance',
'version': '12.0.1.0.0',
'category': 'Invoices & Payments',
'license': 'AGPL-3',
'summary': 'Check VAT on invoice validation',
'author': "Akretion,Odoo Community Association (OCA)",
'website': 'http://www.akretion.com',
'website': 'https://github.com/OCA/account-financial-tools',
'depends': ['account', 'base_vat'],
'data': [
'views/account_fiscal_position.xml',

View File

@@ -1,4 +1,2 @@
# -*- coding: utf-8 -*-
from . import account_invoice
from . import partner

View File

@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# Copyright 2013-2019 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api, _
from odoo import api, models, _
from odoo.exceptions import UserError
@@ -25,5 +25,5 @@ class AccountInvoice(models.Model):
"a VAT number in Odoo. Please add the VAT number of this "
"Customer in Odoo and try to validate again.") % (
invoice.fiscal_position_id.name,
invoice.partner_id.name_get()[0][1]))
invoice.partner_id.display_name))
return super(AccountInvoice, self).action_move_create()

View File

@@ -1,8 +1,8 @@
# -*- coding: utf-8 -*-
# © 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# Copyright 2013-2019 Akretion France (https://akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import models, api, _
from odoo import api, models, _
class ResPartner(models.Model):

View File

@@ -0,0 +1,3 @@
To configure this module, go to the menu *Invoicing > Configuration > Accounting
> Fiscal Positions* and enable the option **VAT Required** on the relevant
fiscal positions.

View File

@@ -0,0 +1 @@
* Alexis de Lattre <alexis.delattre@akretion.com>

View File

@@ -0,0 +1,8 @@
With this module, when a user tries to validate a customer invoice or refund
with a fiscal position that requires VAT, Odoo blocks the validation of the invoice
if the customer doesn't have a VAT number in Odoo.
In the European Union (EU), when an EU company sends an invoice to
another EU company in another country, it can invoice without VAT
(most of the time) but the VAT number of the customer must be displayed
on the invoice.

View File

@@ -0,0 +1,3 @@
On the customer form view, Odoo will display a warning when a user sets
a fiscal position that has the option **VAT Required** on a customer
that doesn't have a VAT number yet.

View File

@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
© 2013-2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
Copyright 2013-2019 Akretion France (https://akretion.com/)
@author: Alexis de Lattre <alexis.delattre@akretion.com>
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
-->