mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
Port to v8 and to new API
This commit is contained in:
committed by
Pedro M. Baeza
parent
8c9066a122
commit
91c9f99914
24
account_fiscal_position_vat_check/__init__.py
Normal file
24
account_fiscal_position_vat_check/__init__.py
Normal file
@@ -0,0 +1,24 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position VAT Check module for Odoo
|
||||
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from . import account_invoice
|
||||
from . import partner
|
||||
62
account_fiscal_position_vat_check/__openerp__.py
Normal file
62
account_fiscal_position_vat_check/__openerp__.py
Normal file
@@ -0,0 +1,62 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position VAT Check module for Odoo
|
||||
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
{
|
||||
'name': 'Account Fiscal Position VAT Check',
|
||||
'version': '0.1',
|
||||
'category': 'Accounting & Finance',
|
||||
'license': 'AGPL-3',
|
||||
'summary': 'Check VAT on invoice validation',
|
||||
'description': """
|
||||
Check that the Customer has a VAT number on invoice validation
|
||||
==============================================================
|
||||
|
||||
This module adds an option **Customer must have VAT** on fiscal positions.
|
||||
When a user tries to validate a customer invoice or refund
|
||||
with a fiscal position that have this option, OpenERP will check that
|
||||
the customer has a VAT number.
|
||||
|
||||
If it doesn't, OpenERP will block the validation of the invoice
|
||||
and display an error message.
|
||||
|
||||
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.
|
||||
|
||||
This module also displays a warning when a user sets
|
||||
a fiscal position with the option **Customer must have VAT** on a customer
|
||||
and this customer doesn't have a VAT number in OpenERP yet.
|
||||
|
||||
Please contact Alexis de Lattre from Akretion <alexis.delattre@akretion.com>
|
||||
for any help or question about this module.
|
||||
""",
|
||||
'author': "Akretion,Odoo Community Association (OCA)",
|
||||
'website': 'http://www.akretion.com',
|
||||
'depends': ['account'],
|
||||
'data': [
|
||||
'account_fiscal_position_view.xml',
|
||||
'partner_view.xml',
|
||||
],
|
||||
'installable': True,
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2013-2014 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="view_account_position_form" model="ir.ui.view">
|
||||
<field name="name">customer.must.have.vat.fiscal_position_form</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="country_group_id" position="after">
|
||||
<field name="customer_must_have_vat" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_account_position_tree" model="ir.ui.view">
|
||||
<field name="name">customer.must.have.vat.fiscal_position_tree</field>
|
||||
<field name="model">account.fiscal.position</field>
|
||||
<field name="inherit_id" ref="account.view_account_position_tree" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="name" position="after">
|
||||
<field name="customer_must_have_vat" />
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
64
account_fiscal_position_vat_check/account_invoice.py
Normal file
64
account_fiscal_position_vat_check/account_invoice.py
Normal file
@@ -0,0 +1,64 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position VAT Check module for OpenERP
|
||||
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, fields, api, _
|
||||
from openerp.exceptions import except_orm
|
||||
|
||||
|
||||
class account_fiscal_position(models.Model):
|
||||
_inherit = 'account.fiscal.position'
|
||||
|
||||
customer_must_have_vat = fields.Boolean(
|
||||
string='Customer Must Have VAT number',
|
||||
help="If enabled, Odoo will check that the customer has a VAT "
|
||||
"number when the user validates a customer invoice/refund.")
|
||||
|
||||
|
||||
class account_invoice(models.Model):
|
||||
_inherit = 'account.invoice'
|
||||
|
||||
@api.multi
|
||||
def action_move_create(self):
|
||||
'''Check that the customer has VAT set
|
||||
if required by the fiscal position'''
|
||||
for invoice in self:
|
||||
if (
|
||||
invoice.type in ('out_invoice', 'out_refund') and
|
||||
invoice.fiscal_position and
|
||||
invoice.fiscal_position.customer_must_have_vat and
|
||||
not invoice.partner_id.vat):
|
||||
if invoice.type == 'out_invoice':
|
||||
type_label = _('a Customer Invoice')
|
||||
else:
|
||||
type_label = _('a Customer Refund')
|
||||
raise except_orm(
|
||||
_('Missing VAT number:'),
|
||||
_("You are trying to validate %s "
|
||||
"with the fiscal position '%s' "
|
||||
"that require the customer to have a VAT number. "
|
||||
"But the Customer '%s' doesn't "
|
||||
"have a VAT number in OpenERP."
|
||||
"Please add the VAT number of this Customer in Odoo "
|
||||
" and try to validate again.")
|
||||
% (type_label, invoice.fiscal_position.name,
|
||||
invoice.partner_id.name))
|
||||
return super(account_invoice, self).action_move_create()
|
||||
@@ -0,0 +1,78 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_fiscal_position_vat_check
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-10-19 19:46+0000\n"
|
||||
"PO-Revision-Date: 2013-10-19 19:46+0000\n"
|
||||
"Last-Translator: <>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: \n"
|
||||
"Plural-Forms: \n"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: view:res.partner:0
|
||||
msgid "fiscal_position_change(property_account_position, vat)"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:54
|
||||
#, python-format
|
||||
msgid "You are trying to validate %s with the fiscal position '%s' that require the customer to have a VAT number. But the Customer '%s' doesn't have a VAT number in OpenERP. Please add the VAT number of this Customer in OpenERP and try to validate again."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:51
|
||||
#, python-format
|
||||
msgid "a Customer Refund"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: field:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid "Customer Must Have VAT number"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: help:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid "If enabled, OpenERP will check that the customer has a VAT number when the user validates a customer invoice/refund."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_fiscal_position
|
||||
msgid "Fiscal Position"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_invoice
|
||||
msgid "Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:49
|
||||
#, python-format
|
||||
msgid "a Customer Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:53
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:38
|
||||
#, python-format
|
||||
msgid "Missing VAT number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:39
|
||||
#, python-format
|
||||
msgid "You have set the fiscal position '%s' that require the customer to have a VAT number. You should add the VAT number of this customer in OpenERP."
|
||||
msgstr ""
|
||||
|
||||
95
account_fiscal_position_vat_check/i18n/fr.po
Normal file
95
account_fiscal_position_vat_check/i18n/fr.po
Normal file
@@ -0,0 +1,95 @@
|
||||
# Translation of OpenERP Server.
|
||||
# This file contains the translation of the following modules:
|
||||
# * account_fiscal_position_vat_check
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: OpenERP Server 7.0\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2013-10-19 19:46+0000\n"
|
||||
"PO-Revision-Date: 2014-01-03 01:31+0000\n"
|
||||
"Last-Translator: Alexis de Lattre <alexis@via.ecp.fr>\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-06-12 06:31+0000\n"
|
||||
"X-Generator: Launchpad (build 17041)\n"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: view:res.partner:0
|
||||
msgid "fiscal_position_change(property_account_position, vat)"
|
||||
msgstr "fiscal_position_change(property_account_position, vat)"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:54
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You are trying to validate %s with the fiscal position '%s' that require the "
|
||||
"customer to have a VAT number. But the Customer '%s' doesn't have a VAT "
|
||||
"number in OpenERP. Please add the VAT number of this Customer in OpenERP and "
|
||||
"try to validate again."
|
||||
msgstr ""
|
||||
"Vous essayez de valider %s avec la position fiscale '%s' qui oblige à "
|
||||
"connaître le numéro de TVA du client. Mais le client '%s' n'a pas de numéro "
|
||||
"de TVA dans OpenERP. Veuillez ajouter le numéro de TVA de ce client dans "
|
||||
"OpenERP et essayer de valider à nouveau."
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:51
|
||||
#, python-format
|
||||
msgid "a Customer Refund"
|
||||
msgstr "un avoir client"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: field:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid "Customer Must Have VAT number"
|
||||
msgstr "Numéro de TVA obligatoire pour le client"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: help:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid ""
|
||||
"If enabled, OpenERP will check that the customer has a VAT number when the "
|
||||
"user validates a customer invoice/refund."
|
||||
msgstr ""
|
||||
"Si activé, OpenERP vérifiera que le client a un numéro de TVA quand "
|
||||
"l'utilisasteur valide la facture/avoir client."
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_fiscal_position
|
||||
msgid "Fiscal Position"
|
||||
msgstr "Position fiscale"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_invoice
|
||||
msgid "Invoice"
|
||||
msgstr "Facture"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr "Partenaire"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:49
|
||||
#, python-format
|
||||
msgid "a Customer Invoice"
|
||||
msgstr "une facture client"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:53
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:38
|
||||
#, python-format
|
||||
msgid "Missing VAT number:"
|
||||
msgstr "Numéro de TVA manquant :"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:39
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You have set the fiscal position '%s' that require the customer to have a "
|
||||
"VAT number. You should add the VAT number of this customer in OpenERP."
|
||||
msgstr ""
|
||||
"Vous avez sélectionné la position fiscale '%s' qui exige que le client ait "
|
||||
"un numéro de TVA. Vous devez ajouter le numéro de TVA de ce client dans "
|
||||
"OpenERP."
|
||||
87
account_fiscal_position_vat_check/i18n/pt_BR.po
Normal file
87
account_fiscal_position_vat_check/i18n/pt_BR.po
Normal file
@@ -0,0 +1,87 @@
|
||||
# Brazilian Portuguese translation for account-financial-tools
|
||||
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
|
||||
# This file is distributed under the same license as the account-financial-tools package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: account-financial-tools\n"
|
||||
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"POT-Creation-Date: 2013-10-19 19:46+0000\n"
|
||||
"PO-Revision-Date: 2014-01-10 11:39+0000\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: Brazilian Portuguese <pt_BR@li.org>\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Launchpad-Export-Date: 2014-06-12 06:31+0000\n"
|
||||
"X-Generator: Launchpad (build 17041)\n"
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: view:res.partner:0
|
||||
msgid "fiscal_position_change(property_account_position, vat)"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:54
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You are trying to validate %s with the fiscal position '%s' that require the "
|
||||
"customer to have a VAT number. But the Customer '%s' doesn't have a VAT "
|
||||
"number in OpenERP. Please add the VAT number of this Customer in OpenERP and "
|
||||
"try to validate again."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:51
|
||||
#, python-format
|
||||
msgid "a Customer Refund"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: field:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid "Customer Must Have VAT number"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: help:account.fiscal.position,customer_must_have_vat:0
|
||||
msgid ""
|
||||
"If enabled, OpenERP will check that the customer has a VAT number when the "
|
||||
"user validates a customer invoice/refund."
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_fiscal_position
|
||||
msgid "Fiscal Position"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_account_invoice
|
||||
msgid "Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: model:ir.model,name:account_fiscal_position_vat_check.model_res_partner
|
||||
msgid "Partner"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:49
|
||||
#, python-format
|
||||
msgid "a Customer Invoice"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/account_invoice.py:53
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:38
|
||||
#, python-format
|
||||
msgid "Missing VAT number:"
|
||||
msgstr ""
|
||||
|
||||
#. module: account_fiscal_position_vat_check
|
||||
#: code:addons/account_fiscal_position_vat_check/partner.py:39
|
||||
#, python-format
|
||||
msgid ""
|
||||
"You have set the fiscal position '%s' that require the customer to have a "
|
||||
"VAT number. You should add the VAT number of this customer in OpenERP."
|
||||
msgstr ""
|
||||
47
account_fiscal_position_vat_check/partner.py
Normal file
47
account_fiscal_position_vat_check/partner.py
Normal file
@@ -0,0 +1,47 @@
|
||||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Account Fiscal Position VAT Check module for Odoo
|
||||
# Copyright (C) 2013-2014 Akretion (http://www.akretion.com)
|
||||
# @author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
#
|
||||
# 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/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from openerp import models, api, _
|
||||
|
||||
|
||||
class res_partner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
@api.multi
|
||||
def fiscal_position_change(
|
||||
self, account_position_id, vat, customer):
|
||||
'''Warning if the fiscal position requires a VAT number and the
|
||||
partner doesn't have one yet'''
|
||||
if account_position_id and customer and not vat:
|
||||
fp = self.env['account.fiscal.position'].browse(
|
||||
account_position_id)
|
||||
if fp.customer_must_have_vat:
|
||||
return {
|
||||
'warning': {
|
||||
'title': _('Missing VAT number:'),
|
||||
'message': _(
|
||||
"You have set the fiscal position '%s' "
|
||||
"that require the customer to have a VAT number, "
|
||||
"but the VAT number is missing.") % fp.name
|
||||
}
|
||||
}
|
||||
return True
|
||||
26
account_fiscal_position_vat_check/partner_view.xml
Normal file
26
account_fiscal_position_vat_check/partner_view.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!--
|
||||
Copyright (C) 2013-2014 Akretion (http://www.akretion.com/)
|
||||
@author Alexis de Lattre <alexis.delattre@akretion.com>
|
||||
The licence is in the file __openerp__.py
|
||||
-->
|
||||
|
||||
<openerp>
|
||||
<data>
|
||||
|
||||
|
||||
<record id="view_partner_property_form" model="ir.ui.view">
|
||||
<field name="name">customer.must.have.vat.fiscal_position_form</field>
|
||||
<field name="model">res.partner</field>
|
||||
<field name="inherit_id" ref="account.view_partner_property_form" />
|
||||
<field name="arch" type="xml">
|
||||
<field name="property_account_position" position="attributes">
|
||||
<attribute name="on_change">fiscal_position_change(property_account_position, vat, customer)</attribute>
|
||||
</field>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 25 KiB |
BIN
account_fiscal_position_vat_check/static/description/icon.png
Normal file
BIN
account_fiscal_position_vat_check/static/description/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Reference in New Issue
Block a user