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

We recently migrated from Odoo 8 to Odoo 12.

In Odoo 8 we used the xmlrpc and python 3 to create and modify invoices, sales orders, purchase orders, etc.

Now with Odoo 12 the functionality of exec_workflow has been removed. For example, we used it in the following manner:

models.exec_workflow(db, uid, password, 'purchase.order', 'bid_received', PO_id)

models.exec_workflow(db, uid, password, 'purchase.order', 'purchase_confirm', PO_id)

models.exec_workflow(db, uid, password, 'account.invoice', 'invoice_open', INVOIC_id)

I read that it is deprecated since Odoo 10 but I could not find what replaced it since then.

Could someone point me in the right direction?

Ảnh đại diện
Huỷ bỏ
Tác giả Câu trả lời hay nhất

Think I found the answer myself. 

It is now done by triggering buttons, so for confirming a purchase order it is:

models.execute_kw(db, uid, password, 'purchase.order', 'button_confirm', [po_id])

Ảnh đại diện
Huỷ bỏ

so odoo removed a feature that was being used by you guys and now you had to implement it your own way?

i now really hate the fact that they are removing features. cause im searching for official documents on the workflow for v13 but could only find it for v10.

Tác giả

So they deprecated the exec_workflow functionality since Odoo V10 I believe, it was still available back then. In Odoo V11 or V12 they removed it completely.

These two lines:

models.exec_workflow(db, uid, password, 'purchase.order', 'bid_received', PO_id)

models.exec_workflow(db, uid, password, 'purchase.order', 'purchase_confirm', PO_id)

where to confirm purchase orders using workflow, now that workflows are removed you are able to do the equivalent process by the following line:

models.execute_kw(db, uid, password, 'purchase.order', 'button_confirm', [po_id])

"button_confirm" is the name of the button you would be pressing to confirm a purchase order on the frontend of Odoo.

So if I am correct it is still possible to trigger these 'workflows' but now using the actual buttons you see in the frontend.

Bài viết liên quan Trả lời Lượt xem Hoạt động
3
thg 12 22
3717
2
thg 4 20
4657
1
thg 4 20
3613
2
thg 9 19
9209
2
thg 6 19
5653