Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
2 Respostas
373 Visualizações

I want this behavior:

1-When a user updates a BoM (for example, changes product or quantity), the system should send an approval request to the manager, and the BoM should not be saved or editable again until the manager approves it.

2-I also want to show the old and new values in the chatter message.

best regards

Avatar
Cancelar
Melhor resposta

Are you trying to implement Engineering Change Orders? This is a part of the PLM module. The approval flow is also part of the functionality in that module.

Avatar
Cancelar
Melhor resposta

Hi AljawahirSteel

BoM Change with Manager Approval:

  1. To make sure Bill of Materials (BoM) changes are only saved after manager approval, follow these steps. 
  2. First, add two fields to the BoM form: one checkbox field called awaiting_approval to show if approval is pending, and another text field called pending changes to hold the proposed changes. 
  3. Then, change the way BoM is updated by overriding the write method. When a user edits the BoM (like changing product or quantity), do not save the change directly. 
  4. Instead, store the new values in the pending changes field, set awaiting_approval to True, and stop any further edits. 
  5. Show the change (old and new values) in the chatter using a simple message like "Qty changed from 5.0 to 10.0 –-> waiting for approval". Notify the manager for approval. 
  6. The manager will see the changes and can either approve or reject. If approved, apply the changes from pending changes to the actual BoM, clear the pending flag, and post a confirmation message in the chatter. 
  7. If rejected, discard the pending changes and post a rejection message.
  8.  This setup ensures that users cannot change BoM without approval, and all changes are tracked clearly.
  9. Key Notes:
    1. Add awaiting_approval (True/False) to block changes.
    2. Add pending changes to store new values temporarily.
    3. Do not save changes immediately, wait for manager action.
    4. Post old vs new values in the chatter for clarity.
    5. Let manager approve or reject using Approve/Reject buttons(if possible capture the remarks to store it).
    6. Apply or discard changes based on manager’s decision.
    7. Keep everything visible and secure.
Avatar
Cancelar