forked from OCA/edi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hooks.py
22 lines (17 loc) · 844 Bytes
/
hooks.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright 2018 Akretion (http://www.akretion.com)
# @author: Alexis de Lattre <[email protected]>
# Copyright 2019 Onestein (<https://www.onestein.eu>)
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo import SUPERUSER_ID, api
def set_xml_format_in_pdf_invoice_to_ubl(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
companies = env["res.company"].search([])
companies.write({"xml_format_in_pdf_invoice": "ubl"})
def remove_ubl_xml_format_in_pdf_invoice(cr, registry):
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
companies = env["res.company"].search(
[("xml_format_in_pdf_invoice", "=", "ubl")]
)
companies.write({"xml_format_in_pdf_invoice": "none"})