From 1adf7bbcf6b28616409ebfc34d2ebf4844860a0b Mon Sep 17 00:00:00 2001 From: Chanakya Soni Date: Fri, 6 Aug 2021 15:30:32 +0530 Subject: [PATCH] [14.0][IMP] Added the field 'color' to partner_id_category. --- partner_identification/models/res_partner_id_category.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/partner_identification/models/res_partner_id_category.py b/partner_identification/models/res_partner_id_category.py index 5ea2d3190..999cc6063 100644 --- a/partner_identification/models/res_partner_id_category.py +++ b/partner_identification/models/res_partner_id_category.py @@ -8,6 +8,8 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +from random import randint + from odoo import _, fields, models from odoo.exceptions import UserError, ValidationError from odoo.tools.safe_eval import safe_eval @@ -18,6 +20,10 @@ class ResPartnerIdCategory(models.Model): _description = "Partner ID Category" _order = "name" + def _get_default_color(self): + return randint(1, 11) + + color = fields.Integer(string="Color Index", default=_get_default_color) code = fields.Char( string="Code", size=16,