Browse Source

[IMP] check the subscription before validating a transfer

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

9
easy_my_coop/models/operation_request.py

@ -176,13 +176,20 @@ class operation_request(models.Model):
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."))
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
and self.partner_id.cooperator_type != self.partner_id_to.cooperator_type): and self.partner_id.cooperator_type != self.partner_id_to.cooperator_type):
raise ValidationError(_("This share type could not be" raise ValidationError(_("This share type could not be"
" transfered to " + " transfered to " +
self.partner_id_to.name)) self.partner_id_to.name))
if self.receiver_not_member and self.subscription_request \
and not self.subscription_request.validated:
raise ValidationError(_("The information of the receiver"
" are not correct. Please correct"
" the information before"
" submitting"))
@api.multi @api.multi
def execute_operation(self): def execute_operation(self):

Loading…
Cancel
Save