Advertisement
rht_odoo

[QW][4031666] Contacts

Jul 18th, 2024 (edited)
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. # Done by RHT on the xx/07/2024
  2. # Reviewed by xxx on the xx/07/2024
  3. # Review: https://pastebin.com/wVuqYQMB
  4. # Need: Get the contacts that are relevant to this BANDI
  5. # Task: https://www.odoo.com/odoo/project.task/4031666?cids=1
  6.  
  7. for bandi in records:
  8.     contacts = env["res.partner"].search(['&','&','&','&',("category_id", "=", [198]), ("category_id", "=", [207]), ('is_company','=', True),('state_id', 'in', bandi.x_studio_many2many_field_7v3_1hssiq3f0.ids),('x_studio_x_studio_id_legal_type_2', 'in', bandi.x_studio_forma_giuridica_da_definire.ids),'|',('x_studio_codice_ateco_primario', 'in', bandi.x_studio_ateco.ids),('x_studio_code_ateco_second_level', 'in', bandi.x_studio_ateco.ids)])
  9.     if contacts:
  10.         contact_ids = contacts.ids
  11.         for contact in contact_ids:
  12.             bandi['x_studio_contatti_assegnati'] = [(4, contact)]
  13.  
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement