b1f1f216d09e8d7ac42ad91ad5694b1eb3bdf68c
At present the user can select an option in the settings to check VAT numbers against the VIES system. If the VAT number fails this validation the result is a non-blocking banner message that informs the user that the VIES validation has failed, but has no further ramifications (the user can still use an unrecognised VAT number). This non-blocking functionality is still desirable, however we wish to determine the validity of certain fiscal positions based on whether the VIES VAT check is valid. In order to acheive this, the computed boolean `vies_valid` field is added, and populated based on the results when comparing the VAT against the VIES system. It depends on the `vat` and `country_id` of the partner. If it looks like the VIES check needs to be performed on this vat and if any company in the db requires a VIES vat check, the check is performed, and if none do, then check is not performed. The field can be manually edited, but is also tracked. Provided we know whether a partner has a valid VIES vat or not, it is only important sometimes in trying to find the appropriate fiscal position (because VIES is only confirms validity of a VAT number for intra-community trade). Because of this, a computed boolean field called `perform_vies_validation` is added to represent this on the partner. For example if a partner is from the same country as the current company, then it doesn't matter that it's VIES valid or not, all that matters is that there is some string in its vat field for the "VAT Required" to be satsified, so the `perform_vies_validation` field would be False. This field is also used to determine whether the `vies_valid` checkbox should be shown or hidden on the partner form view. A hook called _get_vat_valid is placed in the method on fiscal position that retrieves the appropriate fiscal position for a given account move, and it is overridden by a function in base_vat, which specifies whether the partner/delivery address matches the 'vat_required' condition when VIES validity is relevant for the company/partner (see the above `perform_vies_validation` field). `sale_stock` and `test_mail` performance tests are updated in order to account for the additional queries introduced in the _get_vat_required hook (in fetching the base.europe country ids) and the _compute_vies_valid respectively. closes odoo/odoo#116391 Task-id: 3218194 Related: odoo/upgrade#4498 Signed-off-by: William André (wan) <wan@odoo.com>
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%