From b388cf4cb790e41ad26dcf4b2e17766865effec6 Mon Sep 17 00:00:00 2001 From: Jon Zaballa Date: Thu, 27 Dec 2018 12:46:44 +0100 Subject: [PATCH] [FIX] 11.0 partner_second_last_name required only if type = contact Description of the issue/feature this PR addresses: firstname, lastname and lastname2 fields should only be required if contact `type` is `contact`. In partner_firstname module this is done right with `('type', '=', 'contact')` leave in attrs required domain. But in partner_second_last_name there is no such leave, so if the contact is an address, the fields are mandatory too. Current behavior: Either firstname, lastname or lastname2 are mandatory when a contact is not a company. Desired behavior after PR is merged: firstname, lastname or lastname2 are mandatory when the contact is of type `contact` --- partner_second_lastname/views/res_partner.xml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/partner_second_lastname/views/res_partner.xml b/partner_second_lastname/views/res_partner.xml index 5b9cc554d..1ee6fe9f4 100644 --- a/partner_second_lastname/views/res_partner.xml +++ b/partner_second_lastname/views/res_partner.xml @@ -9,13 +9,13 @@ - {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - + @@ -28,24 +28,24 @@ - {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - + - {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('lastname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False)]} + {'required': [('firstname', '=', False), ('lastname2', '=', False), ('is_company', '=', False), ('type', '=', 'contact')]} - +