Browse Source

[IMP] add check in validate function

pull/6/head
houssine 6 years ago
parent
commit
53aca0ee6e
  1. 7
      easy_my_coop/models/operation_request.py

7
easy_my_coop/models/operation_request.py

@ -175,6 +175,13 @@ class operation_request(models.Model):
" shares that he/she owns."))
if self.operation_type == 'convert':
amount_to_convert = self.share_unit_price * self.quantity
share_price = self.share_to_product_id.list_price
remainder = amount_to_convert % share_price
if remainder != 0:
raise ValidationError(_("The conversion must give a whole"
" number for quantity"))
if self.company_id.unmix_share_type:
if self.share_product_id.code == self.share_to_product_id.code:
raise ValidationError(_("You can't convert the share to"

Loading…
Cancel
Save