Browse Source

[IMP] raise error for an unimplemented case for shares conversion

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

9
easy_my_coop/models/operation_request.py

@ -173,15 +173,18 @@ class operation_request(models.Model):
raise ValidationError(_("The cooperator can't hand over more" raise ValidationError(_("The cooperator can't hand over more"
" shares that he/she owns.")) " shares that he/she owns."))
if self.operation_type == 'convert' and \
self.company_id.unmix_share_type:
if self.operation_type == 'convert':
if self.company_id.unmix_share_type:
if self.share_product_id.code == self.share_to_product_id.code: if self.share_product_id.code == self.share_to_product_id.code:
raise ValidationError(_("You can't convert the share to" raise ValidationError(_("You can't convert the share to"
" the same share type.")) " the same share type."))
if self.subscription_amount != self.partner_id.total_value: if self.subscription_amount != self.partner_id.total_value:
raise ValidationError(_("You must convert all the shares" raise ValidationError(_("You must convert all the shares"
" to the selected type.")) " to the selected type."))
else:
if self.subscription_amount != self.partner_id.total_value:
raise ValidationError(_("Converting just part of the"
" shares is not yet implemented"))
elif self.operation_type == 'transfer': elif self.operation_type == 'transfer':
if not self.receiver_not_member and self.company_id.unmix_share_type \ if not self.receiver_not_member and self.company_id.unmix_share_type \
and (self.partner_id_to.cooperator_type and (self.partner_id_to.cooperator_type

Loading…
Cancel
Save