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

When developing custom modules, I'm still asking what kind of methods should I choose to execute an action. For example for canceling a "stock.picking" object, you have 3 solutions:

#Directly write state to object
picking_obj.write(cr, uid, picking_id.id, {'state':'cancel'}, context=context);

#Use model function
picking_obj.action_cancel(cr, uid, picking_id.id, context=context);

#Use the workflow
wf_service.trg_validate(uid, 'stock.picking', picking_id.id, 'button_cancel', cr)

I know that the first solution should be avoid. But what about the model function and workflow action ?

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 11 24
28
1
thg 4 15
4775
1
thg 6 25
421
2
thg 1 25
1156
1
thg 8 22
7782