From 0fea077bd4c39e819730fb7c8e12219bc22fe3cb Mon Sep 17 00:00:00 2001 From: AjmalCybro Date: Wed, 26 Jul 2023 11:04:17 +0530 Subject: [PATCH] Jul 25 : [UPDT] Updated 'insurance_management_cybro' --- insurance_management_cybro/__manifest__.py | 2 +- insurance_management_cybro/models/insurance_details.py | 10 ++++++++++ .../views/insurance_details_views.xml | 1 + 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/insurance_management_cybro/__manifest__.py b/insurance_management_cybro/__manifest__.py index 4de9cf307..3f2a3e0cc 100755 --- a/insurance_management_cybro/__manifest__.py +++ b/insurance_management_cybro/__manifest__.py @@ -22,7 +22,7 @@ { 'name': 'Insurance Management', - 'version': '16.0.1.0.0', + 'version': '16.0.1.1.1', 'summary': """Insurance Management & Operations""", 'description': """Insurance Management""", 'author': 'Cybrosys Techno Solutions', diff --git a/insurance_management_cybro/models/insurance_details.py b/insurance_management_cybro/models/insurance_details.py index bfdd3c11a..162f2d829 100755 --- a/insurance_management_cybro/models/insurance_details.py +++ b/insurance_management_cybro/models/insurance_details.py @@ -51,6 +51,10 @@ class InsuranceDetails(models.Model): required=True, default='draft') hide_inv_button = fields.Boolean(copy=False) note_field = fields.Html(string='Comment') + policy_number = fields.Integer(string="Policy Number", required=True, + help="Policy number is a unique number that" + "an insurance company uses to identify" + "you as a policyholder") @api.constrains('commission_rate') def _check_commission_rate(self): @@ -60,6 +64,12 @@ class InsuranceDetails(models.Model): raise ValidationError( _('Commission Percentage should be between 1-100')) + @api.constrains('policy_number') + def _check_policy_number(self): + if not self.policy_number: + raise ValidationError( + _('Please add the policy number')) + def action_confirm_insurance(self): if self.amount > 0: self.state = 'confirmed' diff --git a/insurance_management_cybro/views/insurance_details_views.xml b/insurance_management_cybro/views/insurance_details_views.xml index d101ed024..d39d35680 100755 --- a/insurance_management_cybro/views/insurance_details_views.xml +++ b/insurance_management_cybro/views/insurance_details_views.xml @@ -25,6 +25,7 @@ +