Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1 Trả lời
1317 Lượt xem

In this form, i would like the user to click the "submit " button, or else it will only save as draft or stays in new request stage. After clicking the submit button, it will automatically proceed to next stage "For approval", in which the department head and admin management's approval is needed. Before it proceeds to next stage "On Progress", those two is needed, not only one of them but two of them, and the form filled up by the requestor will be lock and cannot be change the values they've input. Then, after the two approval given, it will automatically proceed to, "on progress" which is my responsibility. Then, done. 

Also, they are not allowed to change the stages. It needs to be in flow. So, i disabled the clickable pipeline.



To summarize the flow: 

  1. Create a request form.
  2. Needs to submit to proceed in "for approval" stage.
  3. Needs the approval of 2, to proceed in "on progress" stage and the form will be locked and forbidden to be edit by anyone else.
  4. Needs my approval, to proceed in "done".
Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

You have to write a code in server action. to switch the stage. 

use this python code in server action

record.write({'stage_id': 2})

here I have used the stage_id which field name in CRM.

In your case, I could see that you have place the pipeline stage in your form view. you need to load the pipeline field name in the Stage_id.

Note:

  • if the pipeline stage is many2one field you can pass the id of the field. if it is a selection field you need to give it as a string.
  • In server action you need to select the appropriate module name to create it

 

Ảnh đại diện
Huỷ bỏ
Tác giả

The details of the pipeline is like this..

Field: x_studio_stage_id
Type: many2one
Widget: status (statusbar)
Context: {}
Domain: []
Required: true
Relation: x_request_system_acces_stage

Here You have the Field name as x_studio_stage_id. Hence, write the code as record.write({x_studio_stage_id:}) and find the id of the stage by inspecting the page and pass the id which have the label of the next stage.

note:
To inspect the page go to the page where the stage are created and press F12 there will be page open below the web browser.

once it open you have refresh the page to get the inspect information and click on web_search_read in the name list.

on the write side you will get the page with different heads. click on preview and click on results and records arrow. you can see the list of ids and their name there you can find the id's of the stages.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 7 25
2056
1
thg 6 25
2431
2
thg 5 25
2019
1
thg 5 25
1231
1
thg 2 25
38