Browse Source

Merge pull request #79 from coopiteasy/9.0-emc-fix-transfer-pp-pm

Check share to_company and to_individual on transfer
pull/86/head
Manuel Claeys Bouuaert 4 years ago
committed by GitHub
parent
commit
0173332902
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      easy_my_coop/models/operation_request.py

8
easy_my_coop/models/operation_request.py

@ -200,6 +200,14 @@ class operation_request(models.Model):
raise ValidationError(_("This share type could not be"
" transfered to " +
self.partner_id_to.name))
if self.partner_id_to.is_company \
and not self.share_product_id.by_company:
raise ValidationError(_("This share can not be"
" subscribed by a company"))
if not self.partner_id_to.is_company \
and not self.share_product_id.by_individual:
raise ValidationError(_("This share can not be"
" subscribed an individual"))
if self.receiver_not_member and self.subscription_request \
and not self.subscription_request.validated:
raise ValidationError(_("The information of the receiver"

Loading…
Cancel
Save