Skip to content

Commit

Permalink
[MIG] partner_address_street3: Migration to 17.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gurneyalex committed Dec 7, 2023
1 parent 2307764 commit 6c9d340
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions partner_address_street3/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
10 changes: 5 additions & 5 deletions partner_address_street3/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 = """
Expand All @@ -26,7 +26,7 @@ def uninstall_hook(cr, registry):
''
)
"""
cr.execute(query)
env.cr.execute(query)

# Remove %(street3)s from address_format
query = """
Expand All @@ -37,4 +37,4 @@ def uninstall_hook(cr, registry):
''
)
"""
cr.execute(query)
env.cr.execute(query)
2 changes: 1 addition & 1 deletion partner_address_street3/views/res_partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
/>
</xpath>
<xpath
Expand Down

0 comments on commit 6c9d340

Please sign in to comment.