intrastat_base: Brexit

intrastat = False on UK, with update via mig script
This commit is contained in:
Alexis de Lattre
2021-01-23 00:55:25 +01:00
parent fa6963a307
commit 1e51c8279e
3 changed files with 20 additions and 2 deletions

View File

@@ -4,7 +4,7 @@
{
'name': 'Intrastat Reporting Base',
'version': '10.0.1.1.0',
'version': '10.0.1.2.0',
'category': 'Intrastat',
'license': 'AGPL-3',
'summary': 'Base module for Intrastat reporting',

View File

@@ -65,7 +65,7 @@
<field name="intrastat" eval="True"/>
</record>
<record id="base.uk" model="res.country">
<field name="intrastat" eval="True"/>
<field name="intrastat" eval="False"/> <!-- Brexit means Brexit! -->
</record>
<record id="base.si" model="res.country">
<field name="intrastat" eval="True"/>

View File

@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
# Copyright 2021 Akretion France (http://www.akretion.com/)
# @author: Alexis de Lattre <alexis.delattre@akretion.com>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, SUPERUSER_ID
def migrate(cr, version):
if not version:
return
with api.Environment.manage():
env = api.Environment(cr, SUPERUSER_ID, {})
uk_country = env.ref('base.uk')
# Brexit... bye bye, we'll miss you guys!
if uk_country.intrastat:
uk_country.write({'intrastat': False})