Skip ke Konten
Odoo Menu
  • Login
  • Uji coba gratis
  • Aplikasi
    Keuangan
    • Akuntansi
    • Faktur
    • Pengeluaran
    • Spreadsheet (BI)
    • Dokumen
    • Tanda Tangan
    Sales
    • CRM
    • Sales
    • POS Toko
    • POS Restoran
    • Langganan
    • Rental
    Website
    • Website Builder
    • eCommerce
    • Blog
    • Forum
    • Live Chat
    • eLearning
    Rantai Pasokan
    • Inventaris
    • Manufaktur
    • PLM
    • Purchase
    • Maintenance
    • Kualitas
    Sumber Daya Manusia
    • Karyawan
    • Rekrutmen
    • Cuti
    • Appraisal
    • Referensi
    • Armada
    Marketing
    • Social Marketing
    • Email Marketing
    • SMS Marketing
    • Acara
    • Otomatisasi Marketing
    • Survei
    Layanan
    • Project
    • Timesheet
    • Layanan Lapangan
    • Meja Bantuan
    • Planning
    • Appointment
    Produktivitas
    • Diskusi
    • Approval
    • IoT
    • VoIP
    • Pengetahuan
    • WhatsApp
    Aplikasi pihak ketiga Odoo Studio Platform Odoo Cloud
  • Industri-Industri
    Retail
    • Toko Buku
    • Toko Baju
    • Toko Furnitur
    • Toko Kelontong
    • Toko Hardware
    • Toko Mainan
    Makanan & Hospitality
    • Bar dan Pub
    • Restoran
    • Fast Food
    • Rumah Tamu
    • Distributor Minuman
    • Hotel
    Real Estate
    • Agensi Real Estate
    • Firma Arsitektur
    • Konstruksi
    • Estate Management
    • Perkebunan
    • Asosiasi Pemilik Properti
    Konsultansi
    • Firma Akuntansi
    • Mitra Odoo
    • Agensi Marketing
    • Firma huku
    • Talent Acquisition
    • Audit & Sertifikasi
    Manufaktur
    • Tekstil
    • Logam
    • Perabotan
    • Makanan
    • Brewery
    • Corporate Gift
    Kesehatan & Fitness
    • Sports Club
    • Toko Kacamata
    • Fitness Center
    • Wellness Practitioners
    • Farmasi
    • Salon Rambut
    Perdagangan
    • Handyman
    • IT Hardware & Support
    • Sistem-Sistem Energi Surya
    • Pembuat Sepatu
    • Cleaning Service
    • Layanan HVAC
    Lainnya
    • Organisasi Nirlaba
    • Agen Lingkungan
    • Rental Billboard
    • Fotografi
    • Penyewaan Sepeda
    • Reseller Software
    Browse semua Industri
  • Komunitas
    Belajar
    • Tutorial-tutorial
    • Dokumentasi
    • Sertifikasi
    • Pelatihan
    • Blog
    • Podcast
    Empower Education
    • Program Edukasi
    • Game Bisnis 'Scale Up!'
    • Kunjungi Odoo
    Dapatkan Softwarenya
    • Download
    • Bandingkan Edisi
    • Daftar Rilis
    Kolaborasi
    • Github
    • Forum
    • Acara
    • Terjemahan
    • Menjadi Partner
    • Layanan untuk Partner
    • Daftarkan perusahaan Akuntansi Anda.
    Dapatkan Layanan
    • Temukan Mitra
    • Temukan Akuntan
    • Temui penasihat
    • Layanan Implementasi
    • Referensi Pelanggan
    • Bantuan
    • Upgrades
    Github Youtube Twitter Linkedin Instagram Facebook Spotify
    +1 (650) 691-3277
    Dapatkan demo
  • Harga
  • Bantuan

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

  • CRM
  • e-Commerce
  • Akuntansi
  • Inventaris
  • PoS
  • Project
  • MRP
All apps
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Anda harus terdaftar untuk dapat berinteraksi di komunitas.
Semua Post Orang Lencana-Lencana
Label (Lihat semua)
odoo accounting v14 pos v15
Mengenai forum ini
Help

Synchronize lot_id information in purchase orders and stock picking

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
pickinglinepurchase_orderodoo11
1 Balas
5876 Tampilan
Avatar
Daniele Morelli

Hello, i'm using odoo11 with lot traceability activated.

I wrote a custom method so that the lot number of a received product is automatically valorized in the stock.picking model, as soon as the user validates the purchase order, something like this:

class CustomPicking(models.Model):
    _inherit = 'stock.picking'
    _name = 'stock.picking'
    
    @api.multi
    def button_validate(self):  
        for picking in self:  
            for line in picking.move_line_ids:
                #omitted code that calculates a new lot number
                line.lot_name = generated_lot_number
            return super(CustomPicking, self).button_validate()

When the user creates a new Vendor Bill from the purchase order, i'd like the lot number to be automatically valorized with the generated value that was set up in the line of the stock.picking model.

After a bit of research i found that I have to override the method _prepare_invoice_line_from_po_line

class CustomInvoice(models.Model):
    _inherit = 'account.invoice'
    _name = 'account.invoice'    

    @api.multi def _prepare_invoice_line_from_po_line(self, line): data = super(CustomInvoice,self)._prepare_invoice_line_from_po_line(line) #do something with data
        return data

The problem is that the "line" object in this method refers to the purchase_order_line model, and in that model my custom lot_id is still not valorized.

So i'd need to access the respective puchase_order_line instance from the stock_picking_line, but i cannot find a way to do so... (i'd have expected to find some relational field in one of the two models/tables, but unless i missed something i could not find it).

Do you have some suggestions about how could I achieve that?

Thanks!

0
Avatar
Buang
Avatar
faOtools
Jawaban Terbai

Hi,

have a look at the stock.py of the module 'purchase' https://github.com/odoo/odoo/blob/11.0/addons/purchase/models/stock.py

Here in stock.move you have 'purchase_line_id'.

1
Avatar
Buang
Daniele Morelli
Penulis

Hi, thank you for the answer. I still needed to do some dirty tricks to get everything to work, but i managed to do what i wanted. Cheers

Menikmati diskusi? Jangan hanya membaca, ikuti!

Buat akun sekarang untuk menikmati fitur eksklufi dan agar terlibat dengan komunitas kami!

Daftar
Post Terkait Replies Tampilan Aktivitas
Analytic account from PO to picking line Diselesaikan
picking purchase_order move_lines
Avatar
Avatar
1
Des 22
4728
Can I sort the lines of an order by product category?
line purchase_order category
Avatar
Avatar
1
Jul 19
3812
Set our Customized report to default on send by email button in odoo [ Purchase Order ] Diselesaikan
email purchase_order odoo11
Avatar
Avatar
1
Jan 19
5400
[ODOO 11] Checking stock before purchase order creation
stock sale purchase_order odoo11
Avatar
Avatar
Avatar
4
Jan 20
6402
Error when trying to import Purchase Orders into Odoo Diselesaikan
purchase_order order.line odoo odoo11
Avatar
Avatar
1
Jan 19
5690
Komunitas
  • Tutorial-tutorial
  • Dokumentasi
  • Forum
Open Source
  • Download
  • Github
  • Runbot
  • Terjemahan
Layanan
  • Odoo.sh Hosting
  • Bantuan
  • Peningkatan
  • Custom Development
  • Pendidikan
  • Temukan Akuntan
  • Temukan Mitra
  • Menjadi Partner
Tentang Kami
  • Perusahaan kami
  • Aset Merek
  • Hubungi kami
  • Tugas
  • Acara
  • Podcast
  • Blog
  • Pelanggan
  • Hukum • Privasi
  • Keamanan
الْعَرَبيّة 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 adalah rangkaian aplikasi bisnis open source yang mencakup semua kebutuhan perusahaan Anda: CRM, eCommerce, akuntansi, inventaris, point of sale, manajemen project, dan seterusnya.

Mudah digunakan dan terintegrasi penuh pada saat yang sama adalah value proposition unik Odoo.

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