Browse Source

[FIX] fix flagging cooperator on share transfer

pull/80/head
houssine 5 years ago
parent
commit
0e067d40e1
  1. 8
      easy_my_coop/models/operation_request.py

8
easy_my_coop/models/operation_request.py

@ -285,7 +285,9 @@ class operation_request(models.Model):
partner = self.subscription_request.create_coop_partner()
# get cooperator number
sub_reg_num = int(sequence_id.next_by_id())
partner_vals = sub_request.get_eater_vals(partner, self.share_product_id)
partner_vals.update(sub_request.get_eater_vals(
partner,
self.share_product_id))
partner_vals['cooperator_register_number'] = sub_reg_num
partner.write(partner_vals)
self.partner_id_to = partner
@ -295,9 +297,9 @@ class operation_request(models.Model):
if self.partner_id_to.cooperator_register_number == 0:
sub_reg_num = int(sequence_id.next_by_id())
partner_vals['cooperator_register_number'] = sub_reg_num
partner_vals = sub_request.get_eater_vals(
partner_vals.replace(sub_request.get_eater_vals(
self.partner_id_to,
self.share_product_id)
self.share_product_id))
partner_vals['old_member'] = False
self.partner_id_to.write(partner_vals)
# remove the parts to the giver

Loading…
Cancel
Save