2
0
account-financial-tools/base_vat_optional_vies/models/res_config_settings.py

22 lines
747 B
Python
Raw Normal View History

# Copyright 2022-2023 Moduon Team S.L. <info@moduon.team>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
def execute_update_check_vies(self):
# Only parent partners, children are synced from parent
count_partners = self.env["res.partner"].search_count([])
self.env["res.partner"].search([]).check_vat()
return {
"effect": {
"fadeout": "slow",
"message": _("Vies passed calculated in %s partners") % count_partners,
"img_url": "/web/static/img/smile.svg",
"type": "rainbow_man",
}
}