Browse Source

Merge PR #1127 into 14.0

Signed-off-by NL66278
14.0
OCA-git-bot 3 years ago
parent
commit
e96789a327
  1. 6
      partner_identification/models/res_partner_id_category.py

6
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). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from random import randint
from odoo import _, fields, models from odoo import _, fields, models
from odoo.exceptions import UserError, ValidationError from odoo.exceptions import UserError, ValidationError
from odoo.tools.safe_eval import safe_eval from odoo.tools.safe_eval import safe_eval
@ -18,6 +20,10 @@ class ResPartnerIdCategory(models.Model):
_description = "Partner ID Category" _description = "Partner ID Category"
_order = "name" _order = "name"
def _get_default_color(self):
return randint(1, 11)
color = fields.Integer(string="Color Index", default=_get_default_color)
code = fields.Char( code = fields.Char(
string="Code", string="Code",
size=16, size=16,

Loading…
Cancel
Save