Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Done by RHT on the 01/02/2024
- # Reviewed by KHBA on the 05/02/2024
- # Review: https://pastebin.com/m3hYYVxu
- # need: create project from opportunity (and link the two records)
- # 911 task: https://www.odoo.com/web#id=3710401&cids=1&model=project.task&view_type=form
- for opp in records:
- values = {'name': opp.name, 'x_studio_opportunity_id': opp.id,'is_fsm': True,'use_documents': True, 'allow_subtasks': True}
- if opp.partner_id: # KHBA - Added this part if the opportunity has a partner associated with, otherwise previous code will create an error
- values['partner_id'] = opp.partner_id.id
- project = env['project.project'].create(values)
- opp['x_studio_project_id'] = project.id
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement