I need an XML-RPC snippet in python that confirms and/or starts an MO (v 6.1).
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- إدارة علاقات العملاء
- e-Commerce
- المحاسبة
- المخزون
- PoS
- Project
- MRP
لقد تم الإبلاغ عن هذا السؤال
2
الردود
7509
أدوات العرض
1 Setup
import xmlrpclib
HOST = 'localhost'
PORT = 8069
DB = 'demo'
USER = 'admin'
PASS = 'admin'
url = 'http://%s:%d/xmlrpc/'%(HOST,PORT)
object_proxy = xmlrpclib.ServerProxy(url+'object')
common_proxy = xmlrpclib.ServerProxy(url+'common')
2 Login
uid = common_proxy.login(DB,USER,PASS)
print "Logged in as %s (uid:%d)"%(USER,uid)
def execute(*args):
return object_proxy.execute(DB, uid, PASS, *args)
3 Search
mo_ids = execute('mrp.production', 'search', [('state','=','draft')])
print mo_ids
4 Confirm & Produce
for mo in mo_ids:
# confirm MOs
object_proxy.exec_workflow(DB,uid, PASS, 'mrp.production', 'button_confirm', mo)
# You may want to add a step for Check availability or Force availability
# produce MOs
object_proxy.exec_workflow(DB,uid, PASS, 'mrp.production', 'button_produce', mo)
Hey Ray,
Thanks for you post.
What would the last step be?
object_proxy.exec_workflow(DB,uid, PASS, 'mrp.production', 'button_produce_done', mo
would be to easy..:)
I need to find a way to call "action_produce". Then i would be able to change status and finish the production
cheers!
Hey Ray,
Thanks for you post.
What would the last step be?
object_proxy.exec_workflow(DB,uid, PASS, 'mrp.production', 'button_produce_done', mo
would be to easy..:)
I need to find a way to call "action_produce". Then i would be able to change status and finish the production
cheers!
هل أعجبك النقاش؟ لا تكن مستمعاً فقط. شاركنا!
أنشئ حساباً اليوم لتستمتع بالخصائص الحصرية، وتفاعل مع مجتمعنا الرائع!
تسجيلالمنشورات ذات الصلة | الردود | أدوات العرض | النشاط | |
---|---|---|---|---|
|
1
يونيو 24
|
4208 | ||
Domain one2many field?
تم الحل
|
|
5
يونيو 23
|
35282 | |
|
1
ديسمبر 23
|
19163 | ||
|
1
يوليو 15
|
6147 | ||
|
2
مارس 15
|
6153 |