Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Arthur Emynon
Odoo customer relationship management
Commits
a2c255b3
Commit
a2c255b3
authored
Jan 13, 2022
by
Arthur Emynon
Browse files
style: Address styles are better now + Added styles for address copy buttons
parent
372d6bea
Changes
4
Hide whitespace changes
Inline
Side-by-side
__manifest__.py
View file @
a2c255b3
...
...
@@ -21,6 +21,7 @@
'assets'
:
{
'web.assets_backend'
:
[
'customer_relationship/static/scss/address.scss'
,
'customer_relationship/static/scss/copy_button.scss'
,
]
}
}
static/scss/address.scss
View file @
a2c255b3
...
...
@@ -5,26 +5,31 @@
// TODO: Is the default behaviour of o_address_department OK without o_city_zip_department?
&
.o_city_zip_department
{
.o_address_city
{
clear
:
left
;
margin-right
:
2%
;
margin-right
:
1em
;
}
.o_address_zip
{
margin-right
:
2%
;
margin-right
:
1
.5em
;
}
.o_address_department
{
clear
:
right
;
margin-right
:
0
;
display
:
inline
;
&
::after
{
content
:
"\A"
;
white-space
:
pre
;
}
}
}
&
.o_state_country
{
.o_address_state
{
clear
:
left
;
margin-right
:
2%
;
margin-right
:
1
.5em
;
}
.o_address_country
{
display
:
inline
;
clear
:
right
;
margin-right
:
0
;
&
::after
{
content
:
"\A"
;
white-space
:
pre
;
}
}
}
}
...
...
@@ -34,20 +39,33 @@
&
.o_city_zip_department
{
.o_address_city
{
width
:
40%
;
margin-right
:
2%
;
}
.o_address_zip
{
width
:
18%
;
margin-right
:
2%
;
}
.o_address_department
{
display
:
inline-block
;
width
:
38%
;
margin-right
:
0
;
&
::after
{
content
:
""
;
}
}
}
&
.o_state_country
{
.o_address_state
{
width
:
60%
;
margin-right
:
2%
;
}
.o_address_country
{
display
:
inline-block
;
width
:
38%
;
margin-right
:
0
;
&
::after
{
content
:
""
;
}
}
}
}
...
...
static/scss/copy_button.scss
0 → 100644
View file @
a2c255b3
.o_form_view
{
.copiable_address
{
.copiable_field
{
}
.copy_button
{
display
:
none
;
}
}
&
.o_form_editable
.copiable_address
{
.copiable_field
{
width
:
60%
;
}
.copy_button
{
display
:
inline-block
;
border
:
1px
solid
;
float
:
right
;
}
}
}
views/site_views.xml
View file @
a2c255b3
...
...
@@ -27,17 +27,19 @@
<field
name=
"warning_messages"
nolabel=
"1"
/>
</div>
<group
string=
"Contact et Adresse"
>
<group
col=
"1"
>
<group
name=
"partner"
col=
"3"
>
<field
name=
"partner_id"
/>
<button
string=
"Copier adresse"
class=
"oe_edit_only"
<group
name=
"partner_contact"
>
<label
for=
"partner_id"
/>
<div
name=
"partner"
class=
"copiable_address"
>
<field
name=
"partner_id"
class=
"copiable_field"
/>
<button
string=
"Copier adresse"
class=
"copy_button"
name=
"action_copy_address_from_partner"
type=
"object"
/>
</group>
<group
name=
"partner"
col=
"3"
>
<field
name=
"contact_id"
/>
<button
string=
"Copier adresse"
class=
"oe_edit_only"
</div>
<label
for=
"contact_id"
/>
<div
name=
"contact"
class=
"copiable_address"
>
<field
name=
"contact_id"
class=
"copiable_field"
/>
<button
string=
"Copier adresse"
class=
"copy_button"
name=
"action_copy_address_from_contact"
type=
"object"
/>
</
group
>
</
div
>
</group>
<group>
<label
for=
"street"
string=
"Adresse"
/>
...
...
@@ -47,13 +49,13 @@
<field
name=
"city"
placeholder=
"Ville"
class=
"o_address_city"
/>
<field
name=
"zip"
placeholder=
"Code postal"
class=
"o_address_zip"
/>
<field
name=
"department_id"
placeholder=
"Département"
class=
"o_address_department"
options=
"{'no_
quick_
create': True}"
options=
"{'no_create
': True, 'no_open
': True}"
context=
"{'state_id': state_id, 'country_id': country_id}"
/>
<field
name=
"state_id"
placeholder=
"Région"
class=
"o_address_state"
options=
"{'no_
quick_
create': True}"
options=
"{'no_create
': True, 'no_open
': True}"
context=
"{'country_id': country_id}"
/>
<field
name=
"country_id"
placeholder=
"Pays"
class=
"o_address_country"
options=
"{'no_
quick_
create': True}"
/>
options=
"{'no_create
': True, 'no_open
': True}"
/>
</div>
</group>
</group>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment