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

vendor bills generation from the custom module

Langganan

Dapatkan notifikasi saat terdapat aktivitas pada post ini

Pertanyaan ini telah diberikan tanda
modulecustomvendorbilling
5 Replies
7471 Tampilan
Avatar
Dreamy

Hello Experts,    

I am trying to generate vendor bills from the custom module. but code is inserting/creating bills in the customer invoice.  Following is the code which i am using. Can you please guide where i am doing wrong.

@api.multi

    def create_invoices(self):

        self.state = 'create_invoices'

        inv_obj = self.env['account.invoice']

        inv_line_obj = self.env['account.invoice.line']

        vendor = self.vendor_id

        if not vendor.name:

            raise UserError(

                _(

                    'Please select a Vendor Name.'))

        company_id = self.env['res.users'].browse(1).company_id

        currency_value = company_id.currency_id.id

        self.ensure_one()

        ir_values = self.env['ir.values']

        journal_id = ir_values.get_default('cust.mod', 'invoice_journal_type')

        if not journal_id:

            journal_id = 1


        inv_data = {

            'name': vendor.name,

            'reference': self.name,

            'account_id': vendor.property_account_payable_id.id,

            'partner_id': vendor.id,

            'currency_id': currency_value,

            'journal_id': journal_id,

            'origin': self.name,

            'company_id': company_id.id,

        }

        inv_id = inv_obj.create(inv_data)

        for records in self.cust_line:

            if records.exp_id.product_id :

                expense_account = records.exp_id.product.property_account_expense_id.id

            if not expense_account:

                raise UserError(_('There is no expense account defined for this product: "%s".') %

                                (records.exp_id.product.name,))


            inv_line_data = {

                'name': records.exp_id.product.name,

                'account_id': expense_account,

                'price_unit': records.amount,

                'quantity': 1,

                'product_id': records.exp_id.product.product_id,

                'invoice_id': inv_id.id,

            }

            inv_line_obj.create(inv_line_data)

in xml using button code to generate vendor bill.

1
Avatar
Buang
Avatar
Mitul Shingala
Jawaban Terbai

Hello, 

pass the type of the invoice while you create invoice.

see into below dictionary.

 inv_data = {
'type': 'in_invoice',
            'name': vendor.name,
            'reference': self.name,
            'account_id': vendor.property_account_payable_id.id,
            'partner_id': vendor.id,
            'currency_id': currency_value,
            'journal_id': journal_id,
            'origin': self.name,
            'company_id': company_id.id,
        }
1
Avatar
Buang
Hashim Khalid

what if i want to add lines to invoice lines !!!!!!!!!

Mitul Shingala

into inv_data dictionary add the key and value like

{'invoice_line_ids': [(0, 0, inv_line_vals)]

Avatar
subbarao
Jawaban Terbai

you missed type field In Invoice Data .

'type': 'in_invoice'  means Vendor bill
'type': 'out_invoice' means Customer Invoice

By default it's  'out_invoice', so it's creating Customer Invoice

1
Avatar
Buang
Avatar
yasir iqbal
Jawaban Terbai


 inv_data = {
'type': 'in_invoice',
            'name': vendor.name,
            'reference': self.name,
            'account_id': vendor.property_account_payable_id.id,
            'partner_id': vendor.id,
            'currency_id': currency_value,
            'journal_id': journal_id,
            'origin': self.name,
            'company_id': company_id.id,

create a vender bill from purchase order
please tell me the answer as soon as possible.?



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
Vendor Bill Print Customization
print custom vendor billing
Avatar
0
Okt 18
4379
Custom Module Not Populating in Apps List Diselesaikan
module custom
Avatar
Avatar
4
Okt 20
9964
Vendor invoicing with multiple currencies
currency vendor billing
Avatar
0
Mei 24
2125
For Odoo hosted version, how would I upload a custom module? Diselesaikan
module upload custom
Avatar
Avatar
Avatar
Avatar
3
Feb 24
11562
importing custom module
module custom importing
Avatar
Avatar
1
Nov 23
3874
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