Skip to content

Commit b9e3ab7

Browse files
committed
[MIG] partner_second_lastname: Migration to 14.0
1 parent 5b60130 commit b9e3ab7

File tree

4 files changed

+37
-27
lines changed

4 files changed

+37
-27
lines changed

partner_second_lastname/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
{
77
"name": "Partner second last name",
88
"summary": "Have split first and second lastnames",
9-
"version": "13.0.2.0.0",
9+
"version": "14.0.1.0.0",
1010
"license": "AGPL-3",
1111
"website": "https://github.com/OCA/partner-contact",
1212
"author": "Tecnativa, " "Odoo Community Association (OCA)",

partner_second_lastname/models/res_partner.py

+6-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ class ResPartner(models.Model):
1313

1414
_inherit = "res.partner"
1515

16-
lastname2 = fields.Char("Second last name",)
16+
lastname2 = fields.Char(
17+
"Second last name",
18+
)
1719

1820
@api.model
1921
def _get_computed_name(self, lastname, firstname, lastname2=None):
@@ -47,7 +49,9 @@ def _compute_name(self):
4749
"""Write :attr:`~.name` according to splitted data."""
4850
for partner in self:
4951
partner.name = self._get_computed_name(
50-
partner.lastname, partner.firstname, partner.lastname2,
52+
partner.lastname,
53+
partner.firstname,
54+
partner.lastname2,
5155
)
5256

5357
def _inverse_name(self):

partner_second_lastname/views/res_partner.xml

+24-18
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,16 @@
1111
/>
1212
<field name="arch" type="xml">
1313
<field name="firstname" position="attributes">
14-
<attribute
15-
name="attrs"
16-
>{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
14+
<attribute name="attrs">
15+
{'required': [('lastname', '=', False), ('lastname2', '=', False),
16+
('is_company', '=', False), ('type', '=', 'contact')]}
17+
</attribute>
1718
</field>
1819
<field name="lastname" position="attributes">
19-
<attribute
20-
name="attrs"
21-
>{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
20+
<attribute name="attrs">
21+
{'required': [('firstname', '=', False), ('lastname2', '=', False),
22+
('is_company', '=', False), ('type', '=', 'contact')]}
23+
</attribute>
2224
</field>
2325
<field name="lastname" position="after">
2426
<field
@@ -34,14 +36,16 @@
3436
<field name="arch" type="xml">
3537
<!-- Main form -->
3638
<field name="firstname" position="attributes">
37-
<attribute
38-
name="attrs"
39-
>{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
39+
<attribute name="attrs">
40+
{'required': [('lastname', '=', False), ('lastname2', '=', False),
41+
('is_company', '=', False), ('type', '=', 'contact')]}
42+
</attribute>
4043
</field>
4144
<field name="lastname" position="attributes">
42-
<attribute
43-
name="attrs"
44-
>{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
45+
<attribute name="attrs">
46+
{'required': [('firstname', '=', False), ('lastname2', '=', False),
47+
('is_company', '=', False), ('type', '=', 'contact')]}
48+
</attribute>
4549
</field>
4650
<field name="lastname" position="after">
4751
<field
@@ -54,17 +58,19 @@
5458
expr="//field[@name='child_ids']/form//field[@name='firstname']"
5559
position="attributes"
5660
>
57-
<attribute
58-
name="attrs"
59-
>{'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
61+
<attribute name="attrs">
62+
{'required': [('lastname', '=', False), ('lastname2', '=', False),
63+
('is_company', '=', False), ('type', '=', 'contact')]}
64+
</attribute>
6065
</xpath>
6166
<xpath
6267
expr="//field[@name='child_ids']/form//field[@name='lastname']"
6368
position="attributes"
6469
>
65-
<attribute
66-
name="attrs"
67-
>{'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]}</attribute>
70+
<attribute name="attrs">
71+
{'required': [('firstname', '=', False), ('lastname2', '=', False),
72+
('is_company', '=', False), ('type', '=', 'contact')]}
73+
</attribute>
6874
</xpath>
6975
<xpath
7076
expr="//field[@name='child_ids']/form//field[@name='lastname']"

partner_second_lastname/views/res_user.xml

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
<field name="inherit_id" ref="partner_firstname.view_users_form" />
1010
<field name="arch" type="xml">
1111
<field name="firstname" position="attributes">
12-
<attribute
13-
name="attrs"
14-
>{'required': [('lastname', '=', False), ('lastname2', '=', False)]}</attribute>
12+
<attribute name="attrs">
13+
{'required': [('lastname', '=', False), ('lastname2', '=', False)]}
14+
</attribute>
1515
</field>
1616
<field name="lastname" position="attributes">
17-
<attribute
18-
name="attrs"
19-
>{'required': [('firstname', '=', False), ('lastname2', '=', False)]}</attribute>
17+
<attribute name="attrs">
18+
{'required': [('firstname', '=', False), ('lastname2', '=', False)]}
19+
</attribute>
2020
</field>
2121
<field name="lastname" position="after">
2222
<field

0 commit comments

Comments
 (0)