Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //I need to store the current id that is self.beneficiary_id and id that is passed from ui that is retained_id
- //and the record of current id in the many2many field 'merged_beneficiaries_ids' and show the address of the current id in the
- //UI. I am asking about the synatax to store in this many2many field eg.self.write()?
- @api.multi
- def merge_beneficiaries(self):
- idr = self.retained_id
- print(idr)
- beneficiary_data = self.env['openg2p.beneficiary'].browse(idr)
- print(beneficiary_data)
- beneficiary_data.write(
- {'first_name': str(self.firstname),
- 'last_name': str(self.firstname),
- 'email': str(self.firstname),
- 'phone': str(self.phone),
- 'street': str(self.street),
- 'street2': str(self.street),
- 'city': str(self.city),
- 'postal_code': str(self.zip),
- 'identity': str(self.identity_passport),
- 'emergency_contact_name': str(self.emergency_contact),
- 'emergency_contact_phone': str(self.emergency_phone)})
- delete_url = "http://localhost:8080/index/"+str(idr)
- r = requests.post(delete_url)
- print(r)
- self.clear_beneficiaries()
- self.retained_id = 0
Advertisement
Add Comment
Please, Sign In to add comment