- Financial Report
+ Financial Reports
accounting.report
ir.actions.act_window
form
diff --git a/addons/account_analytic_plans/report/crossovered_analytic.rml b/addons/account_analytic_plans/report/crossovered_analytic.rml
index 6e331ed1b83..f374aa5a2c2 100644
--- a/addons/account_analytic_plans/report/crossovered_analytic.rml
+++ b/addons/account_analytic_plans/report/crossovered_analytic.rml
@@ -240,7 +240,7 @@
[[ formatLang(a['ref_qty']) ]]
|
- [[ formatLang(a['ref_amt']) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(a['ref_amt'], currency_obj=company.currency_id) ]]
|
100.00%
@@ -288,7 +288,7 @@
[[formatLang(a['qty']) ]]
|
- [[ formatLang(a['amt']) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(a['amt'], currency_obj=company.currency_id) ]]
|
[[ formatLang(a['perc']) ]]%
diff --git a/addons/account_budget/report/analytic_account_budget_report.rml b/addons/account_budget/report/analytic_account_budget_report.rml
index a8b957f52a5..ba89c7ed1ea 100644
--- a/addons/account_budget/report/analytic_account_budget_report.rml
+++ b/addons/account_budget/report/analytic_account_budget_report.rml
@@ -185,13 +185,13 @@
[['.....' *(a['status']-1) ]] [[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ a['name'] ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo']) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln']) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac']) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], currency_obj=company.currency_id) ]]
|
[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['perc']) ]]%
@@ -205,13 +205,13 @@
[[ repeatIn(funct_total(data['form']),'b') ]] Total:
|
- [[ formatLang(b['tot_theo']) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_theo'], currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_pln']) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_pln'], currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_prac']) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_prac'], currency_obj=company.currency_id) ]]
|
[[ formatLang(b['tot_perc']) ]]%
@@ -223,4 +223,4 @@
-
\ No newline at end of file
+
diff --git a/addons/account_budget/report/budget_report.rml b/addons/account_budget/report/budget_report.rml
index 0533042822a..4d82e8d8c1d 100644
--- a/addons/account_budget/report/budget_report.rml
+++ b/addons/account_budget/report/budget_report.rml
@@ -148,13 +148,13 @@
[['.....' *(a['status']-1) ]][[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ a['name'] ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['perc'], digits=2) ]]%
@@ -168,13 +168,13 @@
[[ repeatIn(funct_total(data['form']),'b') ]]Total:
|
- [[ formatLang(b['tot_theo'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_theo'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_pln'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_pln'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_prac'], digits=get_digits(dp='Account')) ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_prac'], digits=get_digits(dp='Account'), currency_obj=company.currency_id) ]]
|
[[ formatLang(b['tot_perc'], digits=2) ]]%
diff --git a/addons/account_budget/report/crossovered_budget_report.rml b/addons/account_budget/report/crossovered_budget_report.rml
index 63db53ab5ce..b4e8e963b7d 100644
--- a/addons/account_budget/report/crossovered_budget_report.rml
+++ b/addons/account_budget/report/crossovered_budget_report.rml
@@ -163,13 +163,13 @@
[['.....' *(a['status']-1) ]][[ (a['status']==1 and (setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ a['name'] ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['theo'], dp='Account', currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['pln'], dp='Account', currency_obj=company.currency_id) ]]
|
- [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['prac'], dp='Account', currency_obj=company.currency_id) ]]
|
[[ (a['status']==1 and ( setTag('para','para',{'fontName':'Helvetica-bold'}))) or removeParentNode('font') ]] [[ formatLang(a['perc'],digits=2) ]]%
@@ -183,13 +183,13 @@
[[ repeatIn(funct_total(data['form']),'b') ]] Total :
|
- [[ formatLang(b['tot_theo'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_theo'], dp='Account', currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_pln'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_pln'], dp='Account', currency_obj=company.currency_id) ]]
|
- [[ formatLang(b['tot_prac'], dp='Account') ]] [[ company.currency_id.symbol ]]
+ [[ formatLang(b['tot_prac'], dp='Account', currency_obj=company.currency_id) ]]
|
[[ formatLang(b['tot_perc'],digits=2) ]]%
diff --git a/addons/analytic/i18n/ar.po b/addons/analytic/i18n/ar.po
index ee7a5f9319e..036a3ef8c46 100644
--- a/addons/analytic/i18n/ar.po
+++ b/addons/analytic/i18n/ar.po
@@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME \n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
-"PO-Revision-Date: 2011-09-05 23:03+0000\n"
-"Last-Translator: Majed Majbour \n"
+"PO-Revision-Date: 2011-09-22 02:41+0000\n"
+"Last-Translator: kifcaliph \n"
"Language-Team: Arabic \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-07 04:35+0000\n"
-"X-Generator: Launchpad (build 13861)\n"
+"X-Launchpad-Export-Date: 2011-09-22 04:48+0000\n"
+"X-Generator: Launchpad (build 13996)\n"
#. module: analytic
#: field:account.analytic.account,child_ids:0
@@ -25,7 +25,7 @@ msgstr "حساب فرعي"
#. module: analytic
#: field:account.analytic.account,name:0
msgid "Account Name"
-msgstr ""
+msgstr "اسم الحساب"
#. module: analytic
#: help:account.analytic.line,unit_amount:0
@@ -44,12 +44,12 @@ msgstr ""
#. module: analytic
#: field:account.analytic.account,state:0
msgid "State"
-msgstr ""
+msgstr "المحافظة / الولاية"
#. module: analytic
#: field:account.analytic.account,user_id:0
msgid "Account Manager"
-msgstr ""
+msgstr "مدير المحاسبة"
#. module: analytic
#: selection:account.analytic.account,state:0
@@ -114,7 +114,7 @@ msgstr "وصف"
#. module: analytic
#: selection:account.analytic.account,type:0
msgid "Normal"
-msgstr ""
+msgstr "عادي"
#. module: analytic
#: field:account.analytic.account,company_id:0
@@ -185,7 +185,7 @@ msgstr "جهة الإتصال"
msgid ""
"Error! The currency has to be the same as the currency of the selected "
"company"
-msgstr ""
+msgstr "خطأ! العملة لابد و أن تكون مثل العملة للشركة المختارة"
#. module: analytic
#: selection:account.analytic.account,state:0
@@ -208,11 +208,13 @@ msgid ""
"If you select the View Type, it means you won't allow to create journal "
"entries using that account."
msgstr ""
+"اذا اخترت نوع العرض، فذلك يعني انك لن تسمح بإنشاء قيود اليومية بإستخدام ذلك "
+"الحساب."
#. module: analytic
#: field:account.analytic.account,date:0
msgid "Date End"
-msgstr ""
+msgstr "نهاية التاريخ"
#. module: analytic
#: field:account.analytic.account,code:0
diff --git a/addons/base_setup/base_setup_views.xml b/addons/base_setup/base_setup_views.xml
index a6059148b51..fab929b239b 100644
--- a/addons/base_setup/base_setup_views.xml
+++ b/addons/base_setup/base_setup_views.xml
@@ -70,7 +70,6 @@
-
2
@@ -222,7 +221,6 @@
-
1
diff --git a/addons/base_vat/__init__.py b/addons/base_vat/__init__.py
index e1999d38b87..43dbd0c1418 100644
--- a/addons/base_vat/__init__.py
+++ b/addons/base_vat/__init__.py
@@ -21,5 +21,4 @@
import base_vat
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/base_vat/__openerp__.py b/addons/base_vat/__openerp__.py
index 92af5664336..29f402aa286 100644
--- a/addons/base_vat/__openerp__.py
+++ b/addons/base_vat/__openerp__.py
@@ -18,26 +18,34 @@
# along with this program. If not, see .
#
##############################################################################
+
{
- 'name': 'Base VAT',
+ 'name': 'VAT Number Validation',
'version': '1.0',
- 'category': 'Tools',
- 'category': 'Generic Modules/Base',
+ 'category': 'Finance',
'complexity': "easy",
'description': """
-Enable VAT Number for a partner and check its validity.
-=======================================================
+VAT validation for Partners' VAT numbers
+========================================
+
+After installing this module, values entered in the VAT field of Partners will
+be validated for all supported countries. The country is inferred from the
+2-letter country code that prefixes the VAT number, e.g. ``BE0477472701``
+will be validated using the Belgian rules.
+
+Supported countries currently include EU countries, and a few non-EU countries
+such as Chile, Colombia, Mexico, Norway or Russia. For unsupported countries,
+only the country code will be validated.
-This module follows the methods stated at http://sima-pc.com/nif.php for
-checking the validity of VAT Number assigned to partners in European countries.
""",
'author': 'OpenERP SA',
'depends': ['account'],
'website': 'http://www.openerp.com',
- 'update_xml': ['base_vat_view.xml'],
+ 'data': ['base_vat_view.xml'],
'installable': True,
'active': False,
'certificate': '0084849360989',
'images': ['images/1_partner_vat.jpeg'],
}
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_vat/base_vat.py b/addons/base_vat/base_vat.py
index 58e5670b589..ba858d10e64 100644
--- a/addons/base_vat/base_vat.py
+++ b/addons/base_vat/base_vat.py
@@ -2,8 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL (). All Rights Reserved
-# Copyright (C) 2008-2009 B2CK, Cedric Krier, Bertrand Chenal (the methods "check_vat_[a-z]{2}"
+# Copyright (C) 2004-2011 OpenERP SA ()
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -19,13 +18,22 @@
# along with this program. If not, see .
#
##############################################################################
+
+import logging
import string
+import datetime
+import re
+
+try:
+ import vatnumber
+except ImportError:
+ logging.getLogger('base_vat').warning("VAT validation partially unavailable because the `vatnumber` Python library cannot be found. "
+ "Install it to support more countries, for example with `easy_install vatnumber`.")
+ vatnumber = None
from osv import osv, fields
-from tools.translate import _
from tools.misc import ustr
-import re
-import datetime
+from tools.translate import _
_ref_vat = {
'be': 'BE0477472701', 'at': 'ATU12345675',
@@ -42,13 +50,9 @@ _ref_vat = {
'pt': 'PT123456789', 'ro': 'RO1234567897',
'se': 'SE123456789701', 'si': 'SI12345679',
'sk': 'SK0012345675', 'el': 'EL12345670',
- 'mx': 'MXABC123456T1B', 'no': 'NO123456785'
-
- }
-
-def mult_add(i, j):
- """Sum each digits of the multiplication of i and j."""
- return reduce(lambda x, y: x + int(y), str(i*j), 0)
+ 'mx': 'MXABC123456T1B', 'no': 'NO123456785',
+ 'hr': 'HR01234567896', # Croatia, contributed by Milan Tribuson
+}
class res_partner(osv.osv):
_inherit = 'res.partner'
@@ -67,16 +71,17 @@ class res_partner(osv.osv):
if not partner.vat:
continue
vat_country, vat_number = self._split_vat(partner.vat)
- if not hasattr(self, 'check_vat_' + vat_country):
- #We didn't find the validation method for the country code. If that country code can be found in openerp, this means that it is a valid country code
- #and we simply didn't have implemented that function. In that case we continue.
+ check_func_name = 'check_vat_' + vat_country
+ check_func = getattr(self, check_func_name, None) or \
+ getattr(vatnumber, check_func_name, None)
+ if not check_func:
+ # No VAT validation available, default to check that the country code
+ # exists.
if country_obj.search(cr, uid, [('code', 'ilike', vat_country)], context=context):
continue
- #Otherwise, it means that the country code isn't valid and we return False.
- return False
- check = getattr(self, 'check_vat_' + vat_country)
- if not check(vat_number):
+ # Country code not found, considered invalid
return False
+ return check_func(vat_number)
return True
def vat_change(self, cr, uid, ids, value, context=None):
@@ -93,997 +98,24 @@ class res_partner(osv.osv):
# has more than 3 characters
return cn[0] in string.ascii_lowercase and cn[1] in string.ascii_lowercase
vat_country, vat_number = self._split_vat(self.browse(cr, uid, ids)[0].vat)
+ vat_no = "'CC##' (CC=Country Code, ##=VAT Number)"
if default_vat_check(vat_country, vat_number):
- vat_no = vat_country in _ref_vat and _ref_vat[vat_country] or 'Country Code + Vat Number'
- return _('The Vat does not seems to be correct. You should have entered something like this %s'), (vat_no)
- return _('The VAT is invalid, It should begin with the country code'), ()
+ vat_no = _ref_vat[vat_country] if vat_country in _ref_vat else vat_no
+ return '\n' + _('This VAT number does not seem to be valid.\nNote: the expected format is %s') % vat_no
_constraints = [(check_vat, _construct_constraint_msg, ["vat"])]
- # code from the following methods come from Tryton (B2CK)
- # http://www.tryton.org/hgwebdir.cgi/modules/relationship/file/544d1de586d9/party.py
- def check_vat_at(self, vat):
- '''
- Check Austria VAT number.
- '''
- if len(vat) != 9:
- return False
- if vat[0] != 'U':
- return False
- num = vat[1:]
- try:
- int(num)
- except:
- return False
- sum = int(num[0]) + mult_add(2, int(num[1])) + \
- int(num[2]) + mult_add(2, int(num[3])) + \
- int(num[4]) + mult_add(2, int(num[5])) + \
- int(num[6])
- check = 10 - ((sum + 4) % 10)
- if check == 10:
- check = 0
- if int(vat[-1:]) != check:
- return False
- return True
-
- def check_vat_be(self, vat):
- '''
- Check Belgium VAT number.
- '''
- if len(vat) != 10:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[-2:]) != \
- 97 - (int(vat[:8]) % 97):
- return False
- return True
-
- def check_vat_bg(self, vat):
- '''
- Check Bulgaria VAT number.
- '''
- if len(vat) not in [9,10]:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0]) in (2, 3) and \
- int(vat[1:2]) != 22:
- return False
- sum = 4 * int(vat[0]) + 3 * int(vat[1]) + 2 * int(vat[2]) + \
- 7 * int(vat[3]) + 6 * int(vat[4]) + 5 * int(vat[5]) + \
- 4 * int(vat[6]) + 3 * int(vat[7]) + 2 * int(vat[8])
- check = 11 - (sum % 11)
- if check == 11:
- check = 0
- return True
-
- def check_vat_cy(self, vat):
- '''
- Check Cyprus VAT number.
- '''
- if len(vat) != 9:
- return False
- try:
- int(vat[:8])
- except:
- return False
- n0 = int(vat[0])
- n1 = int(vat[1])
- n2 = int(vat[2])
- n3 = int(vat[3])
- n4 = int(vat[4])
- n5 = int(vat[5])
- n6 = int(vat[6])
- n7 = int(vat[7])
-
- def conv(x):
- if x == 0:
- return 1
- elif x == 1:
- return 0
- elif x == 2:
- return 5
- elif x == 3:
- return 7
- elif x == 4:
- return 9
- elif x == 5:
- return 13
- elif x == 6:
- return 15
- elif x == 7:
- return 17
- elif x == 8:
- return 19
- elif x == 9:
- return 21
- return x
- n0 = conv(n0)
- n2 = conv(n2)
- n4 = conv(n4)
- n6 = conv(n6)
-
- sum = n0 + n1 + n2 + n3 + n4 + n5 + n6 + n7
- check = chr(sum % 26 + 65)
- if check != vat[8]:
- return False
- return True
-
- def check_vat_cz(self, vat):
- '''
- Check Czech Republic VAT number.
- '''
- if len(vat) not in (8, 9, 10):
- return False
- try:
- int(vat)
- except:
- return False
-
- if len(vat) == 8:
- if int(vat[0]) not in (0, 1, 2, 3, 4, 5, 6, 7, 8):
- return False
- sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
- 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
- 2 * int(vat[6])
- check = 11 - (sum % 11)
- if check == 10:
- check = 0
- if check == 11:
- check = 1
- if check != int(vat[7]):
- return False
- elif len(vat) == 9 and int(vat[0]) == 6:
- sum = 8 * int(vat[1]) + 7 * int(vat[2]) + 6 * int(vat[3]) + \
- 5 * int(vat[4]) + 4 * int(vat[5]) + 3 * int(vat[6]) + \
- 2 * int(vat[7])
- check = 9 - ((11 - (sum % 11)) % 10)
- if check != int(vat[8]):
- return False
- elif len(vat) == 9:
- if int(vat[0:2]) > 53 and int(vat[0:2]) < 80:
- return False
- if int(vat[2:4]) < 1:
- return False
- if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
- return False
- if int(vat[2:4]) > 62:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 28:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 29:
- return False
- if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 30:
- return False
- if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12, 51,
- 53, 55, 57, 58, 60, 62):
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 31:
- return False
- elif len(vat) == 10:
- if int(vat[0:2]) < 54:
- return False
- if int(vat[2:4]) < 1:
- return False
- if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
- return False
- if int(vat[2:4]) > 62:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 28:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 29:
- return False
- if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 30:
- return False
- if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12, 51,
- 53, 55, 57, 58, 60, 62):
- if int(vat[4:6]) < 1:
- return False
- if int(vat[4:6]) > 31:
- return False
- if (int(vat[0:2]) + int(vat[2:4]) + int(vat[4:6]) + int(vat[6:8]) +
- int(vat[8:10])) % 11 != 0:
- return False
- if int(vat[0:10]) % 11 != 0:
- return False
- return True
-
- def check_vat_de(self, vat):
- '''
- Check Germany VAT number.
- '''
- if len(vat) != 9:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0:7]) <= 0:
- return False
- sum = 0
- for i in range(8):
- sum = (2 * ((int(vat[i]) + sum + 9) % 10 + 1)) % 11
- check = 11 - sum
- if check == 10:
- check = 0
- if int(vat[8]) != check:
- return False
- return True
-
- def check_vat_dk(self, vat):
- '''
- Check Denmark VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0]) <= 0:
- return False
- sum = 2 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
- 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
- 2 * int(vat[6]) + int(vat[7])
- if sum % 11 != 0:
- return False
- return True
-
- def check_vat_ee(self, vat):
- '''
- Check Estonia VAT number.
- '''
- if len(vat) != 9:
- return False
- try:
- int(vat)
- except:
- return False
- sum = 3 * int(vat[0]) + 7 * int(vat[1]) + 1 * int(vat[2]) + \
- 3 * int(vat[3]) + 7 * int(vat[4]) + 1 * int(vat[5]) + \
- 3 * int(vat[6]) + 7 * int(vat[7])
- check = 10 - (sum % 10)
- if check == 10:
- check = 0
- if check != int(vat[8]):
- return False
- return True
-
- def check_vat_es(self, vat):
- '''
- Check Spain VAT number.
- '''
- if len(vat) != 9:
- return False
-
- conv = {
- 1: 'T',
- 2: 'R',
- 3: 'W',
- 4: 'A',
- 5: 'G',
- 6: 'M',
- 7: 'Y',
- 8: 'F',
- 9: 'P',
- 10: 'D',
- 11: 'X',
- 12: 'B',
- 13: 'N',
- 14: 'J',
- 15: 'Z',
- 16: 'S',
- 17: 'Q',
- 18: 'V',
- 19: 'H',
- 20: 'L',
- 21: 'C',
- 22: 'K',
- 23: 'E',
- }
- #Legal persons with profit aim
- if vat[0] in ('A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'J', 'U', 'V'):
- try:
- int(vat[1:8])
- except:
- return False
- sum = mult_add(2, int(vat[1])) + int(vat[2]) + \
- mult_add(2, int(vat[3])) + int(vat[4]) + \
- mult_add(2, int(vat[5])) + int(vat[6]) + \
- mult_add(2, int(vat[7]))
- check = 10 - (sum % 10)
- if check == 10:
- check = 0
- return True
- #Legal persons with non-profit aim
- elif vat[0] in ('N', 'P', 'Q', 'R', 'S', 'W'):
- try:
- int(vat[1:8])
- except:
- return False
- sum = mult_add(2, int(vat[1])) + int(vat[2]) + \
- mult_add(2, int(vat[3])) + int(vat[4]) + \
- mult_add(2, int(vat[5])) + int(vat[6]) + \
- mult_add(2, int(vat[7]))
- check = 10 - (sum % 10)
- check = chr(check + 64)
- if check != vat[8]:
- return False
- return True
- #Foreign natural persons, under age 14 or non-residents
- elif vat[0] in ('K', 'L', 'M', 'X', 'Y', 'Z'):
- if vat[0] == 'Y':
- check_value = '1' + vat[1:8]
- elif vat[0] == 'Z':
- check_value = '2' + vat[1:8]
- else:
- check_value = vat[1:8]
-
- try:
- int(check_value)
- except:
- return False
- check = 1 + (int(check_value) % 23)
-
- check = conv[check]
- if check != vat[8]:
- return False
- return True
- #Spanish natural persons
- else:
- try:
- int(vat[:8])
- except:
- return False
- check = 1 + (int(vat[:8]) % 23)
-
- check = conv[check]
- if check != vat[8]:
- return False
- return True
-
- def check_vat_fi(self, vat):
- '''
- Check Finland VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
- sum = 7 * int(vat[0]) + 9 * int(vat[1]) + 10 * int(vat[2]) + \
- 5 * int(vat[3]) + 8 * int(vat[4]) + 4 * int(vat[5]) + \
- 2 * int(vat[6])
- check = 11 - (sum % 11)
- if check == 11:
- check = 0
- if check == 10:
- return False
- if check != int(vat[7]):
- return False
- return True
-
- def check_vat_fr(self, vat):
- '''
- Check France VAT number.
- '''
- if len(vat) != 11:
- return False
-
- try:
- int(vat[2:11])
- except:
- return False
-
- system = None
- try:
- int(vat[0:2])
- system = 'old'
- except:
- system = 'new'
-
- if system == 'old':
- check = ((int(vat[2:11]) * 100) + 12) % 97
- if check != int(vat[0:2]):
- return False
- return True
- else:
- conv = ['0', '1', '2', '3', '4', '5', '6', '7',
- '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H',
- 'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T',
- 'U', 'V', 'W', 'X', 'Y', 'Z']
- if vat[0] not in conv \
- or vat[1] not in conv:
- return False
- c1 = conv.index(vat[0])
- c2 = conv.index(vat[1])
-
- if c1 < 10:
- sum = c1 * 24 + c2 - 10
- else:
- sum = c1 * 34 + c2 - 100
-
- x = sum % 11
- sum = (int(sum) / 11) + 1
- y = (int(vat[2:11]) + sum) % 11
- if x != y:
- return False
- return True
-
- def check_vat_gb(self, vat):
- '''
- Check United Kingdom VAT number.
- '''
-
- if len(vat) == 5:
- try:
- int(vat[2:5])
- except:
- return False
-
- if vat[0:2] == 'GD':
- if int(vat[2:5]) >= 500:
- return False
- return True
- if vat[0:2] == 'HA':
- if int(vat[2:5]) < 500:
- return False
- return True
- return False
- elif len(vat) in (9, 10):
- try:
- int(vat)
- except:
- return False
-
- if int(vat[0:7]) < 1:
- return False
- if int(vat[0:7]) > 19999 and int(vat[0:7]) < 1000000:
- return False
- if int(vat[7:9]) > 97:
- return False
- if len(vat) == 10 and int(vat[9]) != 3:
- return False
-
- sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
- 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
- 2 * int(vat[6]) + 10 * int(vat[7]) + int(vat[8])
- if int(vat[0:3]) > 100:
- if sum % 97 not in (0, 55, 42):
- return False
- else:
- if sum % 97 != 0:
- return False
- return True
- elif len(vat) in (12, 13):
- try:
- int(vat)
- except:
- return False
-
- if int(vat[0:3]) not in (0, 1):
- return False
-
- if int(vat[3:10]) < 1:
- return False
- if int(vat[3:10]) > 19999 and int(vat[3:10]) < 1000000:
- return False
- if int(vat[10:12]) > 97:
- return False
- if len(vat) == 13 and int(vat[12]) != 3:
- return False
-
- sum = 8 * int(vat[3]) + 7 * int(vat[4]) + 6 * int(vat[5]) + \
- 5 * int(vat[6]) + 4 * int(vat[7]) + 3 * int(vat[8]) + \
- 2 * int(vat[9]) + 10 * int(vat[10]) + int(vat[11])
- if sum % 97 != 0:
- return False
- return True
- return False
-
- def check_vat_gr(self, vat):
- '''
- Check Greece VAT number.
- '''
- try:
- int(vat)
- except:
- return False
- if len(vat) == 8:
- sum = 128 * int(vat[0]) + 64 * int(vat[1]) + 32 * int(vat[2]) + \
- 16 * int(vat[3]) + 8 * int(vat[4]) + 4 * int(vat[5]) + \
- 2 * int(vat[6])
- check = sum % 11
- if check == 10:
- check = 0
- if check != int(vat[7]):
- return False
- return True
- elif len(vat) == 9:
- sum = 256 * int(vat[0]) + 128 * int(vat[1]) + 64 * int(vat[2]) + \
- 32 * int(vat[3]) + 16 * int(vat[4]) + 8 * int(vat[5]) + \
- 4 * int(vat[6]) + 2 * int(vat[7])
- check = sum % 11
- if check == 10:
- check = 0
- if check != int(vat[8]):
- return False
- return True
- return False
-
- def check_vat_el(self, vat):
- return self.check_vat_gr(vat)
-
- def check_vat_hu(self, vat):
- '''
- Check Hungary VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0]) <= 0:
- return False
- sum = 9 * int(vat[0]) + 7 * int(vat[1]) + 3 * int(vat[2]) + \
- 1 * int(vat[3]) + 9 * int(vat[4]) + 7 * int(vat[5]) + \
- 3 * int(vat[6])
- check = 10 - (sum % 10)
- if check == 10:
- check = 0
- if check != int(vat[7]):
- return False
- return True
-
- def check_vat_ie(self, vat):
- '''
- Check Ireland VAT number.
- '''
- if len(vat) != 8:
- return False
- if (ord(vat[1]) >= 65 and ord(vat[1]) <= 90) \
- or vat[1] in ('+', '*'):
- try:
- int(vat[0])
- int(vat[2:7])
- except:
- return False
-
- if int(vat[0]) <= 6:
- return False
-
- sum = 7 * int(vat[2]) + 6 * int(vat[3]) + 5 * int(vat[4]) + \
- 4 * int(vat[5]) + 3 * int(vat[6]) + 2 * int(vat[0])
- check = sum % 23
- if check == 0:
- check = 'W'
- else:
- check = chr(check + 64)
- if check != vat[7]:
- return False
- return True
- else:
- try:
- int(vat[0:7])
- except:
- return False
-
- sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
- 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
- 2 * int(vat[6])
- check = sum % 23
- if check == 0:
- check = 'W'
- else:
- check = chr(check + 64)
- if check != vat[7]:
- return False
- return True
-
- def check_vat_it(self, vat):
- '''
- Check Italy VAT number.
- '''
- if len(vat) != 11:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0:7]) <= 0:
- return False
- if int(vat[7:10]) <= 0:
- return False
- if int(vat[7:10]) > 100 and int(vat[7:10]) < 120:
- return False
-
- sum = int(vat[0]) + mult_add(2, int(vat[1])) + int(vat[2]) + \
- mult_add(2, int(vat[3])) + int(vat[4]) + \
- mult_add(2, int(vat[5])) + int(vat[6]) + \
- mult_add(2, int(vat[7])) + int(vat[8]) + \
- mult_add(2, int(vat[9]))
- check = 10 - (sum % 10)
- if check == 10:
- check = 0
- if check != int(vat[10]):
- return False
- return True
-
- def check_vat_lt(self, vat):
- '''
- Check Lithuania VAT number.
- '''
- try:
- int(vat)
- except:
- return False
-
- if len(vat) == 9:
- if int(vat[7]) != 1:
- return False
- sum = 1 * int(vat[0]) + 2 * int(vat[1]) + 3 * int(vat[2]) + \
- 4 * int(vat[3]) + 5 * int(vat[4]) + 6 * int(vat[5]) + \
- 7 * int(vat[6]) + 8 * int(vat[7])
- if sum % 11 == 10:
- sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 5 * int(vat[2]) + \
- 6 * int(vat[3]) + 7 * int(vat[4]) + 8 * int(vat[5]) + \
- 9 * int(vat[6]) + 1 * int(vat[7])
- check = sum % 11
- if check == 10:
- check = 0
- if check != int(vat[8]):
- return False
- return True
- elif len(vat) == 12:
- if int(vat[10]) != 1:
- return False
- sum = 1 * int(vat[0]) + 2 * int(vat[1]) + 3 * int(vat[2]) + \
- 4 * int(vat[3]) + 5 * int(vat[4]) + 6 * int(vat[5]) + \
- 7 * int(vat[6]) + 8 * int(vat[7]) + 9 * int(vat[8]) + \
- 1 * int(vat[9]) + 2 * int(vat[10])
- if sum % 11 == 10:
- sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 5 * int(vat[2]) + \
- 6 * int(vat[3]) + 7 * int(vat[4]) + 8 * int(vat[5]) + \
- 9 * int(vat[6]) + 1 * int(vat[7]) + 2 * int(vat[8]) + \
- 3 * int(vat[9]) + 4 * int(vat[10])
- check = sum % 11
- if check == 10:
- check = 0
- if check != int(vat[11]):
- return False
- return True
- return False
-
- def check_vat_lu(self, vat):
- '''
- Check Luxembourg VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0:6]) <= 0:
- return False
- check = int(vat[0:6]) % 89
- if check != int(vat[6:8]):
- return False
- return True
-
- def check_vat_lv(self, vat):
- '''
- Check Latvia VAT number.
- '''
- if len(vat) != 11:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0]) >= 4:
- sum = 9 * int(vat[0]) + 1 * int(vat[1]) + 4 * int(vat[2]) + \
- 8 * int(vat[3]) + 3 * int(vat[4]) + 10 * int(vat[5]) + \
- 2 * int(vat[6]) + 5 * int(vat[7]) + 7 * int(vat[8]) + \
- 6 * int(vat[9])
- if sum % 11 == 4 and int(vat[0]) == 9:
- sum = sum - 45
- if sum % 11 == 4:
- check = 4 - (sum % 11)
- elif sum % 11 > 4:
- check = 14 - (sum % 11)
- elif sum % 11 < 4:
- check = 3 - (sum % 11)
- if check != int(vat[10]):
- return False
- return True
- else:
- if int(vat[2:4]) == 2 and int(vat[4:6]) % 4 > 0:
- if int(vat[0:2]) < 1 or int(vat[0:2]) > 28:
- return False
- if int(vat[2:4]) == 2 and int(vat[4:6]) % 4 == 0:
- if int(vat[0:2]) < 1 or int(vat[0:2]) > 29:
- return False
- if int(vat[2:4]) in (4, 6, 9, 11):
- if int(vat[0:2]) < 1 or int(vat[0:2]) > 30:
- return False
- if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12):
- if int(vat[0:2]) < 1 or int(vat[0:2]) > 31:
- return False
- if int(vat[2:4]) < 1 or int(vat[2:4]) > 12:
- return False
- return True
-
- def check_vat_mt(self, vat):
- '''
- Check Malta VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
-
- if int(vat[0:6]) < 100000:
- return False
-
- sum = 3 * int(vat[0]) + 4 * int(vat[1]) + 6 * int(vat[2]) + \
- 7 * int(vat[3]) + 8 * int(vat[4]) + 9 * int(vat[5])
- check = 37 - (sum % 37)
- if check != int(vat[6:8]):
- return False
- return True
-
- def check_vat_nl(self, vat):
- '''
- Check Netherlands VAT number.
- '''
- if len(vat) != 12:
- return False
- try:
- int(vat[0:9])
- int(vat[10:12])
- except:
- return False
- if int(vat[0:8]) <= 0:
- return False
- if vat[9] != 'B':
- return False
-
- sum = 9 * int(vat[0]) + 8 * int(vat[1]) + 7 * int(vat[2]) + \
- 6 * int(vat[3]) + 5 * int(vat[4]) + 4 * int(vat[5]) + \
- 3 * int(vat[6]) + 2 * int(vat[7])
-
- check = sum % 11
- if check == 10:
- return False
- if check != int(vat[8]):
- return False
- return True
-
- def check_vat_pl(self, vat):
- '''
- Check Poland VAT number.
- '''
- if len(vat) != 10:
- return False
- try:
- int(vat)
- except:
- return False
-
- sum = 6 * int(vat[0]) + 5 * int(vat[1]) + 7 * int(vat[2]) + \
- 2 * int(vat[3]) + 3 * int(vat[4]) + 4 * int(vat[5]) + \
- 5 * int(vat[6]) + 6 * int(vat[7]) + 7 * int(vat[8])
- check = sum % 11
- if check == 10:
- return False
- if check != int(vat[9]):
- return False
- return True
-
- def check_vat_pt(self, vat):
- '''
- Check Portugal VAT number.
- '''
- if len(vat) != 9:
- return False
- try:
- int(vat)
- except:
- return False
-
- if int(vat[0]) <= 0:
- return False
-
- sum = 9 * int(vat[0]) + 8 * int(vat[1]) + 7 * int(vat[2]) + \
- 6 * int(vat[3]) + 5 * int(vat[4]) + 4 * int(vat[5]) + \
- 3 * int(vat[6]) + 2 * int(vat[7])
- check = 11 - (sum % 11)
- if check == 10 or check == 11:
- check = 0
- return True
-
- def check_vat_ro(self, vat):
- '''
- Check Romania VAT number.
- '''
- try:
- int(vat)
- except:
- return False
-
- if len(vat) >= 2 and len(vat) <= 10:
- vat = (10 - len(vat)) * '0' + vat
- sum = 7 * int(vat[0]) + 5 * int(vat[1]) + 3 * int(vat[2]) + \
- 2 * int(vat[3]) + 1 * int(vat[4]) + 7 * int(vat[5]) + \
- 5 * int(vat[6]) + 3 * int(vat[7]) + 2 * int(vat[8])
- check = (sum * 10) % 11
- if check == 10:
- check = 0
- if check != int(vat[9]):
- return False
- return True
- elif len(vat) == 13:
- if int(vat[0]) not in (1, 2, 3, 4, 6):
- return False
- if int(vat[3:5]) < 1 or int(vat[3:5]) > 12:
- return False
- if int(vat[3:5]) == 2 and int(vat[1:3]) % 4 > 0:
- if int(vat[5:7]) < 1 or int(vat[5:7]) > 28:
- return False
- if int(vat[3:5]) == 2 and int(vat[1:3]) % 4 == 0:
- if int(vat[5:7]) < 1 or int(vat[5:7]) > 29:
- return False
- if int(vat[3:5]) in (4, 6, 9, 11):
- if int(vat[5:7]) < 1 or int(vat[5:7]) > 30:
- return False
- if int(vat[3:5]) in (1, 3, 5, 7, 8, 10, 12):
- if int(vat[5:7]) < 1 or int(vat[5:7]) > 31:
- return False
-
- sum = 2 * int(vat[0]) + 7 * int(vat[1]) + 9 * int(vat[2]) + \
- 1 * int(vat[3]) + 4 * int(vat[4]) + 6 * int(vat[5]) + \
- 3 * int(vat[6]) + 5 * int(vat[7]) + 8 * int(vat[8]) + \
- 2 * int(vat[9]) + 7 * int(vat[10]) + 9 * int(vat[11])
- check = sum % 11
- if check == 10:
- check = 1
- if check != int(vat[12]):
- return False
- return True
- return False
-
- def check_vat_se(self, vat):
- '''
- Check Sweden VAT number.
- '''
- if len(vat) != 12:
- return False
- try:
- int(vat)
- except:
- return False
-
- if int(vat[9:11]) < 0:
- return False
-
- sum = mult_add(2, int(vat[0])) + int(vat[1]) + \
- mult_add(2, int(vat[2])) + int(vat[3]) + \
- mult_add(2, int(vat[4])) + int(vat[5]) + \
- mult_add(2, int(vat[6])) + int(vat[7]) + \
- mult_add(2, int(vat[8]))
- check = 10 - (sum % 10)
- if check == 10:
- check = 0
- if check != int(vat[9]):
- return False
- return True
-
- def check_vat_si(self, vat):
- '''
- Check Slovenia VAT number.
- '''
- if len(vat) != 8:
- return False
- try:
- int(vat)
- except:
- return False
- if int(vat[0:7]) <= 999999:
- return False
-
- sum = 8 * int(vat[0]) + 7 * int(vat[1]) + 6 * int(vat[2]) + \
- 5 * int(vat[3]) + 4 * int(vat[4]) + 3 * int(vat[5]) + \
- 2 * int(vat[6])
- check = 11 - (sum % 11)
- if check == 10:
- check = 0
- if check == 11:
- check = 1
- if check != int(vat[7]):
- return False
- return True
-
- def check_vat_sk(self, vat):
- '''
- Check Slovakia VAT number.
- '''
- try:
- int(vat)
- except:
- return False
- if len(vat) not in(9, 10):
- return False
-
- if int(vat[0:2]) in (0, 10, 20) and len(vat) == 10:
- return True
-
- if len(vat) == 10:
- if int(vat[0:2]) < 54 or int(vat[0:2]) > 99:
- return False
-
- if len(vat) == 9:
- if int(vat[0:2]) > 53 :
- return False
-
- if int(vat[2:4]) < 1:
- return False
- if int(vat[2:4]) > 12 and int(vat[2:4]) < 51:
- return False
- if int(vat[2:4]) > 62:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 > 0:
- if int(vat[4:6]) < 1 or int(vat[4:6]) > 28:
- return False
- if int(vat[2:4]) in (2, 52) and int(vat[0:2]) % 4 == 0:
- if int(vat[4:6]) < 1 or int(vat[4:6]) > 29:
- return False
- if int(vat[2:4]) in (4, 6, 9, 11, 54, 56, 59, 61):
- if int(vat[4:6]) < 1 or int(vat[4:6]) > 30:
- return False
- if int(vat[2:4]) in (1, 3, 5, 7, 8, 10, 12,
- 51, 53, 55, 57, 58, 60, 62):
- if int(vat[4:6]) < 1 or int(vat[4:6]) > 31:
- return False
- return True
+ # Mexican VAT verification, contributed by
+ # and Panos Christeas
__check_vat_mx_re = re.compile(r"(?P[A-Za-z\xd1\xf1&]{3,4})" \
r"[ \-_]?" \
r"(?P[0-9]{2})(?P[01][0-9])(?P[0-3][0-9])" \
r"[ \-_]?" \
r"(?P[A-Za-z0-9&\xd1\xf1]{3})$")
-
def check_vat_mx(self, vat):
''' Mexican VAT verification
-
+
Verificar RFC México
'''
# we convert to 8-bit encoding, to help the regex parse only bytes
@@ -1101,12 +133,12 @@ class res_partner(osv.osv):
datetime.date(ano, int(m.group('mes')), int(m.group('dia')))
except ValueError:
return False
-
+
#Valid format and valid date
return True
- # check_vat_no contributed by Rolv Råen (adEgo)
+ # Norway VAT validation, contributed by Rolv Råen (adEgo)
def check_vat_no(self, vat):
'''
Check Norway VAT number.See http://www.brreg.no/english/coordination/number.html
diff --git a/addons/base_vat/base_vat_view.xml b/addons/base_vat/base_vat_view.xml
index 6e00fc61ae0..69a1870ea72 100644
--- a/addons/base_vat/base_vat_view.xml
+++ b/addons/base_vat/base_vat_view.xml
@@ -1,21 +1,21 @@
-
+
-
- res.partner.vat.inherit
- res.partner
-
-
-
-
-
-
-
-
-
-
+
+ res.partner.vat.inherit
+ res.partner
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/addons/crm/crm_installer.py b/addons/crm/crm_installer.py
index 595cfbc2382..fc3816c80fa 100644
--- a/addons/crm/crm_installer.py
+++ b/addons/crm/crm_installer.py
@@ -30,6 +30,7 @@ class crm_installer(osv.osv_memory):
'crm_helpdesk': fields.boolean('Helpdesk', help="Manages a Helpdesk service."),
'crm_fundraising': fields.boolean('Fundraising', help="This may help associations in their fundraising process and tracking."),
'crm_claim': fields.boolean('Claims', help="Manages the suppliers and customers claims, including your corrective or preventive actions."),
+ 'import_sugarcrm': fields.boolean('Import Data from SugarCRM', help="Help you to import and update data from SugarCRM to OpenERP"),
'crm_caldav': fields.boolean('Calendar Synchronizing', help="Helps you to synchronize the meetings with other calendar clients and mobiles."),
'sale_crm': fields.boolean('Opportunity to Quotation', help="Create a Quotation from an Opportunity."),
'fetchmail': fields.boolean('Fetch Emails', help="Allows you to receive E-Mails from POP/IMAP server."),
@@ -49,6 +50,7 @@ class crm_installer(osv.osv_memory):
nodes = doc.xpath("//field[@name='sale_crm']")
for node in nodes:
node.set('invisible', '0')
+ node.set('modifiers', '{}')
res['arch'] = etree.tostring(doc)
return res
diff --git a/addons/crm/crm_installer_view.xml b/addons/crm/crm_installer_view.xml
index b2abddefbf3..cca8fc8560e 100644
--- a/addons/crm/crm_installer_view.xml
+++ b/addons/crm/crm_installer_view.xml
@@ -16,6 +16,7 @@
+
diff --git a/addons/crm/crm_lead_demo.xml b/addons/crm/crm_lead_demo.xml
index e1366266c0a..390932c9e0a 100644
--- a/addons/crm/crm_lead_demo.xml
+++ b/addons/crm/crm_lead_demo.xml
@@ -44,7 +44,6 @@
-
@@ -266,12 +265,17 @@
-
+
+ BalmerInc S.A.
+ Rue des Palais 51, bte 33
+ Bruxelles
+
+
@@ -282,15 +286,65 @@
-
+
+ Lucie Vonck
+ Chaussée de Namur
+ Grand-Rosière
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Université de Liège
+ Place du 20Août
+ Liège
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Bank Wealthy and sons
+ 1 rue Rockfeller
+ Paris
+
+
-
+
opportunity
@@ -308,7 +362,7 @@
-
+
opportunity
@@ -324,6 +378,11 @@
+ Dubois sprl
+ Avenue de la Liberté 56
+ Brussels
+
+
@@ -370,6 +429,82 @@
+ Axelor
+ 12 rue Albert Einstein
+ Champs sur Marne
+
+
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
+
+
+
+ Thymbra
+ Palermo, Capital Federal
+ C1414CMS Capital Federal
+ Buenos Aires
+
+
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
+
+
+
+ Eric Dubois
+ Chaussée de Binche, 27
+ Mons
+
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
+
+
+
+
+ opportunity
+
+
+
+
+
+
+
+
diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml
index 118bf117035..1a2e1f706ac 100644
--- a/addons/crm/crm_lead_view.xml
+++ b/addons/crm/crm_lead_view.xml
@@ -341,7 +341,6 @@
|
- [[ formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price') ) ]] [[ o.pricelist_id.currency_id.symbol ]]
+ [[ formatLang(line.price_subtotal, digits=get_digits(dp='Purchase Price'), currency_obj=o.pricelist_id.currency_id ) ]]
|
@@ -339,7 +339,7 @@
Net Total :
|
- [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Purchase Price') ) ]] [[ o.pricelist_id.currency_id. symbol ]]
+ [[ formatLang(o.amount_untaxed, digits=get_digits(dp='Purchase Price'), currency_obj=o.pricelist_id.currency_id ) ]]
|
@@ -352,7 +352,7 @@
Taxes :
|
- [[ formatLang(o.amount_tax, dp='Purchase Price') ]] [[ o.pricelist_id.currency_id. symbol ]]
+ [[ formatLang(o.amount_tax, dp='Purchase Price', currency_obj=o.pricelist_id.currency_id) ]]
|
@@ -365,7 +365,7 @@
Total :
|
- [[ formatLang(o.amount_total, digits=get_digits(dp='Purchase Price') ) ]] [[ o.pricelist_id.currency_id. symbol ]]
+ [[ formatLang(o.amount_total, digits=get_digits(dp='Purchase Price') , currency_obj=o.pricelist_id.currency_id) ]]
|
diff --git a/addons/sale/report/sale_order.rml b/addons/sale/report/sale_order.rml
index 00ebb50472e..a6902f79047 100644
--- a/addons/sale/report/sale_order.rml
+++ b/addons/sale/report/sale_order.rml
@@ -283,7 +283,7 @@
[[ formatLang(line.discount) ]]
- [[ formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price')) ]] [[ o.pricelist_id.currency_id.symbol ]]
+ [[ formatLang(line.price_subtotal, digits=get_digits(dp='Sale Price'), currency_obj=o.pricelist_id.currency_id) ]]
|
@@ -329,7 +329,7 @@
Net Total :
|
- [[ formatLang(o.amount_untaxed, dp='Sale Price') ]] [[ o.pricelist_id.currency_id.symbol ]]
+ [[ formatLang(o.amount_untaxed, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
|
@@ -342,7 +342,7 @@
Taxes :
|
- [[ formatLang(o.amount_tax, dp='Sale Price') ]] [[ o.pricelist_id.currency_id.symbol ]]
+ [[ formatLang(o.amount_tax, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
|
@@ -355,7 +355,7 @@
Total :
|
- [[ formatLang(o.amount_total, dp='Sale Price') ]] [[ o.pricelist_id.currency_id.symbol ]]
+ [[ formatLang(o.amount_total, dp='Sale Price', currency_obj=o.pricelist_id.currency_id) ]]
|
diff --git a/addons/sale/sale.py b/addons/sale/sale.py
index 9c585801ffa..12c27c197ed 100644
--- a/addons/sale/sale.py
+++ b/addons/sale/sale.py
@@ -322,6 +322,16 @@ class sale_order(osv.osv):
self.log(cr, uid, id, message)
return True
+ def onchange_pricelist_id(self, cr, uid, ids, pricelist_id, order_lines, context={}):
+ print order_lines
+ if (not pricelist_id) or (not order_lines):
+ return {}
+ warning = {
+ 'title': _('Pricelist Warning!'),
+ 'message' : _('If you change the pricelist of this order (and eventually the currency), prices of existing order lines will not be updated.')
+ }
+ return {'warning': warning}
+
def onchange_partner_id(self, cr, uid, ids, part):
if not part:
return {'value': {'partner_invoice_id': False, 'partner_shipping_id': False, 'partner_order_id': False, 'payment_term': False, 'fiscal_position': False}}
diff --git a/addons/sale/sale_view.xml b/addons/sale/sale_view.xml
index 51c543279ae..a12a4c566f5 100644
--- a/addons/sale/sale_view.xml
+++ b/addons/sale/sale_view.xml
@@ -112,7 +112,7 @@
-
+
diff --git a/addons/wiki/i18n/hr.po b/addons/wiki/i18n/hr.po
index 749a7f15372..62023e0099d 100644
--- a/addons/wiki/i18n/hr.po
+++ b/addons/wiki/i18n/hr.po
@@ -13,8 +13,8 @@ msgstr ""
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Launchpad-Export-Date: 2011-09-20 04:54+0000\n"
-"X-Generator: Launchpad (build 13980)\n"
+"X-Launchpad-Export-Date: 2011-09-21 04:50+0000\n"
+"X-Generator: Launchpad (build 13996)\n"
#. module: wiki
#: field:wiki.groups,template:0