Skip to Content
Odoo Menú
  • Registra entrada
  • Prova-ho gratis
  • Aplicacions
    Finances
    • Comptabilitat
    • Facturació
    • Despeses
    • Full de càlcul (IA)
    • Documents
    • Signatura
    Vendes
    • CRM
    • Vendes
    • Punt de venda per a botigues
    • Punt de venda per a restaurants
    • Subscripcions
    • Lloguer
    Imatges de llocs web
    • Creació de llocs web
    • Comerç electrònic
    • Blog
    • Fòrum
    • Xat en directe
    • Aprenentatge en línia
    Cadena de subministrament
    • Inventari
    • Fabricació
    • PLM
    • Compres
    • Manteniment
    • Qualitat
    Recursos humans
    • Empleats
    • Reclutament
    • Absències
    • Avaluacions
    • Recomanacions
    • Flota
    Màrqueting
    • Màrqueting Social
    • Màrqueting per correu electrònic
    • Màrqueting per SMS
    • Esdeveniments
    • Automatització del màrqueting
    • Enquestes
    Serveis
    • Projectes
    • Fulls d'hores
    • Servei de camp
    • Suport
    • Planificació
    • Cites
    Productivitat
    • Converses
    • Validacions
    • IoT
    • VoIP
    • Coneixements
    • WhatsApp
    Aplicacions de tercers Odoo Studio Plataforma d'Odoo al núvol
  • Sectors
    Comerç al detall
    • Llibreria
    • Botiga de roba
    • Botiga de mobles
    • Botiga d'ultramarins
    • Ferreteria
    • Botiga de joguines
    Food & Hospitality
    • Bar i pub
    • Restaurant
    • Menjar ràpid
    • Guest House
    • Distribuïdor de begudes
    • Hotel
    Immobiliari
    • Agència immobiliària
    • Estudi d'arquitectura
    • Construcció
    • Gestió immobiliària
    • Jardineria
    • Associació de propietaris de béns immobles
    Consultoria
    • Empresa comptable
    • Partner d'Odoo
    • Agència de màrqueting
    • Bufet d'advocats
    • Captació de talent
    • Auditoria i certificació
    Fabricació
    • Textile
    • Metal
    • Mobles
    • Menjar
    • Brewery
    • Regals corporatius
    Salut i fitness
    • Club d'esport
    • Òptica
    • Centre de fitness
    • Especialistes en benestar
    • Farmàcia
    • Perruqueria
    Trades
    • Servei de manteniment
    • Hardware i suport informàtic
    • Sistemes d'energia solar
    • Shoe Maker
    • Serveis de neteja
    • Instal·lacions HVAC
    Altres
    • Nonprofit Organization
    • Agència del medi ambient
    • Lloguer de panells publicitaris
    • Fotografia
    • Lloguer de bicicletes
    • Distribuïdors de programari
    Browse all Industries
  • Comunitat
    Aprèn
    • Tutorials
    • Documentació
    • Certificacions
    • Formació
    • Blog
    • Pòdcast
    Potenciar l'educació
    • Programa educatiu
    • Scale-Up! El joc empresarial
    • Visita Odoo
    Obtindre el programari
    • Descarregar
    • Comparar edicions
    • Novetats de les versions
    Col·laborar
    • GitHub
    • Fòrum
    • Esdeveniments
    • Traduccions
    • Converteix-te en partner
    • Services for Partners
    • Registra la teva empresa comptable
    Obtindre els serveis
    • Troba un partner
    • Troba un comptable
    • Contacta amb un expert
    • Serveis d'implementació
    • Referències del client
    • Suport
    • Actualitzacions
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Programar una demo
  • Preus
  • Ajuda

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

  • CRM
  • e-Commerce
  • Comptabilitat
  • Inventari
  • PoS
  • Projectes
  • MRP
All apps
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
You need to be registered to interact with the community.
All Posts People Badges
Etiquetes (View all)
odoo accounting v14 pos v15
About this forum
Ajuda

How to create a transfer (stock.picking) from an Automated Action in Studio?

Subscriure's

Get notified when there's activity on this post

This question has been flagged
pythontransferstock.movestudiostock.picking
1 Respondre
18698 Vistes
Avatar
mike@rehabtronics.com

I've managed to create a transfer (stock.picking) record and, through setting the Stock Moves field in the transfer, a stock.move record.

The trouble is that, despite the stock.move being created as a field in the stock.picking record, the two resulting records appear to be unrelated:

•    The Transfer record has nothing in its move lines
•    The Stock Move record has "Stock Rule/External ID" = FALSE

Below is are details of the current Automated Action setup.  Any advice/guidance/resource-links would be greatly appreciated:

My automated action intent is to create a stock transfer (stock.picking) under certain conditions (in this case if a "quantity_rejected" number field changes from 0 to a number >0):

I create a new automated action with the following settings:

  • Action To Do: Create a new Record
  • Create/Write Target Model: Transfer

Under the "Data to Write", I have the following:

FIELD (stock.picking)

EVALUATION TYPE

Record / Value

Company

Reference

MyCompany

Source Location

Reference

WH/Input

Destination Location

Reference

WH/Scrap

Operation Type

Reference

MyCompany: Internal Transfer

Source Document

Python expression

record.x_name

Qty

Python expression

record.x_studio_quantity_rejected

Product

Python expression

record.x_studio_product.id

Stock Moves
Python expression
env['stock.move'].create({
'name': 'Rejected Product Transfer',
'location_id': 14,
'location_dest_id': 20,
'product_id': record.x_studio_product.id,
'product_uom': 1,
'product_uom_qty': record.x_studio_quantity_rejected,
'procure_method': 'make_to_stock',
'date_expected': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
'date': datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
'company_id': 1,
})


As I say, this successfully creates both a new transfer, and a new stock move record.  But, like I say, despite the stock.move being created as a field in the stock.picking record, the two records appear to be unrelated:
•    The Transfer record has nothing in its move lines
•    The Stock Move record has "Stock Rule/External ID" = FALSE


(Odoo v12 Enterprise)

0
Avatar
Descartar
Alexander Christen

Did you manage to find a solution for this?

mike@rehabtronics.com
Autor

Unfortunately, no.  Experimented a bit more, but never found a solution. Ultimately I gave up.

Would still be really nice to know how to accomplish this though... ;)

Avatar
Frank Scholten
Best Answer

Hi,

I managed to do this the following way.

You are creating a new record in the table stock.move, whereas using the transfer['move_lines'] i'm creating it in the context of the transfer.

----------------------------------

destination = record.location_id
orderlines = record.move_lines
note = "Nieuwe Transfer"
id = record.id

transfer = env['stock.picking'].create({
'picking_type_id': 5,
'location_id': 8,
'location_dest_id' : destination.id,
'note' : note
})

for line in orderlines:
transfer['move_lines'] = [(0,0, {
'name' : note,
'product_uom_qty' : line.product_uom_qty,
'product_id' : line.product_id.id,
"product_uom" : line.product_id.uom_id.id,
"location_id" : 8,
"location_dest_id" : destination.id
})]

1
Avatar
Descartar
Enjoying the discussion? Don't just read, join in!

Create an account today to enjoy exclusive features and engage with our awesome community!

Registrar-se
Related Posts Respostes Vistes Activitat
How can you get a list of all product_id's associated to a given a stock_picking id?
python stock.move stock.picking odooV8
Avatar
Avatar
2
de gen. 16
7014
Manage Immediate Internal Transfer from RPC API
python rpc stock.move stock.picking 13.0
Avatar
Avatar
2
d’abr. 20
6191
How to show moves and their details from picking
stock.move stock.picking
Avatar
Avatar
Avatar
2
de maig 25
7256
Display Debit and Credit in USD in Journal Items
python studio
Avatar
Avatar
1
de febr. 25
2070
Studio - link between project and quotation
python studio
Avatar
0
de juny 19
1867
Community
  • Tutorials
  • Documentació
  • Fòrum
Codi obert
  • Descarregar
  • GitHub
  • Runbot
  • Traduccions
Serveis
  • Allotjament a Odoo.sh
  • Suport
  • Actualització
  • Desenvolupaments personalitzats
  • Educació
  • Troba un comptable
  • Troba un partner
  • Converteix-te en partner
Sobre nosaltres
  • La nostra empresa
  • Actius de marca
  • Contacta amb nosaltres
  • Llocs de treball
  • Esdeveniments
  • Pòdcast
  • Blog
  • Clients
  • Informació legal • Privacitat
  • Seguretat
الْعَرَبيّة 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 és un conjunt d'aplicacions empresarials de codi obert que cobreix totes les necessitats de la teva empresa: CRM, comerç electrònic, comptabilitat, inventari, punt de venda, gestió de projectes, etc.

La proposta única de valor d'Odoo és ser molt fàcil d'utilitzar i estar totalment integrat, ambdues alhora.

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