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

How to auto generate purchase order from manufacturing in odoo8?

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
openerpodooodooV8
1 Balas
5943 Tampilan
Avatar
bhanukiran

I want to generate a purchase order invoice from the information obtained from mrp. I want to get products from bill of materials(raw materials),price from product's cost price.Right now I have created a button for generating purchase order,it is only copying mrp invoice no and date created it is not entering the inside for loop and also I am not getting how to retrieve the current mrp id,I have hardcoded the id itself.This method is called when the button is pressed.

from openerp import models,api
class mrp_production(models.Model):
    _inherit = 'mrp.production'

    @api.multi
    def generate_purchase_order(self,supplier_id,pricelist_id,warehouse_id):
        purchase_obj = self.env['purchase.order']
        purchase_line_obj = self.env['purchase.order.line']
        warehouse_obj = self.env['stock.warehouse']

        warehouse = warehouse_obj.browse(warehouse_id)
        if not warehouse:
            return False
        if isinstance(warehouse, list):
            warehouse = warehouse[0]

        for order in self.browse(1):#how to remove this hardcoded id?
            vals = {}
            vals = purchase_obj.onchange_partner_id(supplier_id)
            vals['origin'] = order.name
            vals['partner_id'] = supplier_id
            vals['pricelist_id'] = pricelist_id
            vals['warehouse_id'] = warehouse_id
            vals['location_id'] = warehouse.lot_stock_id.id
            vals['date_order'] = order.date_planned
            purchase_id = purchase_obj.create(vals)

            for line in self.bom_id.bom_line_ids:
            #this for loop is not getting executed
                if not line.product_id:
                    continue

                line_vals = purchase_line_obj.onchange_product_id(self,pricelist_id,line.product_id.id,
                                                line.product_uom_qty, line.product_uom.id, supplier_id,
                                                date_planned=line.date_planned)['value']

                line_vals['product_id'] = line.product_id.id
                if not line_vals.get('price_unit', False):
                    line_vals['price_unit'] = line.product_id.list_price
                line_vals['product_uom'] = line.product_uom.id
                line_vals['product_uom_qty'] = 181.13
                line_vals['order_id'] = purchase_id
                purchase_line_obj.create(line_vals)

        return True

0
Avatar
Buang
Avatar
Nikunj Antala
Jawaban Terbai

Hello Bhanukiran,

As per new api we can access its fields and methods from directly using self because self it self is browsable record.

Example :

class account_invoice(models.Model):

    _name = "account.invoice"

    def test_function(self):

    for invoice in self:

        print invoice.number # It will print Number of all invoices


Hope this help.

0
Avatar
Buang
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
How to provide the read only visibility access for an employee to "Employee" menu under "Human Resources" module in Odoo8
openerp odoo odooV8
Avatar
Avatar
1
Des 16
5622
How to create a checkbox field in odoo 8? Diselesaikan
openerp odoo odooV8
Avatar
Avatar
Avatar
Avatar
Avatar
6
Agu 16
29492
how to inherit field value from one module to another module?
openerp odoo odooV8
Avatar
Avatar
Avatar
4
Apr 16
7845
Unable to start odoo 8 from eclipse Diselesaikan
openerp odoo odooV8
Avatar
Avatar
Avatar
6
Nov 15
6099
weekly promotions OR auto mailing after a week or defined duration to customers ?
openerp odoo odooV8
Avatar
Avatar
1
Mar 15
3990
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