Passa al contenuto
Odoo Menu
  • Accedi
  • Provalo gratis
  • App
    Finanze
    • Contabilità
    • Fatturazione
    • Note spese
    • Fogli di calcolo (BI)
    • Documenti
    • Firma
    Vendite
    • CRM
    • Vendite
    • Punto vendita Negozio
    • Punto vendita Ristorante
    • Abbonamenti
    • Noleggi
    Siti web
    • Configuratore sito web
    • E-commerce
    • Blog
    • Forum
    • Live chat
    • E-learning
    Supply chain
    • Magazzino
    • Produzione
    • PLM
    • Acquisti
    • Manutenzione
    • Qualità
    Risorse umane
    • Dipendenti
    • Assunzioni
    • Ferie
    • Valutazioni
    • Referral dipendenti
    • Parco veicoli
    Marketing
    • Social marketing
    • E-mail marketing
    • SMS marketing
    • Eventi
    • Marketing automation
    • Sondaggi
    Servizi
    • Progetti
    • Fogli ore
    • Assistenza sul campo
    • Helpdesk
    • Pianificazione
    • Appuntamenti
    Produttività
    • Comunicazioni
    • Approvazioni
    • IoT
    • VoIP
    • Knowledge
    • WhatsApp
    App di terze parti Odoo Studio Piattaforma cloud Odoo
  • Settori
    Retail
    • Libreria
    • Negozio di abbigliamento
    • Negozio di arredamento
    • Alimentari
    • Ferramenta
    • Negozio di giocattoli
    Cibo e ospitalità
    • Bar e pub
    • Ristorante
    • Fast food
    • Pensione
    • Grossista di bevande
    • Hotel
    Agenzia immobiliare
    • Agenzia immobiliare
    • Studio di architettura
    • Edilizia
    • Gestione immobiliare
    • Impresa di giardinaggio
    • Associazione di proprietari immobiliari
    Consulenza
    • Società di contabilità
    • Partner Odoo
    • Agenzia di marketing
    • Studio legale
    • Selezione del personale
    • Audit e certificazione
    Produzione
    • Tessile
    • Metallo
    • Arredamenti
    • Alimentare
    • Birrificio
    • Ditta di regalistica aziendale
    Benessere e sport
    • Club sportivo
    • Negozio di ottica
    • Centro fitness
    • Centro benessere
    • Farmacia
    • Parrucchiere
    Commercio
    • Tuttofare
    • Hardware e assistenza IT
    • Ditta di installazione di pannelli solari
    • Calzolaio
    • Servizi di pulizia
    • Servizi di climatizzazione
    Altro
    • Organizzazione non profit
    • Ente per la tutela ambientale
    • Agenzia di cartellonistica pubblicitaria
    • Studio fotografico
    • Punto noleggio di biciclette
    • Rivenditore di software
    Carica tutti i settori
  • Community
    Apprendimento
    • Tutorial
    • Documentazione
    • Certificazioni 
    • Formazione
    • Blog
    • Podcast
    Potenzia la tua formazione
    • Programma educativo
    • Scale Up! Business Game
    • Visita Odoo
    Ottieni il software
    • Scarica
    • Versioni a confronto
    • Note di versione
    Collabora
    • Github
    • Forum
    • Eventi
    • Traduzioni
    • Diventa nostro partner
    • Servizi per partner
    • Registra la tua società di contabilità
    Ottieni servizi
    • Trova un partner
    • Trova un contabile
    • Incontra un esperto
    • Servizi di implementazione
    • Testimonianze dei clienti
    • Supporto
    • Aggiornamenti
    GitHub Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Richiedi una demo
  • Prezzi
  • Aiuto

Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:

  • CRM
  • e-Commerce
  • Contabilità
  • Magazzino
  • PoS
  • Progetti
  • MRP
All apps
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
È necessario essere registrati per interagire con la community.
Tutti gli articoli Persone Badge
Etichette (Mostra tutto)
odoo accounting v14 pos v15
Sul forum
Assistenza

Confirm Sales via python XML-RPC

Iscriviti

Ricevi una notifica quando c'è un'attività per questo post

La domanda è stata contrassegnata
stock_pickingaccount.invoice
5 Risposte
26731 Visualizzazioni
Avatar
Jorge Medina

Good Morning

I present my problem, we are starting to climb all sales of a company to OpenERP from the portal, which already does leaving sales as "draft", I'm trying to use python code with XML-RPC to confirm all and any their way to deliver the product, but my problem is that I find as deliver products automatically, this is the code that I have for this::

ventas_workflow.py

import xmlrpclib

1 CONFIGURATION

HOST = 'localhost' PORT = 8069 DB = 'GMM' USER = 'admin' PASS = '123456'

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 "" print "Login %s (uid:%d)"%(USER,uid) print ""

METHODS

def execute(*args): return object_proxy.execute(DB, uid, PASS, *args)

def workflow(*args): return object_proxy.exec_workflow(DB,uid, PASS, *args)

3 DRAFT SALES SEARCH

so_ids = execute('sale.order', 'search', [('state','=','draft')])

4 CONFIRMED SALES

for so in so_ids:
print "Id Sale # %s"%(so) # confirm SOs workflow('sale.order', 'order_confirm', so)

5 INVOICE

so_ids = execute('sale.order', 'search', [('state','=','manual')])

6 CREATE INVOICE

for so in so_ids:
print "Id Sale # %s"%(so) # confirm SOs workflow('sale.order', 'manual_invoice', so)

7 INVOICE STATE DRAFT

ai_ids = execute('account.invoice', 'search', [('state','=','draft'), ('type','=','out_invoice')])

8 VALIDATE INVOICE

for ai in ai_ids:
print "Id Invoice # %s"%(ai) # confirm AIs workflow('account.invoice', 'invoice_open', ai)

9 GET OUTSTANDING BY DELIVERING PRODUCTS

spo_ids = execute('stock.picking.out', 'search', [('state','=','confirmed'), ('type','=','out')])

10 DELIVER PRODUCT

for spo in spo_ids: print "Id Picking out # %s"%(spo)
#workflow('stock.picking', 'action_assign', spo)

The process and does everything but can not find item 10 as running and do not know how to change the stock.picking of state "confirmed" to "assigned" because once in state "assigned" is used workflow "button_done" to deliver.

I hope you can advise me.

many Thanks

regards

Note: Google translation

2
Avatar
Abbandona
Roel Adriaans

Only use English on this site please. Thank you.

Jorge Medina
Autore

Ok, thanks, one question, is there a Spanish forum Open ERP?, regards.

Maniganda

How to call other functions in standard object except orm methods using xmlrpc

Avatar
Karthik Arumugam
Risposta migliore

Hi,

      I think this will help you in you case

      Follow this

     

import xmlrpclib
from pprint import pprint
url = 'http://localhost:8069'
db = 'v7_new_test'
username= 'admin'
password= 'test'
conn = xmlrpclib.ServerProxy('{0}/xmlrpc/common?db={1}'.format(url,db))

uid = conn.login(db,username,password)

models = xmlrpclib.ServerProxy('{0}/xmlrpc/object?db={1}'.format(url,db))


ids = [ your searched id(s) ]
x=models.execute_kw(db, uid, password, 'student.info.workflow','read',ids)
 
a = models.exec_workflow(db,uid,password,'student.info.workflow','check',ids[0])
 
x=models.execute_kw(db, uid, password, 'student.info.workflow','read',ids)
 







     

  

3
Avatar
Abbandona
Avatar
Jorge Medina
Autore Risposta migliore

good morning

What we had to do to solve this problem was to create a module for OpenERP , so you could use objects and use OpenERP Workflow together.

example:

claseprueba.py :

Import objects

import from openerp.osv osv , fields

claseprueba class ( osv.Model ) : _name = " claseprueba "

action_confirmaclaseprueba def (self, cr , uid , ids, context = None) : //Create object of purchase

self.pool.get purchase_obj = ( ' purchase.order ' )

//Create User object

self.pool.get res_user_obj = ( ' res.users ' )

//Obtained user

res_user_obj.browse res_user = (cr , uid , uid )

//you can access its properties

print res_user.login

//Create WorkFlow

wf_service = netsvc.LocalService ( "workflow" )

//Shopping Gets the draft company's existing user

purchase_obj.search order_ids = (cr , user_id , [( 'state' , '= ', ' draft' ) , ( ' company_id ', ' =', res_user.company_id.id )] )

//Walk

for order_id in order_ids :

//Confirm Purchase

wf_service.trg_validate ( user_id , ' purchase.order ' order_id ' purchase_confirm ' , cr)

//Validates Purchase

wf_service.trg_validate ( user_id , ' purchase.order ' order_id ' purchase_approve ' , cr)

This is an example , but will give you an idea where to start , you need to put the light and install in OpenERP , you have a button and run this method. You can use objects from OpenERP using this module.

regards

-1
Avatar
Abbandona
Ti stai godendo la conversazione? Non leggere soltanto, partecipa anche tu!

Crea un account oggi per scoprire funzionalità esclusive ed entrare a far parte della nostra fantastica community!

Registrati
Post correlati Risposte Visualizzazioni Attività
How to add new fields to stock picking report
stock_picking report account.invoice
Avatar
0
mar 15
4991
Related fields from sales orders in accounting invoices
account.invoice
Avatar
0
mar 25
1687
what is the use of stock.picking, stock.picking.out and stock.picking.in Risolto
stock_picking
Avatar
Avatar
1
nov 24
20217
Invalid field error on code for stock.picking
stock_picking
Avatar
0
ago 22
13496
How to handle paypal fees, other's commissions, charges into invoice?
account.invoice
Avatar
Avatar
Avatar
2
giu 20
6968
Community
  • Tutorial
  • Documentazione
  • Forum
Open source
  • Scarica
  • Github
  • Runbot
  • Traduzioni
Servizi
  • Hosting Odoo.sh
  • Supporto
  • Aggiornamenti
  • Sviluppi personalizzati
  • Formazione
  • Trova un contabile
  • Trova un partner
  • Diventa nostro partner
Chi siamo
  • La nostra azienda
  • Branding
  • Contattaci
  • Lavora con noi
  • Eventi
  • Podcast
  • Blog
  • Clienti
  • Note legali • Privacy
  • Sicurezza
الْعَرَبيّة Català 简体中文 繁體中文 (台灣) Čeština Dansk Nederlands English Suomi Français Deutsch हिंदी Bahasa Indonesia Italiano 日本語 한국어 (KR) Lietuvių kalba Język polski Português (BR) română русский язык Slovenský jazyk slovenščina Español (América Latina) Español ภาษาไทย Türkçe українська Tiếng Việt

Odoo è un gestionale di applicazioni aziendali open source pensato per coprire tutte le esigenze della tua azienda: CRM, Vendite, E-commerce, Magazzino, Produzione, Fatturazione elettronica, Project Management e molto altro.

Il punto di forza di Odoo è quello di offrire un ecosistema unico di app facili da usare, intuitive e completamente integrate tra loro.

Website made with

Odoo Experience on YouTube

1. Use the live chat to ask your questions.
2. The operator answers within a few minutes.

Live support on Youtube
Watch now