From 6c9d34045f1890b2a7b04c9f10c1ee1bd2106e64 Mon Sep 17 00:00:00 2001 From: Alexandre Fayolle Date: Thu, 7 Dec 2023 12:06:40 +0100 Subject: [PATCH] [MIG] partner_address_street3: Migration to 17.0 --- partner_address_street3/__manifest__.py | 3 +-- partner_address_street3/hooks.py | 10 +++++----- partner_address_street3/views/res_partner.xml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/partner_address_street3/__manifest__.py b/partner_address_street3/__manifest__.py index 6669f6ba9089..0778c76f2bff 100644 --- a/partner_address_street3/__manifest__.py +++ b/partner_address_street3/__manifest__.py @@ -6,11 +6,10 @@ "name": "Street3 in addresses", "summary": "Add a third address line on partners", "license": "AGPL-3", - "version": "16.0.1.0.0", + "version": "17.0.1.0.0", "author": "Camptocamp,Odoo Community Association (OCA)", "maintainer": "Camptocamp", "category": "Sales", - "depends": ["base_view_inheritance_extension"], "website": "https://github.com/OCA/partner-contact", "data": ["views/res_partner.xml"], "post_init_hook": "post_init_hook", diff --git a/partner_address_street3/hooks.py b/partner_address_street3/hooks.py index 35913b240bf2..0b66e4db8a3b 100644 --- a/partner_address_street3/hooks.py +++ b/partner_address_street3/hooks.py @@ -2,7 +2,7 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -def post_init_hook(cr, registry): +def post_init_hook(env): """Add street3 to address format""" query = """ UPDATE res_country @@ -12,10 +12,10 @@ def post_init_hook(cr, registry): E'%(street2)s\n%(street3)s\n' ) """ - cr.execute(query) + env.cr.execute(query) -def uninstall_hook(cr, registry): +def uninstall_hook(env): """Remove street3 from address format""" # Remove %(street3)s\n from address_format query = """ @@ -26,7 +26,7 @@ def uninstall_hook(cr, registry): '' ) """ - cr.execute(query) + env.cr.execute(query) # Remove %(street3)s from address_format query = """ @@ -37,4 +37,4 @@ def uninstall_hook(cr, registry): '' ) """ - cr.execute(query) + env.cr.execute(query) diff --git a/partner_address_street3/views/res_partner.xml b/partner_address_street3/views/res_partner.xml index 92627b7f1084..c26e46b37bbe 100644 --- a/partner_address_street3/views/res_partner.xml +++ b/partner_address_street3/views/res_partner.xml @@ -13,7 +13,7 @@ name="street3" placeholder="Street 3..." class="o_address_street" - attrs="{'readonly': [('type', '=', 'contact'),('parent_id', '!=', False)]}" + readonly="type == 'contact' and parent_id != False" />