From 58ba7669e8a62628496491bc504d03ee808af6a4 Mon Sep 17 00:00:00 2001 From: rpinset <12782314+rpinset@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:12:54 +0200 Subject: [PATCH 1/3] [FIX] bug "create and edit" from invoice and sale order --- partner_firstname/models/res_partner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/partner_firstname/models/res_partner.py b/partner_firstname/models/res_partner.py index 67824a23ce2..2187e0dabac 100644 --- a/partner_firstname/models/res_partner.py +++ b/partner_firstname/models/res_partner.py @@ -110,7 +110,7 @@ def copy(self, default=None): @api.model def default_get(self, fields_list): """Invert name when getting default values.""" - if "firstname" in fields_list or "lastname" in fields_list: + if ("firstname" in fields_list or "lastname" in fields_list) and "name" not in fields_list: fields_list.append("name") result = super().default_get(fields_list) From b4d5d867469cc3f05d2560aaf94312aea236a653 Mon Sep 17 00:00:00 2001 From: rpinset <12782314+rpinset@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:36:13 +0200 Subject: [PATCH 2/3] Update res_partner.py --- partner_firstname/models/res_partner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/partner_firstname/models/res_partner.py b/partner_firstname/models/res_partner.py index 2187e0dabac..1222b3c4786 100644 --- a/partner_firstname/models/res_partner.py +++ b/partner_firstname/models/res_partner.py @@ -110,7 +110,9 @@ def copy(self, default=None): @api.model def default_get(self, fields_list): """Invert name when getting default values.""" - if ("firstname" in fields_list or "lastname" in fields_list) and "name" not in fields_list: + if ( + "firstname" in fields_list or "lastname" in fields_list + ) and "name" not in fields_list: fields_list.append("name") result = super().default_get(fields_list) From ca4cc934e7c6bd71108e9d39eacaa38e09c64d23 Mon Sep 17 00:00:00 2001 From: rpinset <12782314+rpinset@users.noreply.github.com> Date: Fri, 28 Jun 2024 00:12:54 +0200 Subject: [PATCH 3/3] [FIX] bug "create and edit" from invoice and sale order --- partner_firstname/models/res_partner.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/partner_firstname/models/res_partner.py b/partner_firstname/models/res_partner.py index 67824a23ce2..1222b3c4786 100644 --- a/partner_firstname/models/res_partner.py +++ b/partner_firstname/models/res_partner.py @@ -110,7 +110,9 @@ def copy(self, default=None): @api.model def default_get(self, fields_list): """Invert name when getting default values.""" - if "firstname" in fields_list or "lastname" in fields_list: + if ( + "firstname" in fields_list or "lastname" in fields_list + ) and "name" not in fields_list: fields_list.append("name") result = super().default_get(fields_list)