SHARE
TWEET

Untitled

a guest Jun 18th, 2019 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @api.onchange('partner_id')
  2. def get_foyer(self):
  3.     if self.partner_id:
  4.         actually_partner_id = self.partner_id.name
  5.         if actually_partner_id:
  6.             records_foyer_id = self.env['horanet.relation.foyer'].search([('partner_id', '=', actually_partner_id)],
  7.                                                                          order="id desc")
  8.             for rec in records_foyer_id:
  9.                 self.foyer_id = rec.id
  10.  
  11. @api.onchange('foyer_id')
  12. def get_responsibles_members_foyer(self):
  13.     if self.foyer_id:
  14.         actually_foyer = self.foyer_id.foyer_id
  15.         if actually_foyer:
  16.             domain = [('foyer_id', '=', actually_foyer.id)]
  17.             records_foyer_id = self.env['horanet.relation.foyer'].search(domain)
  18.             for rec in records_foyer_id:
  19.                 print " " + rec.partner_id.name
  20.                 if rec.partner_id:
  21.                     domain_partner = [('foyer_id', '=', self.foyer_id.foyer_id.id),
  22.                                       ('is_responsible', '=', True)]
  23.                     records_partner_id = self.env['horanet.relation.foyer'].search(domain_partner)
  24.                     for rec_partner in records_partner_id:
  25.                         if rec_partner.partner_id:
  26.                             self.school_responsible_partner1 = rec_partner.partner_id.id
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top