From 9715fc48933095ff7fa5c5c85dcf7c10a7ecd82b Mon Sep 17 00:00:00 2001 From: Darko Nikolovski Date: Tue, 24 Nov 2015 15:03:58 +0100 Subject: [PATCH 1/3] [ADD] res.partner: Porting partner_street_number to 9.0 --- partner_street_number/__openerp__.py | 3 +- .../static/src/css/field.css | 11 ++++ partner_street_number/views/assets.xml | 12 +++++ partner_street_number/views/res_partner.xml | 53 ++++++++++++------- 4 files changed, 60 insertions(+), 19 deletions(-) create mode 100644 partner_street_number/static/src/css/field.css create mode 100644 partner_street_number/views/assets.xml diff --git a/partner_street_number/__openerp__.py b/partner_street_number/__openerp__.py index e6fdebe85..a18a95be4 100644 --- a/partner_street_number/__openerp__.py +++ b/partner_street_number/__openerp__.py @@ -30,8 +30,9 @@ ], "data": [ 'views/res_partner.xml', + 'views/assets.xml', ], - 'installable': False, + 'installable': True, 'license': 'AGPL-3', 'post_init_hook': 'post_init_hook', } diff --git a/partner_street_number/static/src/css/field.css b/partner_street_number/static/src/css/field.css new file mode 100644 index 000000000..910918673 --- /dev/null +++ b/partner_street_number/static/src/css/field.css @@ -0,0 +1,11 @@ +.o_address_street_name { + float: left !important; + margin-right: 2% !important; + width: 75% !important; + } + +.o_address_street_number { + margin-right: 0% !important; + width: 25% !important; + } + \ No newline at end of file diff --git a/partner_street_number/views/assets.xml b/partner_street_number/views/assets.xml new file mode 100644 index 000000000..f4b0f49e9 --- /dev/null +++ b/partner_street_number/views/assets.xml @@ -0,0 +1,12 @@ + + + + + + + + diff --git a/partner_street_number/views/res_partner.xml b/partner_street_number/views/res_partner.xml index 148b0f8c6..784b87a25 100644 --- a/partner_street_number/views/res_partner.xml +++ b/partner_street_number/views/res_partner.xml @@ -7,46 +7,63 @@ res.partner - - -
- - -
- 1 - -
- - -
- 1 - {'default_parent_id': active_id, 'default_street_name': street_name, 'default_street_number': street_number, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer, 'default_use_parent_address': True} + {'default_parent_id': active_id, 'default_street_name': street_name, 'default_street_number': street_number, 'default_street2': street2, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_supplier': supplier, 'default_customer': customer}
+ + + Add separate fields for street name and number in address form + res.partner + + + + + + + + 1 + + + + From a1392bc7148f88557a1b645b2934f732d8d61d14 Mon Sep 17 00:00:00 2001 From: Darko Nikolovski Date: Wed, 15 Mar 2017 16:03:49 +0100 Subject: [PATCH 2/3] partner_street_number: Add 'web' module as dependency --- partner_street_number/__openerp__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/partner_street_number/__openerp__.py b/partner_street_number/__openerp__.py index a18a95be4..2db5f5522 100644 --- a/partner_street_number/__openerp__.py +++ b/partner_street_number/__openerp__.py @@ -21,12 +21,12 @@ { "name": "Street name and number", "summary": "Introduces separate fields for street name and street number.", - "version": "8.0.0.1.0", + "version": "9.0.0.1.0", "author": "Therp BV,Odoo Community Association (OCA)", "website": "https://github.com/oca/partner-contact", "category": 'Tools', "depends": [ - 'base' + 'web', ], "data": [ 'views/res_partner.xml', From 4910be333f9df7b013f71ef2d0b9b2279ae4cbfa Mon Sep 17 00:00:00 2001 From: Darko Nikolovski Date: Wed, 15 Mar 2017 16:13:04 +0100 Subject: [PATCH 3/3] partner_street_number: PEP8 corrections --- partner_street_number/__init__.py | 2 +- partner_street_number/__openerp__.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/partner_street_number/__init__.py b/partner_street_number/__init__.py index 55fd67147..40481b593 100644 --- a/partner_street_number/__init__.py +++ b/partner_street_number/__init__.py @@ -36,7 +36,7 @@ def post_init_hook(cr, registry): cr.execute( 'SELECT id, street FROM res_partner ' 'WHERE street IS NOT NULL and street_name IS NULL' - ) + ) partner_obj = registry['res.partner'] for partner in cr.fetchall(): partner_obj.write( diff --git a/partner_street_number/__openerp__.py b/partner_street_number/__openerp__.py index 2db5f5522..29afbc3bc 100644 --- a/partner_street_number/__openerp__.py +++ b/partner_street_number/__openerp__.py @@ -27,11 +27,11 @@ "category": 'Tools', "depends": [ 'web', - ], + ], "data": [ 'views/res_partner.xml', 'views/assets.xml', - ], + ], 'installable': True, 'license': 'AGPL-3', 'post_init_hook': 'post_init_hook',