alterar estado licenças ("set to")
Em resolução ao ticket da laso id= 10669Foi criado um automatismo em Ações de servidor para que existisse um botão em ação para efetuar essa alteração.
A alteração pedida foi para que retrocedessem o estado do pedido para aprovado. segue em seguida o código utilizado:
Alteração de estado para Aprovado.
# Available locals:
# - time, datetime, dateutil: Python libraries
# - env: Odoo Environement
# - model: Model of the record on which the action is triggered
# - object: Record on which the action is triggered if there is one, otherwise None
# - workflow: Workflow engine
# - log : log(message), function to log debug information in logging table
# - Warning: Warning Exception to use with raise
# To return an action, assign: action = {...}
object.browse(object._context.get('active_ids',object.ids)).write({'completed_flag': False, 'submitted_flag': True, 'state_license': 4})
Alteração de estado para Aceite.
# Available locals:
# - time, datetime, dateutil: Python libraries
# - env: Odoo Environement
# - model: Model of the record on which the action is triggered
# - object: Record on which the action is triggered if there is one, otherwise None
# - workflow: Workflow engine
# - log : log(message), function to log debug information in logging table
# - Warning: Warning Exception to use with raise
# To return an action, assign: action = {...}
object.browse(object._context.get('active_ids',object.ids)).write({'completed_flag': False, 'submitted_flag': False, 'state_license': 2})
Your answer
Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!
Ask a Question
Keep Informed
About This Forum
This community is for professionals and enthusiasts of our products and services.
Read GuidelinesQuestion tools
2 follower(s)
Stats
| Asked: 29/01/20, 11:07 |
| Seen: 132 times |
| Last updated: 29/01/20, 11:07 |